> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sorsa.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Artículos de X

Obtén el contenido completo y los metadatos de cualquier artículo público de X en una solicitud. Un Article es una publicación larga con portada, texto enriquecido de hasta aproximadamente 100.000 caracteres y métricas separadas de la publicación que lo anuncia.

> **Prueba gratuita:** `/article` está disponible con las primeras 100 solicitudes, sin tarjeta ni caducidad. Cada artículo consume una solicitud, sin cargos por caracteres, independientemente de su longitud: hasta 100 artículos completos sin coste.

> **Nota:** consulta la [guía de artículos largos de X](https://api.sorsa.io/blog/x-articles-api) del blog.

***

## Inicio rápido

```bash theme={null}
curl -X POST https://api.sorsa.io/v3/article \
  -H "ApiKey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tweet_link": "https://x.com/SorsaApp/status/1234567890"}'
```

```python theme={null}
import requests

API_KEY = "YOUR_API_KEY"

def get_article(tweet_link):
    resp = requests.post(
        "https://api.sorsa.io/v3/article",
        headers={"ApiKey": API_KEY, "Content-Type": "application/json"},
        json={"tweet_link": tweet_link},
        timeout=30,
    )
    resp.raise_for_status()
    return resp.json()


article = get_article("https://x.com/SorsaApp/status/1234567890")
print(f"Author: @{article['author']['username']}")
print(f"Published: {article['published_at']}")
print(f"Views: {article['views_count']:,}")
print(f"Body length: {len(article['full_text'])} characters")
```

***

## Endpoint

```text theme={null}
POST /v3/article
```

### Cuerpo de la solicitud

| Parámetro    | Tipo   | Obligatorio | Descripción                                                     |
| :----------- | :----- | :---------- | :-------------------------------------------------------------- |
| `tweet_link` | string | Sí          | URL de la publicación que anuncia el artículo o su ID numérico. |

### Respuesta

```json theme={null}
{
  "full_text": "this isn't a cosmetic rebrand. it's a response to how crypto twitter actually works in 2026...",
  "preview_text": "this isn't a cosmetic rebrand. it's a response to how crypto twitter actually works in 2026.\nthe old model was simple...",
  "cover_image_url": "https://pbs.twimg.com/media/G-t2hYTaIAAstc8.jpg",
  "published_at": "2026-01-15T16:24:02Z",
  "views_count": 36538,
  "likes_count": 315,
  "bookmark_count": 38,
  "quote_count": 37,
  "reply_count": 80,
  "retweet_count": 41,
  "author": {
    "id": "1934538036466810880",
    "username": "SorsaApp",
    "display_name": "Sorsa",
    "description": "Crypto social analytics made simple...",
    "followers_count": 6050,
    "verified": false
  }
}
```

### Campos de respuesta

| Campo             | Tipo              | Descripción                                                                |
| :---------------- | :---------------- | :------------------------------------------------------------------------- |
| `full_text`       | string            | Texto completo; puede tener decenas de miles de caracteres.                |
| `preview_text`    | string            | Fragmento mostrado en la cronología antes de «Leer más».                   |
| `cover_image_url` | string o null     | URL de la portada; `null` si no hay.                                       |
| `published_at`    | string (ISO 8601) | Fecha de publicación del artículo, distinta de `created_at` de su anuncio. |
| `likes_count`     | integer           | Me gusta.                                                                  |
| `retweet_count`   | integer           | Retuits.                                                                   |
| `reply_count`     | integer           | Respuestas.                                                                |
| `quote_count`     | integer           | Citas.                                                                     |
| `bookmark_count`  | integer           | Veces guardado.                                                            |
| `views_count`     | integer           | Impresiones totales.                                                       |
| `author`          | object            | Perfil completo del autor, con los campos del objeto User estándar.        |

> **Nombres de campos:** `likes_count`, `retweet_count`, `reply_count`, `quote_count` y `bookmark_count` coinciden con Tweet. La excepción es `views_count`, frente a `view_count` en una publicación. Si procesas ambos formatos juntos, normaliza esa clave al recibir los datos. Consulta [Formato de respuesta](https://docs.sorsa.io/es/response-format).

***

## Distinguir un artículo de una publicación normal

Si conoces el tipo, llama directamente al endpoint correspondiente. Para entradas mixtas, esta función prueba `/article` y recurre a la publicación normal si recibe 404 o un cuerpo de artículo vacío. Un 404 también puede indicar un recurso no disponible, por lo que la segunda consulta puede fallar. Los errores de autenticación, cuota, frecuencia y servidor se propagan, en lugar de tratarse silenciosamente como publicaciones normales.

```python theme={null}
def get_content(tweet_link):
    """Fetch a tweet or article, returning the appropriate object."""
    try:
        article = get_article(tweet_link)
        if article.get("full_text"):
            return {"type": "article", "data": article}
    except requests.HTTPError as error:
        if error.response is None or error.response.status_code != 404:
            raise

    resp = requests.post(
        "https://api.sorsa.io/v3/tweet-info",
        headers={"ApiKey": API_KEY, "Content-Type": "application/json"},
        json={"tweet_link": tweet_link},
        timeout=30,
    )
    resp.raise_for_status()
    return {"type": "tweet", "data": resp.json()}
```

***

## Próximos pasos

* [Búsqueda de publicaciones](https://docs.sorsa.io/es/search-tweets): encuentra artículos por palabras clave.
* [Interacción con publicaciones](https://docs.sorsa.io/es/tweet-engagement): comentarios, citas y retuits del anuncio.
* [Datos históricos](https://docs.sorsa.io/es/historical-data): artículos de meses o años anteriores.
* [Referencia de la API](https://docs.sorsa.io/es/api-reference-guide): especificación de `/article` y demás endpoints.
