X / Twitter Trends API
Get current X (Twitter) trends for worldwide, a country, or a city in X ranking order, including the resolved location.
Provider network
Providers ranked by traffic
Try it
Make your first request
{
"data": {
"asOfUtc": 12.5,
"items": [
{
"isHashtag": true,
"name": "Example title",
"promoted": true,
"query": "example",
"rank": 1
}
],
"location": "example",
"locationId": "a1b2c3d4"
},
"found": true
}interface TwitterTrendsResponse {
data: {
asOfUtc: number;
items: {
isHashtag?: boolean;
name: string;
promoted?: boolean;
query: string;
rank: number;
}[];
location: string;
locationId: string;
} | null;
found: boolean;
}Full parameter and response reference - every field, type, and example for this endpoint.
Reference
Request, response, and price
Last verified 2026-09-16 · uptime and latency measured over 30dcurl -X POST https://api.getanyapi.com/v1/run/twitter.trends \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"limit":10,"location":"US"}'| Field | Type | Example value |
|---|---|---|
| Request body | ||
| limit | integer | 10Maximum number of ranked trends to return (1-50, default 50). |
| location | string | "US"Country name, city name, or ISO country code. Omit for worldwide trends. |
| requireFields | array | Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `promoted`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a trend that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. |
| Response | ||
| data | object | The resolved location and its current ranked trends, or null when unavailable. |
| data.asOfUtc | number | UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. Populated whenever the provider has data for the entity. |
| data.items | object[] | Current trends in X's own ranking order. Distinct ranks may carry the same trend name. Populated whenever the provider has data for the entity. |
| data.items[].isHashtagcan require | boolean | Whether the trend text is a hashtag. |
| data.items[].name | string | Trend text displayed by X. Populated whenever the provider has data for the entity. |
| data.items[].promotedcan require | boolean | Whether X marks the trend as promoted. |
| data.items[].query | string | Search query corresponding to the trend. Populated whenever the provider has data for the entity. |
| data.items[].rank | integer | One-based position in X's trend ranking. Populated whenever the provider has data for the entity. |
| data.location | string | Resolved X trend-location name. Populated whenever the provider has data for the entity. |
| data.locationId | string | Resolved Yahoo WOEID used by X, exposed as a stable location identifier. Populated whenever the provider has data for the entity. |
| found | boolean | Whether X trends were resolved for the requested location. |
| Price | ||
| Price per request | USD | $0.0001 |
| Price /1k req | USD | $0.10 |
FAQ
About the X / Twitter Trends API
The AnyAPI X / Twitter Trends API returns X / Twitter trends data as normalized JSON from one POST call to /v1/run/twitter.trends. Get current X (Twitter) trends for worldwide, a country, or a city in X ranking order, including the resolved location. AnyAPI routes each request across 2 sources and falls back automatically when one fails. It costs from $0.10 per 1,000 requests, in US dollars with no subscription and no monthly minimum. Over the last 30 days, 100.0% of X / Twitter trends calls through AnyAPI succeeded, with a median response time of 1.9 seconds across 162 measured calls.