X (Twitter) Trends
POST /api/v1/x/trends
Get trending hashtags, topics, and discussions on X (Twitter) by country or worldwide.
Overview
Get trending hashtags, topics, and discussions on X (Twitter) by country or worldwide.
POST /api/v1/x/trends
Method: POST Path: /api/v1/x/trends Category: Social Media
Request Parameters
Endpoint Parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
| include_tweets | boolean | Optional | Whether to include sample tweets for the top trends. |
| limit | integer | Optional | Maximum number of trending items to return (1-100). |
| location | string | Optional | Country name, country code, or "worldwide" (e.g. us, uk, worldwide). |
| tweets_limit | integer | Optional | Number of sample tweets per trend if include_tweets is true (1-10). |
Request Example
X (Twitter) Trends Request Examples
curl -X POST "https://api.dataguru.cc/api/v1/x/trends" \ -H "Authorization: Api-Key YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"include_tweets": "False", "limit": "50", "location": "worldwide", "tweets_limit": "3"}'
Response Example
200 OK
Typical 200 OK JSON response structure with envelope metadata.
{ "x_trends": { "location": "string", "location_slug": "string", "source_url": "https://example.com/...", "scraped_at": "2026-01-01T12:00:00Z", "total_trends": 0, "total_hashtags": 0, "total_topics": 0, "top_hashtags": [ { "rank": 0, "name": "string", "type": "hashtag", "clean_name": "string", "description": "string", "post_url": "https://example.com/...", "current_rank": 0, "peak_rank": 0, "hours_trending": 0, "rank_change": "string", "status": "NEW", "tweet_count": "string", "sample_tweets": [ { "post_id": "1234567890", "post_url": "https://example.com/...", "author_username": "string", "author_name": "string", "author_id": "1234567890", "author_profile_image": "string", "text": "string", "embedded_hashtags": [ "string" ], "create_time": "string", "reply_count": 0, "retweet_count": 0, "like_count": 0, "quote_count": 0, "view_count": 0, "save_count": 0, "is_retweet": false, "is_pinned": false } ], "hashtag": "string", "overall_rank": 0 } ], "popular_topics": [ { "rank": 0, "name": "string", "type": "hashtag", "clean_name": "string", "description": "string", "post_url": "https://example.com/...", "current_rank": 0, "peak_rank": 0, "hours_trending": 0, "rank_change": "string", "status": "NEW", "tweet_count": "string", "sample_tweets": [ { "post_id": "1234567890", "post_url": "https://example.com/...", "author_username": "string", "author_name": "string", "author_id": "1234567890", "author_profile_image": "string", "text": "string", "embedded_hashtags": [ "string" ], "create_time": "string", "reply_count": 0, "retweet_count": 0, "like_count": 0, "quote_count": 0, "view_count": 0, "save_count": 0, "is_retweet": false, "is_pinned": false } ], "topic": "string", "overall_rank": 0 } ], "all_trends": [ { "rank": 0, "name": "string", "type": "hashtag", "clean_name": "string", "description": "string", "post_url": "https://example.com/...", "current_rank": 0, "peak_rank": 0, "hours_trending": 0, "rank_change": "string", "status": "NEW", "tweet_count": "string", "sample_tweets": [ { "post_id": "1234567890", "post_url": "https://example.com/...", "author_username": "string", "author_name": "string", "author_id": "1234567890", "author_profile_image": "string", "text": "string", "embedded_hashtags": [ "string" ], "create_time": "string", "reply_count": 0, "retweet_count": 0, "like_count": 0, "quote_count": 0, "view_count": 0, "save_count": 0, "is_retweet": false, "is_pinned": false } ] } ], "longest_trending": [ { "rank": 0, "name": "string", "type": "hashtag", "clean_name": "string", "description": "string", "post_url": "https://example.com/...", "current_rank": 0, "peak_rank": 0, "hours_trending": 0, "rank_change": "string", "status": "NEW", "tweet_count": "string", "sample_tweets": [ { "post_id": "1234567890", "post_url": "https://example.com/...", "author_username": "string", "author_name": "string", "author_id": "1234567890", "author_profile_image": "string", "text": "string", "embedded_hashtags": [ "string" ], "create_time": "string", "reply_count": 0, "retweet_count": 0, "like_count": 0, "quote_count": 0, "view_count": 0, "save_count": 0, "is_retweet": false, "is_pinned": false } ] } ], "new_trends": [ { "name": "string", "rank": 0, "type": "hashtag", "post_url": "https://example.com/..." } ], "hourly_timeline": [ { "time": "string", "top_trends": [ "string" ] } ] }, "_metadata": { "request_id": "3f6c1a2e-8b4d-4c1e-9a7f-2d5e6b7c8d9e", "execution_time_ms": 842, "endpoint": "X (Twitter) Trends", "mode": "live", "format": "json", "timestamp": "2026-01-01T12:00:00+00:00" } }
Response Schema
Fields returned in a successful response. Nested fields use dot notation and `[]` marks items of a list. Fields that are not required can be missing or `null` when the source does not provide them. Every response also includes a `_metadata` block.
Response Fields
| Field | Type | Required | Description |
|---|---|---|---|
| x_trends | object | Yes | Current X trends for the location. |
| x_trends.location | string | Yes | Location name (e.g. 'United States'). |
| x_trends.location_slug | string | Yes | Normalised location slug (e.g. 'united-states', 'worldwide'). |
| x_trends.source_url | string | Yes | Trend source page the data was read from. |
| x_trends.scraped_at | string | Yes | Scrape time in UTC ISO-8601. |
| x_trends.total_trends | integer | Yes | Number of trends in all_trends. |
| x_trends.total_hashtags | integer | Yes | Number of hashtag trends found. |
| x_trends.total_topics | integer | Yes | Number of topic trends found. |
| x_trends.top_hashtags | array<object> | Yes | Hashtag trends, best first. |
| x_trends.top_hashtags[].rank | integer | Yes | Position in this list (1 = top). |
| x_trends.top_hashtags[].name | string | Yes | Trend name as shown on X, including '#' for hashtags. |
| x_trends.top_hashtags[].type | string | Yes | 'hashtag' or 'topic'. |
| x_trends.top_hashtags[].clean_name | string | Yes | Trend name without a leading '#'. |
| x_trends.top_hashtags[].description | string | Yes | Representative post text or news headline for the trend. Empty string when none was found. |
| x_trends.top_hashtags[].post_url | string | Yes | X search URL for the trend. |
| x_trends.top_hashtags[].current_rank | integer | Yes | Current overall rank. |
| x_trends.top_hashtags[].peak_rank | integer | Yes | Best rank reached in the recent hourly snapshots. |
| x_trends.top_hashtags[].hours_trending | integer | Yes | Number of recent hourly snapshots the trend appeared in. |
| x_trends.top_hashtags[].rank_change | string | Yes | Change since the previous hour: '+N', '-N', '=' or 'NEW'. |
| x_trends.top_hashtags[].status | string | Yes | Movement since the previous hour. |
| x_trends.top_hashtags[].tweet_count | string | null | No | Post volume as shown by the source (e.g. '25K'). Only present for some sources. |
| x_trends.top_hashtags[].sample_tweets | array<object> | No | Sample posts for the trend. Only present on the top 3 trends of all_trends when include_tweets is true. |
| x_trends.top_hashtags[].sample_tweets[].post_id | string | Yes | Numeric post (tweet) ID. |
| x_trends.top_hashtags[].sample_tweets[].post_url | string | Yes | Link to the post on x.com. |
| x_trends.top_hashtags[].sample_tweets[].author_username | string | Yes | Author handle without the '@'. |
| x_trends.top_hashtags[].sample_tweets[].author_name | string | Yes | Author display name. |
| x_trends.top_hashtags[].sample_tweets[].author_id | string | Yes | Numeric author user ID. Empty string when not found. |
| x_trends.top_hashtags[].sample_tweets[].author_profile_image | string | Yes | Author profile picture URL (400x400). Empty string when not found. |
| x_trends.top_hashtags[].sample_tweets[].text | string | Yes | Full post text. |
| x_trends.top_hashtags[].sample_tweets[].embedded_hashtags | array<string> | Yes | Hashtags in the post, without '#'. |
| x_trends.top_hashtags[].sample_tweets[].create_time | string | Yes | Post time in UTC ISO-8601 (YYYY-MM-DDTHH:MM:SSZ). Empty string when unknown. |
| x_trends.top_hashtags[].sample_tweets[].reply_count | integer | null | Yes | Number of replies. |
| x_trends.top_hashtags[].sample_tweets[].retweet_count | integer | null | Yes | Number of reposts. |
| x_trends.top_hashtags[].sample_tweets[].like_count | integer | null | Yes | Number of likes. |
| x_trends.top_hashtags[].sample_tweets[].quote_count | integer | null | Yes | Number of quote posts. |
| x_trends.top_hashtags[].sample_tweets[].view_count | integer | null | Yes | Number of views. |
| x_trends.top_hashtags[].sample_tweets[].save_count | integer | null | Yes | Number of bookmarks. |
| x_trends.top_hashtags[].sample_tweets[].is_retweet | boolean | Yes | True if the post is a repost. |
| x_trends.top_hashtags[].sample_tweets[].is_pinned | boolean | Yes | True if the post is pinned on the author's profile. |
| x_trends.top_hashtags[].hashtag | string | Yes | Hashtag including '#'. |
| x_trends.top_hashtags[].overall_rank | integer | Yes | Rank among all trends (rank is the position among hashtags). |
| x_trends.popular_topics | array<object> | Yes | Non-hashtag topic trends, best first. |
| x_trends.popular_topics[].rank | integer | Yes | Position in this list (1 = top). |
| x_trends.popular_topics[].name | string | Yes | Trend name as shown on X, including '#' for hashtags. |
| x_trends.popular_topics[].type | string | Yes | 'hashtag' or 'topic'. |
| x_trends.popular_topics[].clean_name | string | Yes | Trend name without a leading '#'. |
| x_trends.popular_topics[].description | string | Yes | Representative post text or news headline for the trend. Empty string when none was found. |
| x_trends.popular_topics[].post_url | string | Yes | X search URL for the trend. |
| x_trends.popular_topics[].current_rank | integer | Yes | Current overall rank. |
| x_trends.popular_topics[].peak_rank | integer | Yes | Best rank reached in the recent hourly snapshots. |
| x_trends.popular_topics[].hours_trending | integer | Yes | Number of recent hourly snapshots the trend appeared in. |
| x_trends.popular_topics[].rank_change | string | Yes | Change since the previous hour: '+N', '-N', '=' or 'NEW'. |
| x_trends.popular_topics[].status | string | Yes | Movement since the previous hour. |
| x_trends.popular_topics[].tweet_count | string | null | No | Post volume as shown by the source (e.g. '25K'). Only present for some sources. |
| x_trends.popular_topics[].sample_tweets | array<object> | No | Sample posts for the trend. Only present on the top 3 trends of all_trends when include_tweets is true. |
| x_trends.popular_topics[].sample_tweets[].post_id | string | Yes | Numeric post (tweet) ID. |
| x_trends.popular_topics[].sample_tweets[].post_url | string | Yes | Link to the post on x.com. |
| x_trends.popular_topics[].sample_tweets[].author_username | string | Yes | Author handle without the '@'. |
| x_trends.popular_topics[].sample_tweets[].author_name | string | Yes | Author display name. |
| x_trends.popular_topics[].sample_tweets[].author_id | string | Yes | Numeric author user ID. Empty string when not found. |
| x_trends.popular_topics[].sample_tweets[].author_profile_image | string | Yes | Author profile picture URL (400x400). Empty string when not found. |
| x_trends.popular_topics[].sample_tweets[].text | string | Yes | Full post text. |
| x_trends.popular_topics[].sample_tweets[].embedded_hashtags | array<string> | Yes | Hashtags in the post, without '#'. |
| x_trends.popular_topics[].sample_tweets[].create_time | string | Yes | Post time in UTC ISO-8601 (YYYY-MM-DDTHH:MM:SSZ). Empty string when unknown. |
| x_trends.popular_topics[].sample_tweets[].reply_count | integer | null | Yes | Number of replies. |
| x_trends.popular_topics[].sample_tweets[].retweet_count | integer | null | Yes | Number of reposts. |
| x_trends.popular_topics[].sample_tweets[].like_count | integer | null | Yes | Number of likes. |
| x_trends.popular_topics[].sample_tweets[].quote_count | integer | null | Yes | Number of quote posts. |
| x_trends.popular_topics[].sample_tweets[].view_count | integer | null | Yes | Number of views. |
| x_trends.popular_topics[].sample_tweets[].save_count | integer | null | Yes | Number of bookmarks. |
| x_trends.popular_topics[].sample_tweets[].is_retweet | boolean | Yes | True if the post is a repost. |
| x_trends.popular_topics[].sample_tweets[].is_pinned | boolean | Yes | True if the post is pinned on the author's profile. |
| x_trends.popular_topics[].topic | string | Yes | Topic name. |
| x_trends.popular_topics[].overall_rank | integer | Yes | Rank among all trends (rank is the position among topics). |
| x_trends.all_trends | array<object> | Yes | All trends in rank order, up to the requested limit. |
| x_trends.all_trends[].rank | integer | Yes | Position in this list (1 = top). |
| x_trends.all_trends[].name | string | Yes | Trend name as shown on X, including '#' for hashtags. |
| x_trends.all_trends[].type | string | Yes | 'hashtag' or 'topic'. |
| x_trends.all_trends[].clean_name | string | Yes | Trend name without a leading '#'. |
| x_trends.all_trends[].description | string | Yes | Representative post text or news headline for the trend. Empty string when none was found. |
| x_trends.all_trends[].post_url | string | Yes | X search URL for the trend. |
| x_trends.all_trends[].current_rank | integer | Yes | Current overall rank. |
| x_trends.all_trends[].peak_rank | integer | Yes | Best rank reached in the recent hourly snapshots. |
| x_trends.all_trends[].hours_trending | integer | Yes | Number of recent hourly snapshots the trend appeared in. |
| x_trends.all_trends[].rank_change | string | Yes | Change since the previous hour: '+N', '-N', '=' or 'NEW'. |
| x_trends.all_trends[].status | string | Yes | Movement since the previous hour. |
| x_trends.all_trends[].tweet_count | string | null | No | Post volume as shown by the source (e.g. '25K'). Only present for some sources. |
| x_trends.all_trends[].sample_tweets | array<object> | No | Sample posts for the trend. Only present on the top 3 trends of all_trends when include_tweets is true. |
| x_trends.all_trends[].sample_tweets[].post_id | string | Yes | Numeric post (tweet) ID. |
| x_trends.all_trends[].sample_tweets[].post_url | string | Yes | Link to the post on x.com. |
| x_trends.all_trends[].sample_tweets[].author_username | string | Yes | Author handle without the '@'. |
| x_trends.all_trends[].sample_tweets[].author_name | string | Yes | Author display name. |
| x_trends.all_trends[].sample_tweets[].author_id | string | Yes | Numeric author user ID. Empty string when not found. |
| x_trends.all_trends[].sample_tweets[].author_profile_image | string | Yes | Author profile picture URL (400x400). Empty string when not found. |
| x_trends.all_trends[].sample_tweets[].text | string | Yes | Full post text. |
| x_trends.all_trends[].sample_tweets[].embedded_hashtags | array<string> | Yes | Hashtags in the post, without '#'. |
| x_trends.all_trends[].sample_tweets[].create_time | string | Yes | Post time in UTC ISO-8601 (YYYY-MM-DDTHH:MM:SSZ). Empty string when unknown. |
| x_trends.all_trends[].sample_tweets[].reply_count | integer | null | Yes | Number of replies. |
| x_trends.all_trends[].sample_tweets[].retweet_count | integer | null | Yes | Number of reposts. |
| x_trends.all_trends[].sample_tweets[].like_count | integer | null | Yes | Number of likes. |
| x_trends.all_trends[].sample_tweets[].quote_count | integer | null | Yes | Number of quote posts. |
| x_trends.all_trends[].sample_tweets[].view_count | integer | null | Yes | Number of views. |
| x_trends.all_trends[].sample_tweets[].save_count | integer | null | Yes | Number of bookmarks. |
| x_trends.all_trends[].sample_tweets[].is_retweet | boolean | Yes | True if the post is a repost. |
| x_trends.all_trends[].sample_tweets[].is_pinned | boolean | Yes | True if the post is pinned on the author's profile. |
| x_trends.longest_trending | array<object> | Yes | Trends that have stayed on the list the longest (up to 10). |
| x_trends.longest_trending[].rank | integer | Yes | Position in this list (1 = top). |
| x_trends.longest_trending[].name | string | Yes | Trend name as shown on X, including '#' for hashtags. |
| x_trends.longest_trending[].type | string | Yes | 'hashtag' or 'topic'. |
| x_trends.longest_trending[].clean_name | string | Yes | Trend name without a leading '#'. |
| x_trends.longest_trending[].description | string | Yes | Representative post text or news headline for the trend. Empty string when none was found. |
| x_trends.longest_trending[].post_url | string | Yes | X search URL for the trend. |
| x_trends.longest_trending[].current_rank | integer | Yes | Current overall rank. |
| x_trends.longest_trending[].peak_rank | integer | Yes | Best rank reached in the recent hourly snapshots. |
| x_trends.longest_trending[].hours_trending | integer | Yes | Number of recent hourly snapshots the trend appeared in. |
| x_trends.longest_trending[].rank_change | string | Yes | Change since the previous hour: '+N', '-N', '=' or 'NEW'. |
| x_trends.longest_trending[].status | string | Yes | Movement since the previous hour. |
| x_trends.longest_trending[].tweet_count | string | null | No | Post volume as shown by the source (e.g. '25K'). Only present for some sources. |
| x_trends.longest_trending[].sample_tweets | array<object> | No | Sample posts for the trend. Only present on the top 3 trends of all_trends when include_tweets is true. |
| x_trends.longest_trending[].sample_tweets[].post_id | string | Yes | Numeric post (tweet) ID. |
| x_trends.longest_trending[].sample_tweets[].post_url | string | Yes | Link to the post on x.com. |
| x_trends.longest_trending[].sample_tweets[].author_username | string | Yes | Author handle without the '@'. |
| x_trends.longest_trending[].sample_tweets[].author_name | string | Yes | Author display name. |
| x_trends.longest_trending[].sample_tweets[].author_id | string | Yes | Numeric author user ID. Empty string when not found. |
| x_trends.longest_trending[].sample_tweets[].author_profile_image | string | Yes | Author profile picture URL (400x400). Empty string when not found. |
| x_trends.longest_trending[].sample_tweets[].text | string | Yes | Full post text. |
| x_trends.longest_trending[].sample_tweets[].embedded_hashtags | array<string> | Yes | Hashtags in the post, without '#'. |
| x_trends.longest_trending[].sample_tweets[].create_time | string | Yes | Post time in UTC ISO-8601 (YYYY-MM-DDTHH:MM:SSZ). Empty string when unknown. |
| x_trends.longest_trending[].sample_tweets[].reply_count | integer | null | Yes | Number of replies. |
| x_trends.longest_trending[].sample_tweets[].retweet_count | integer | null | Yes | Number of reposts. |
| x_trends.longest_trending[].sample_tweets[].like_count | integer | null | Yes | Number of likes. |
| x_trends.longest_trending[].sample_tweets[].quote_count | integer | null | Yes | Number of quote posts. |
| x_trends.longest_trending[].sample_tweets[].view_count | integer | null | Yes | Number of views. |
| x_trends.longest_trending[].sample_tweets[].save_count | integer | null | Yes | Number of bookmarks. |
| x_trends.longest_trending[].sample_tweets[].is_retweet | boolean | Yes | True if the post is a repost. |
| x_trends.longest_trending[].sample_tweets[].is_pinned | boolean | Yes | True if the post is pinned on the author's profile. |
| x_trends.new_trends | array<object> | Yes | Trends that are new since the previous hour. |
| x_trends.new_trends[].name | string | Yes | Trend name. |
| x_trends.new_trends[].rank | integer | Yes | Current overall rank. |
| x_trends.new_trends[].type | string | Yes | 'hashtag' or 'topic'. |
| x_trends.new_trends[].post_url | string | Yes | X search URL for the trend. |
| x_trends.hourly_timeline | array<object> | Yes | Top trends in each recent hourly snapshot (up to 12). |
| x_trends.hourly_timeline[].time | string | Yes | Snapshot label as shown by the source. |
| x_trends.hourly_timeline[].top_trends | array<string> | Yes | Top trend names in that hour (up to 10). |
Asynchronous Requests
Long-running requests can be processed in the background. Add `?async=true` (or the `Prefer: respond-async` header) to receive a `job_id` immediately, then poll the job until its status is `COMPLETED`.
Async Workflow
curl -X POST "https://api.dataguru.cc/api/v1/x/trends?async=true" \ -H "Authorization: Api-Key YOUR_API_KEY" # 202 Accepted { "success": true, "status": "SUBMITTED", "job_id": "0ca215ce-244f-4b28-b481-dc1b551983c8", "status_url": "/api/v1/jobs/0ca215ce-244f-4b28-b481-dc1b551983c8/" }
Batch Processing
To run many requests at half price, upload them as a CSV file: one row per request, with the parameter names above as the header row. Rows run in the background within 24 hours (up to 7 days for large files) and each successful row costs 50% of the price below. Poll /api/v1/batches/{batch_id}/ for progress and download results.json when it has finished. See the Batch Processing guide for details.
Batch Workflow
include_tweets,limit,location,tweets_limit False,50,worldwide,3
Pricing & Rate Limits
Endpoint Pricing
$0.003 / per successful request (USD)
Consumed per successful call: 1 request unit(s), 1 credit(s).
Endpoint Rate Limits
Common Errors
Common HTTP Errors
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | A required parameter is missing or malformed. |
| 401 | UNAUTHORIZED | Missing or invalid API key. |
| 402 | INSUFFICIENT_BALANCE | Your balance cannot cover this request. |
| 403 | ENDPOINT_DISABLED | This endpoint is currently unavailable. |
| 405 | METHOD_NOT_ALLOWED | The endpoint was called with the wrong HTTP method. |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests. See the Retry-After header. |
| 502 | PROVIDER_ERROR | The upstream data source failed. Retry with exponential backoff. |