# X (Twitter) Trending API (twitter.trending)

- Canonical page: https://everyinfra.com/en/twitter-api/trending
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "twitter", "action": "trending", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=twitter&action=trending

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| country | not declared | no | not declared | Region code for trending, with world as the global default. Supports us, ca, mx, uk/gb, fr, de, it, es, pt, nl, dk, at, be, ch, gr, ru, tr, kr, sg, id, ph, vn, th, au, il, ae, sa, ar, br, eg, ng, ke, za, jp, and some English country names. Unrecognized inputs return the global ranking. |
| limit | integer (1–) | no | not declared | The most rows to return in this call, an integer of 1 or more. The default applies when you leave it out, and a call can return fewer rows. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| name | Name of the object itself, for account, product and business capabilities. |
| rank | platform-native meaning |
| volume | platform-native meaning |
| period | platform-native meaning |
| collected_at | platform-native meaning |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "twitter",
  "action": "trending",
  "params": {}
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "twitter",
        "action": "trending",
        "params": {},
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 50. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "twitter",
  "action": "trending",
  "results": [
    {
      "id": "#ガルアワ2026AW",
      "name": "#ガルアワ2026AW",
      "rank": 1,
      "volume": "",
      "period": "Live",
      "collected_at": "2026-09-26T10:43:06.684000+00:00",
      "platform": "twitter"
    },
    {
      "id": "#格付けチェック",
      "name": "#格付けチェック",
      "rank": 2,
      "volume": "",
      "period": "Live",
      "collected_at": "2026-09-26T10:43:06.684000+00:00",
      "platform": "twitter"
    }
  ],
  "count": 50,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=twitter
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
