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

# Twitter Trends API

> Trending topics on X (Twitter) with rank, URL and hashtag and promoted flags. Pick worldwide, a country or a major city.

`POST /v1/data/twitter/trends/run`

**Pricing:** $0.001 per trend ($1.00 per 1,000).

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**locations** `string[]` (default: \["Worldwide"])

Where to read trends. Pick Worldwide, any of the 62 countries X reports trends for, or a major city; one request reads them all. Defaults to Worldwide. Through the API any other place X tracks also works: a two-letter country code (US), another city name, or a WOEID (23424977).

123 allowed values, for example `Worldwide`, `Algeria`, `Argentina`, `Australia`, `Austria`, `Bahrain`, `Belarus`, `Belgium`, `Brazil`, `Canada`. Fetch the full list with `GET /v1/data/twitter/trends?expand=options`.

**maxResults** `integer` (default: 50)

How many trends to return in total. Defaults to 50; use 0 for all.

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/twitter/trends/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "locations": [
      "Worldwide"
    ],
    "maxResults": 10
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/twitter/trends/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "locations": [
        "Worldwide"
    ],
    "maxResults": 10
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/twitter/trends/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "locations": [
    "Worldwide"
  ],
  "maxResults": 10
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one trend, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `trendKey` | Trend Key | text |
| `rank` | Rank | integer |
| `trend` | Trend | text |
| `trendUrl` | Trend URL | url |
| `isHashtag` | Is Hashtag | boolean |
| `isPromoted` | Is Promoted | boolean |
| `location` | Location | text |
| `locationType` | Location Type | text |
| `countryCode` | Country Code | text |
| `woeid` | Woeid | text |
| `requestedLocation` | Requested Location | text |
| `asOf` | As Of | datetime |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "twitter/trends",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "asOf": "2026-11-01T12:26:01Z",
      "locationType": "Supername",
      "trendUrl": "https://x.com/search?q=%23VIVANT",
      "trend": "#VIVANT",
      "rank": 1,
      "requestedLocation": "Worldwide",
      "isHashtag": true,
      "trendKey": "1|#VIVANT",
      "location": "Worldwide",
      "countryCode": null,
      "isPromoted": false,
      "woeid": "1"
    }
  ]
}
```

## Related APIs

For tweets on a trend use [`twitter/tweets`](https://docs.mindcase.co/apis/twitter/tweets).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.