X Trends Lookup by Country, City & WOEID
Get ranked trending topics on X for any country or city, or for all 467 locations at once, with trend type, ready-made search links and post volumes when X publishes them.
Input schema
Input fields, types, required flags, descriptions, defaults, and prefills come from the published definition. Prefill examples are distinct from defaults.
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | required | Choose whether to collect the current trends or list the places X publishes trends for. |
locations | array | optional | Countries, cities, country codes, slugs or WOEIDs (mode=trends). Examples: Worldwide, United States, US, United Kingdom, GB, London, Tokyo, sao-paulo, 23424977. Put "all" to collect every location. Add a country after a comma when two places share a name, for example "Barcelona, ES". |
allLocations | boolean | optional | Collect trends for every place X serves (currently 467 countries and cities, up to 50 trends each). When enabled, the Locations list is ignored. |
Show all input fields
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | required | Choose whether to collect the current trends or list the places X publishes trends for. |
locations | array | optional | Countries, cities, country codes, slugs or WOEIDs (mode=trends). Examples: Worldwide, United States, US, United Kingdom, GB, London, Tokyo, sao-paulo, 23424977. Put "all" to collect every location. Add a country after a comma when two places share a name, for example "Barcelona, ES". |
allLocations | boolean | optional | Collect trends for every place X serves (currently 467 countries and cities, up to 50 trends each). When enabled, the Locations list is ignored. |
maxTrendsPerLocation | integer | optional | How many ranked trends to keep for each location. X publishes up to 50. |
excludeHashtags | boolean | optional | Skip trends that start with #. X applies this filter before returning the list. |
trendNameContains | array | optional | Optional case-insensitive keyword filter. A trend is kept when its name contains at least one of these words. Useful for brand or topic monitoring. |
dedupeAcrossLocations | boolean | optional | When the same trend appears in several requested locations, keep one row with all locations and the best rank instead of one row per location. |
includeSearchUrls | boolean | optional | Include a ready-made X search link for every trend. |
placeTypeFilter | string | optional | Limit the location list to countries, cities and towns, the worldwide entry, or X's unknown place type. |
proxyConfiguration | object | optional | Optional. Use a proxy if you plan very large or repeated runs. |
Download the published input schema
View complete JSON
{
"description": "Get the ranked trending topics of any country or city on X, or list every place X publishes trends for. No login, cookies or API key needed.",
"properties": {
"allLocations": {
"default": false,
"description": "Collect trends for every place X serves (currently 467 countries and cities, up to 50 trends each). When enabled, the Locations list is ignored.",
"prefill": false,
"title": "All available locations",
"type": "boolean"
},
"dedupeAcrossLocations": {
"default": false,
"description": "When the same trend appears in several requested locations, keep one row with all locations and the best rank instead of one row per location.",
"prefill": false,
"title": "Merge repeated trends across locations",
"type": "boolean"
},
"excludeHashtags": {
"default": false,
"description": "Skip trends that start with #. X applies this filter before returning the list.",
"prefill": false,
"title": "Exclude hashtags",
"type": "boolean"
},
"includeSearchUrls": {
"default": true,
"description": "Include a ready-made X search link for every trend.",
"prefill": true,
"title": "Include search links",
"type": "boolean"
},
"locations": {
"default": [
"Worldwide"
],
"description": "Countries, cities, country codes, slugs or WOEIDs (mode=trends). Examples: Worldwide, United States, US, United Kingdom, GB, London, Tokyo, sao-paulo, 23424977. Put \"all\" to collect every location. Add a country after a comma when two places share a name, for example \"Barcelona, ES\".",
"editor": "stringList",
"example": [
"United States",
"GB",
"London",
"sao-paulo",
"23424977"
],
"prefill": [
"Worldwide"
],
"title": "Locations",
"type": "array"
},
"maxTrendsPerLocation": {
"default": 50,
"description": "How many ranked trends to keep for each location. X publishes up to 50.",
"maximum": 50,
"minimum": 1,
"prefill": 3,
"title": "Maximum trends per location",
"type": "integer"
},
"mode": {
"default": "trends",
"description": "Choose whether to collect the current trends or list the places X publishes trends for.",
"editor": "select",
"enum": [
"trends",
"locations"
],
"enumTitles": [
"Trends now by location",
"List all available locations"
],
"prefill": "trends",
"title": "Mode",
"type": "string"
},
"placeTypeFilter": {
"default": "all",
"description": "Limit the location list to countries, cities and towns, the worldwide entry, or X's unknown place type.",
"editor": "select",
"enum": [
"all",
"country",
"town",
"worldwide",
"unknown"
],
"enumTitles": [
"All places",
"Countries",
"Cities and towns",
"Worldwide",
"Unknown place type"
],
"prefill": "all",
"title": "Place type (mode=locations)",
"type": "string"
},
"proxyConfiguration": {
"description": "Optional. Use a proxy if you plan very large or repeated runs.",
"editor": "proxy",
"sectionCaption": "Advanced",
"sectionDescription": "Optional settings for large or repeated runs.",
"title": "Proxy configuration",
"type": "object"
},
"trendNameContains": {
"default": [],
"description": "Optional case-insensitive keyword filter. A trend is kept when its name contains at least one of these words. Useful for brand or topic monitoring.",
"editor": "stringList",
"prefill": [],
"title": "Only trends containing these words",
"type": "array"
}
},
"required": [
"mode"
],
"schemaVersion": 1,
"title": "X Trends by Location",
"type": "object"
}
Output schema
Published result links and storage locations. This schema is not an exhaustive contract for every field in a dataset record.
| Field | Type | Required | Description |
|---|---|---|---|
trends | string | optional | Dataset containing ranked trends per location, location-list rows and problem status rows. |
Download the published output schema
View complete JSON
{
"actorOutputSchemaVersion": 1,
"description": "Ranked X trends per location, with trend type, search links, cross-location overlap and catalog metadata, plus location-list rows and problem status rows.",
"properties": {
"trends": {
"description": "Dataset containing ranked trends per location, location-list rows and problem status rows.",
"template": "{{links.apiDefaultDatasetUrl}}/items",
"title": "Trends and locations",
"type": "string"
}
},
"title": "X Trends Lookup by Country, City & WOEID Output",
"type": "object"
}
Dataset schema
Published dataset views and any declared field definitions. A view can select only a subset of the returned record fields.
Download the published dataset schema
View complete JSON
{
"actorSpecification": 1,
"views": {
"overview": {
"display": {
"component": "table",
"properties": {}
},
"title": "Trends and locations",
"transformation": {
"fields": [
"type",
"location",
"rank",
"trend",
"trendType",
"countryCode",
"locationCount",
"searchUrl",
"asOf",
"collectedAt"
]
}
}
}
}
Key-value schema
Published key-value store definitions, when provided by this build.
This definition is not present in the default published build. See the published README for available documentation.
Published README
Read the full published documentation
X Trends Lookup by Country, City & WOEID
Get the ranked trending topics on X (Twitter) for any country, city, ISO country code, slug or WOEID — or list every place X publishes trends for. Each trend row carries its rank, type, ready-made search link, and the country and parent place where it is trending. No login, cookies or API key needed.
What this actor does
- Two modes:
trendsfor the current ranked list of any place,locationsfor the full catalog X publishes trends for - Finds places by any common form: all 467 catalog places, 62 ISO country codes, URL slugs, friendly aliases and numeric WOEIDs
- Adds context: country, country code, place type and parent country or metro on every trend row
- Compares markets:
locationCount,locationsTrendingInandbestRankshow where the same trend appears, with an optional merge - Filters: remove hashtags, keep only trends containing your keywords, and cap each place at 1–50 trends
- Empty fields are omitted rather than returned as
nullor placeholders
Output per trend (mode = trends)
type: "trend"location— the place you asked for; the WOEID is appended when two places share a namewoeid— X's numeric place identifiercountry,countryCode— the country the place belongs to (omitted for Worldwide)placeType—Country,Town,SupernameorUnknownparentWoeid,parentLocation— the country or metro that contains the place (omitted for Worldwide)rank— position in the place's trending list (1 = top)trend— the trend text, hashtag or cashtagtrendType—hashtag,cashtagortopicisHashtag,isCashtag— boolean helpers for filteringquery— the decoded X search query behind the trendsearchUrl,trendUrl— ready-made search link on x.comlocationCount— number of requested places where this trend appearslocationsTrendingIn— those places, in the order you requested thembestRank— the best (lowest) rank the trend reached across those placespromoted— kept for compatibility; X's public trends endpoint never marks trends as promotedasOf— the timestamp X returns with that place's list; it can advance on each callcollectedAt— when this row was collected (the completion time of that place's request)
tweetVolume is not part of the output because X's public trends endpoint stopped publishing post counts for trends. No volume is invented or zero-filled.
Output per location (mode = locations)
type: "location"location— the place name; the WOEID is appended when names repeatwoeid— X's numeric place identifiercountry,countryCode— the country the place belongs to (omitted for Worldwide)placeType—Country,Town,SupernameorUnknownparentWoeid,parentLocation— the containing country or metro (omitted for Worldwide)collectedAt— when this row was collected
Output: status rows
A run can also contain rows with type: "status":
unknownLocation— the place was not recognized;didYouMeansuggests close matchesambiguousLocation— several places share the name;candidateslists each one with its country and WOEIDnotAvailable— X does not serve trends for that placenoTrends— X returned an empty list for that placenoMatchingTrends— trends existed, but your keyword filter removed them allrateLimited/error— the request could not be completed; retrying usually helpscollectionSummary— one summary row in all-locations runs withtrendCount,locationsWithTrends,locationsTotal,locationsWithoutTrends,notAvailableLocationsandfailedLocations
In allLocations mode the run emits one collectionSummary row instead of one noTrends row per empty place. The summary's locationsWithoutTrends count and locationsTotal tell you how many places had no trends.
Input
| Field | Type | Default | Description |
|---|---|---|---|
mode |
string | trends |
trends to collect the current ranked list, locations to list every place X supports |
locations |
array of strings | ["Worldwide"] |
Places to collect (mode=trends). Names, ISO codes, slugs, aliases and WOEIDs are accepted. Put all to collect every place |
allLocations |
boolean | false |
Collect every place X serves (currently 467); ignores locations when on |
maxTrendsPerLocation |
integer | 50 |
Trends to keep per place (1–50); X publishes at most 50 |
excludeHashtags |
boolean | false |
Skip trends that start with # |
trendNameContains |
array of strings | [] |
Keep only trends whose name contains at least one of these words (case-insensitive) |
dedupeAcrossLocations |
boolean | false |
Keep one row per trend across all requested places, with every place and the best rank |
includeSearchUrls |
boolean | true |
Add searchUrl and trendUrl to each trend |
placeTypeFilter |
string | all |
For mode=locations: all, country, town, worldwide or unknown |
proxyConfiguration |
object | – | Optional proxy override for very large or repeated runs |
Examples
Example: three countries
{
"mode": "trends",
"locations": ["United States", "GB", "Japan"],
"maxTrendsPerLocation": 20
}
Example: cities, a slug and a WOEID
{
"mode": "trends",
"locations": ["London", "sao-paulo", "Barcelona, ES", "23424977"],
"excludeHashtags": true
}
Example: brand monitoring across markets
{
"mode": "trends",
"locations": ["United States", "United Kingdom", "Canada", "Australia"],
"trendNameContains": ["tesla", "spacex"],
"dedupeAcrossLocations": true,
"maxTrendsPerLocation": 50
}
Example: list every place, countries only
{
"mode": "locations",
"placeTypeFilter": "country"
}
Example: every place in one run
{
"mode": "trends",
"allLocations": true,
"maxTrendsPerLocation": 50
}
This requests up to 50 trends for each of the 467 places (about 21,700 rows in a full run). Lower maxTrendsPerLocation if you only need a sample from each place.
Use cases
- Social listening — follow what is breaking out in one city or across several markets
- Newsroom monitoring — spot emerging stories by place before they reach national coverage
- Brand and campaign tracking — filter trends by keyword and see which markets pick them up
- Content planning — use the ready-made search links to explore a trend on X
- Market comparison — compare ranked trends across countries without running separate jobs
- Location discovery — export the full 467-place catalog with country, place type and parent place
Limitations
- No tweet volume. X's public trends endpoint stopped publishing post counts for trends, so no
tweetVolumeis returned and none is estimated. - No history. X's public trends endpoint returns only the current ranked list. Schedule the actor and keep the datasets if you need a time series.
- At most 50 trends per place. X caps each place at 50 and does not paginate. Request more places for broader coverage.
- No category filter. X's public trends response has no News/Sports/Entertainment category. Use
trendNameContainsto keep the topics you care about, orexcludeHashtags. - Some places return no trends. A few places have an empty list at any moment; the actor emits a
noTrendsrow. A very small number are not served at all (notAvailable). InallLocationsmode those places are counted in thecollectionSummaryrow instead of getting a per-place row. - X may repeat a trend inside one place. When X returns the same trend twice in a place's top 50, the actor keeps one row at the better rank.
- Search links may ask you to log in.
searchUrlandtrendUrlare the canonical x.com search links. X shows its login wall to logged-out browsers, but the links open search for signed-in users. - Current snapshot only.
asOfis the timestamp X returns with the list; it can advance on every call even when the trends did not change.collectedAtis the completion time of that place's request, so one long run has different values per place.
FAQ
Do I need an X account, cookies or an API key? No. The actor reads X's public trending data and works without login, cookies or an API key.
How many places can I request?
X currently publishes trends for 467 places: 62 countries, about 400 cities and towns, one worldwide entry and two places with an unknown type. Use allLocations or locations: ["all"] for every one in a single run.
How do I enter a city?
Use the city name (London, Tokyo, Sao Paulo), its slug (sao-paulo) or its numeric WOEID. Country codes such as US, GB, DE and JP also work.
Why does Barcelona return an ambiguous-location row?
X lists more than one place called Barcelona. Add the country code, for example Barcelona, ES, or use the WOEID shown in the candidates list. Bare Singapore returns the country entry; use its WOEID to get the city entry.
Why is there no tweetVolume field?
X's public trends endpoint stopped publishing post counts for trends. The actor does not estimate, infer or zero-fill a number, because any such value would be misleading.
What does locationCount tell me?
It is the number of requested places where that trend appears. locationsTrendingIn names them and bestRank gives the lowest rank across them. With dedupeAcrossLocations enabled, those places are merged into one row.
Why does a place return no trends?
Some places have an empty trending list at that moment. The run continues and emits a noTrends row instead of failing. A few places are not served by X at all and return notAvailable. In allLocations mode, empty places are counted in the single collectionSummary row rather than emitted as separate rows.
Why do I see fewer than 50 trends for a place? X's list can be shorter than 50, and it occasionally repeats a trend. The actor removes within-place repeats, so a list of 50 entries can produce fewer than 50 unique rows.
How fresh is the data?
X recalculates trends continuously. asOf is the timestamp X returns with each place's list. collectedAt is the completion time of that place's request, so in a long all-locations run the last places have later collectedAt values than the first.
Can I get more than 50 trends for one place? No. X's public endpoint returns at most 50 trends per place and has no pagination. Request several places to widen coverage.
Why is there no News/Sports/Entertainment category filter?
X's public trends response does not include a category. The actor does not invent one. Use trendNameContains for the topics you care about, or excludeHashtags.
Why do the search links ask me to log in? X shows a login wall to logged-out browsers. The links are still the canonical x.com search URLs and open search for signed-in users.
Can I get historical trends? No. The public trends surface exposes only the current snapshot; the actor does not claim history.
Is this affiliated with X? No. This is an independent actor that reads publicly visible trending data and is not affiliated with, endorsed by or sponsored by X Corp.
Python quickstart
Use a schema-derived input and the Python standard library to start a run. An Apify account and token are required for execution.
Source build OmGd5pPiMJWniHoUW. Documentation is regenerated from the default published build; private drafts are not included.