Social media5 min readBy Purrkey teamUpdated

How to check X trends by country or city

Get current X trends for worldwide, a country, or a city in X ranking order with the resolved location, then turn the ranked rows into a 12-market briefing table

On this page

You have 12 markets to review before a regional campaign briefing and need to compare which topics are trending in each place. Call anyapi.twitter.trends once per country or city with limit set to 10, then scan the ranked rows for promoted entries and hashtags. The table feeds decisions about which local conversations to join or avoid

The worksheet below is the deliverable: one row per trend per market, with ranking fields, resolved location and a decision column. No run has been executed for this article, so the table is a design, not a result

Example input and worksheet design

Example input: location is a country code and limit is 10. Replace it with a market from your campaign list

locationlimitrequireFields
US10omitted

The agent fills a table with these columns. Values here are placeholders showing the shape

ranknamequeryisHashtagpromotedurllocationlocationIdasOfUtcdecision
1(trend text)(search query)true or falsetrue or false(X search URL)(resolved location)(resolved WOEID)(UTC epoch seconds)join, review or avoid

Each market gets its own block of ranked rows. Keep the resolved location and locationId beside the rows so a later reviewer can see which place the trend came from

Set the location and the ranked limit

location is optional. Enter a country name, a city name, or an ISO country code, or omit it for worldwide trends. limit is also optional and accepts only 1-50 ranked trends, with a default of 50. For a 10-row table per market, set limit to 10

The input also accepts optional requireFields with isHashtag or promoted. Omit it and routing is unchanged, with the cheapest source serving. If 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

Agents call it through POST /v1/runs with toolId anyapi.twitter.trends. The tool id is anyapi.twitter.trends

Read the output fields that drive a decision

found says whether X trends were resolved for the requested location. data holds the resolved location and its current ranked trends, or null when unavailable. When found is false, reason is not_found: the source states the target does not exist, or returned nothing for it. A found: false answer is a successful call, not an error

Inside data, location is the resolved X trend-location name and locationId is the resolved Yahoo WOEID used by X. asOfUtc is a UTC epoch timestamp in seconds; multiply it by 1000 for a JS Date in milliseconds

data.items lists current trends in X's own ranking order. Distinct ranks may carry the same trend name. Use rank, name and query to choose which search to open. Use isHashtag to group hashtag trends and promoted to separate paid placements from organic trends. The url field is the X search URL for the trend

For a related URL-level view of community posts, the companion guide is list community tweets by URL

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to check X trends
for the 12 markets in the Example list below. Check the current inputs
and price of anyapi.twitter.trends before running. Call the tool once
per market with limit 10. Return one table with rank, name, query,
isHashtag, promoted, url, location, locationId, asOfUtc and decision
(join, review or avoid). If found is false, leave the trend rows empty
and mark the row as not found. Do not guess trends.

Example market list (replace with your own 12 locations):
US
GB
CA
AU
DE
FR
JP
BR
IN
MX
ZA
New York

Keep the first check to one market so you can see how the resolved location and ranked rows appear before running the 12-market sweep

Estimated tool cost

Prices from the PRICE block, read through the Purrkey catalog on November 13, 2026. The tool is listed as max_call: "Maximum per call. Successful runs settle at the actual AnyAPI charge." The totals below are ceilings, not settled charges. Model fees for the agent are not counted

StepFormulaUnit pricePlanned quantityTotal
One location checkcalls x max priceup to $0.00051 per call1$0.00051
Twelve-market briefing sweepcalls x max priceup to $0.00051 per call12$0.00612

Next action

Run one market first, then the 12-market sweep. Start at X trends on Purrkey

Get started by giving this to your agent

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor
  • GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with X (Twitter).
Explore X (Twitter) tools and pricing

FAQ

How do I check X trends by country or city?

Call anyapi.twitter.trends once per market with location set to a country name, city name or ISO country code, and limit set to 10. The response gives ranked trends with the resolved location.

What inputs does anyapi.twitter.trends take?

It takes optional location for a country name, city name or ISO country code, and optional limit from 1 to 50 with a default of 50. It also accepts optional requireFields with isHashtag or promoted.

What does found false mean for X trends?

found says whether X trends were resolved for the requested location. When it is false, reason is not_found, and a found false answer is a successful call, not an error.

Which output fields should I use in the decision table?

Use rank, name, query, isHashtag, promoted, url, location, locationId and asOfUtc to fill the decision table. The decision column records join, review or avoid.

How much does a 12-market X trends sweep cost?

At most $0.00612: 12 calls at up to $0.00051 per call. A single location check is at most $0.00051, and agent model fees are not counted.

Why can requireFields raise the price of an X trends call?

If the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. Naming a combination that no single source returns together is refused as invalid input, with no charge.

Next step

Try this with X (Twitter)

The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.

See X (Twitter) tools

Share this article