Twitter Trends API in 2026: X Endpoints, WOEIDs, Cost
What the Twitter trends API offers in 2026, from X's docs: trends by WOEID, personalized trends, their fields, $0.010 per call, and where to find a WOEID.
Tarun Khatri
Published · Updated · 6 min read
The Twitter trends API is now two X endpoints: trends for a place, keyed by a WOEID, and personalized trends for one signed-in user.
This guide is for developers who want a Twitter trending topics API that works on X (Twitter) today. You get the paths, fields, price and WOEIDs. We run Weir, which has no trends endpoint; the last part shows what it does instead.
Your first call, for worldwide trends with post counts:
curl "https://api.x.com/2/trends/by/woeid/1?max_trends=10&trend.fields=trend_name,tweet_count" \
-H "Authorization: Bearer $X_BEARER_TOKEN"
What does the X trends API offer in 2026?
X's docs list two trends endpoints, as of 22 October 2026:
| Endpoint | Path | Sign-in | Fields |
|---|---|---|---|
| By WOEID | GET /2/trends/by/woeid/:woeid |
App or user token | Name, post count |
| Personalized | GET /2/users/personalized_trends |
User token + Premium | Name, post count, category, since |
We have no X API key, and our token-less call got a 401, so what follows comes from X's docs.
Trends by WOEID: up to 50 trends for one place
The call takes a WOEID in the path and two optional query parameters:
max_trendssets how many trends come back, from 1 to 50. The default is 20.trend.fieldspicks the fields,trend_nameandtweet_count.
Here's a response from X's December 2023 launch post, trimmed to two trends:
{
"data": [
{ "trend_name": "#NEWACM", "tweet_count": 2101 },
{ "trend_name": "Inflation", "tweet_count": 92763 }
]
}
So volume is there, as tweet_count, if you ask for it. X's docs don't say what time window it covers.
An app token works, so a backend can poll it on a schedule.
Personalized trends: for one signed-in Premium user
GET /2/users/personalized_trends returns the trends X picks for that user. X's docs list what it needs:
- A user access token, through OAuth 2.0 with PKCE.
- A "Premium User Subscription" on that user's account.
- Patience: 10 requests per 15 minutes per user, and 100 a day.
It returns trend_name, post_count, category and trending_since. X's spec types post_count as a string, so parse it before you do math.
It takes no location, so it can't stand in for a city's trends.
How much does the Twitter trends API cost?
X's pricing page lists "Trends" at $0.010 per request, as of October 2026. You pay per call, not per trend, and the page doesn't split the two endpoints.
So there's no free Twitter trends API from X: you buy credits first. Our X API pricing guide covers the starter credits.
Polling is where the cost adds up:
Each bar is calls over 30 days, times $0.010.
What happened to v1.1 trends/place?
The old v1.1 GET trends/place returned the top 50 trends for a place, many with a 24-hour tweet_volume, its archived reference says.
That page now redirects to the docs.x.com home page. X's v1.1-to-v2 endpoint map has no trends row.
The route still answers: on 22 October 2026, our token-less call got "Bad Authentication data," not "not found." We couldn't test it with a key, so build on v2.
What is a WOEID, and where do you find one?
A WOEID, or "Where On Earth ID," is a place number Yahoo created. X's old docs say it "has been deprecated," yet X's trends still use it.
X's v2 docs list eight common ones:
Worldwide 1 New York 2459115
United States 23424977 Los Angeles 2442047
United Kingdom 23424975 London 44418
Japan 23424856 Tokyo 1118370
For other places, the npm package twitter-woeid lists "locations that Twitter has trending topic information for," in its own words. We checked version 1.0.3, from March 2023: it holds 467 places, so treat it as a snapshot.
Measure a topic you already care about with Weir
Weir has no trends endpoint; we checked its API spec to be sure.
What it can do is measure a topic you name. This script counts posts per hour for one keyword, from each post's createdAt:
import os, collections, requests
URL = "https://api.weirapp.io/v1/x/search"
HEADERS = {"Authorization": f"Bearer {os.environ['WEIR_API_KEY']}"}
It pages until the cursor is null or it hits max_pages:
def posts_per_hour(keyword, since, limit=100, max_pages=10):
body = {"query": f"{keyword} -filter:nativeretweets", "language": "en",
"since": since, "limit": limit}
hours = collections.Counter()
for _ in range(max_pages): # each page: 1 credit + 1 per post
r = requests.post(URL, json=body, headers=HEADERS, timeout=60)
r.raise_for_status() # 402 means out of credits
page = r.json()
hours.update(p["createdAt"][:13] for p in page["data"])
if not page["meta"]["nextCursor"]:
return hours, True # every matching post counted
body = {**body, "cursor": page["meta"]["nextCursor"]}
return hours, False # stopped at max_pages
-filter:nativeretweets drops reposts, which X's search returns by default.
We tried it on "kubernetes" on 22 October 2026 at 18:20 UTC, with tiny limits to fit our test budget:
hours, complete = posts_per_hour("kubernetes", "2026-10-22T16:00:00Z",
limit=2, max_pages=1)
for hour, count in sorted(hours.items()):
print(f"{hour}:00 UTC {count} posts")
print("complete" if complete else "stopped at max_pages: a floor, not a total")
We sent the search through Weir's MCP server, which takes the same fields, for 3 credits. Fed that reply, the script printed:
2026-10-22T18:00 UTC 2 posts
stopped at max_pages: a floor, not a total
The cursor wasn't null, so more posts matched. The two we got were about six minutes apart.
For a real count, set limit to 100 and raise max_pages. X serves about 20 posts a page, and a full walk often ends on one empty 1-credit page. Our hashtag tracker guide adds top posts and alerts.
When not to use Weir
- You need X's trending list. Only X's trends endpoints have it.
- You need hourly volume for a query. X's counts endpoint returns it without reading posts, as our Twitter search API guide shows.
- You need a contract with X. Weir isn't licensed by X, so access can change.
Weir is read-only. Check X's terms for your use; this isn't legal advice.
FAQ
Is there a free Twitter trends API?
Not from X. Its API runs on prepaid credits, and trends cost $0.010 a request, as of October 2026. For a quick look, X's Help Center says the app lists Trends in its Explore tab, free.
What is the X trends API endpoint?
GET /2/trends/by/woeid/:woeid returns trends for a place. GET /2/users/personalized_trends returns one Premium user's trends. The old v1.1 trends/place is gone from X's docs.
Does the Twitter trends API include tweet volume?
Yes, if you ask. Add trend.fields=trend_name,tweet_count to the WOEID call. Personalized trends return post_count as a string. X's docs don't state the time window behind either number.
How do I get trending topics for a country?
Find the country's WOEID, then call trends by WOEID with it. X's docs give the United States as 23424977. For other places, look the number up in a WOEID list first.
Sources
All checked on 22 October 2026, with docs.x.com read as Markdown:
- X API trends: https://docs.x.com/x-api/trends/trends-by-woeid/introduction, https://docs.x.com/x-api/trends/personalized-trends/introduction, https://docs.x.com/x-api/trends/get-trends-by-woeid and https://docs.x.com/x-api/trends/get-personalized-trends
- X API OpenAPI spec, version 2.172: https://docs.x.com/openapi.json
- X API pricing: https://docs.x.com/x-api/getting-started/pricing
- X API rate limits: https://docs.x.com/x-api/fundamentals/rate-limits
- X API changelog, trends lookup added in December 2023: https://docs.x.com/changelog
- X Developers, Trends lookup launch (December 2023, Wayback copy of 25 May 2024): https://devcommunity.x.com/t/announcing-the-users-search-and-trends-lookup-endpoints-in-the-x-api-v2/210567
- X API v1.1 GET trends/place reference (Wayback copy of 23 January 2026): https://developer.x.com/en/docs/x-api/v1/trends/trends-for-location/api-reference/get-trends-place
- X API endpoint map, v1.1 to v2: https://docs.x.com/x-api/migrate/x-api-endpoint-map
- X Help Center, Trends FAQ (Wayback copy of 5 October 2026): https://help.x.com/en/using-x/x-trending-faqs
- twitter-woeid on npm, version 1.0.3: https://www.npmjs.com/package/twitter-woeid
- Weir searchX reference and billing: https://docs.weirapp.io/reference/x/searchX and https://docs.weirapp.io/billing
- Our calls, 22 October 2026: X's replies to token-less trends requests, and one Weir search_x for "kubernetes" (3 credits)