Twitter (X) Trending Topics API
Returns the current list of trending topics on Twitter (X) for one country. The only input is the optional country parameter, which defaults to UnitedStates.
Use cases
- Check which topics trend in Japan, India or the UK at the moment you call.
- Flag a brand or keyword when its name appears in the
name field of a trend.
- Group trends by their
context label, such as NFL, to see which categories dominate a market.
- Pick topics to search for or write about while they trend.
Request
curl -X POST "https://api.sandbase.ai/v1/api/twitter/web/trending" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
The result is returned in outputs[0].data.
Parameters
Example response
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"trends": [
{
"context": "NFL · Trending",
"description": null,
"name": "Bears"
}
]
}
Response fields
Notes
- Pass
country as a full name without spaces, such as UnitedStates, UnitedKingdom, SouthKorea or SaudiArabia. An empty request returns UnitedStates.
- The response has no pagination, tweet counts or rank field. The order of
trends is the order returned.
- To see posts about a trend, pass its
name to Twitter (X) Search.
Pricing
$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.