X (Twitter) Trending Topics Scraper
Pricing
from $0.00005 / actor start
X (Twitter) Trending Topics Scraper
Scrapes trending topics from X.com using Playwright. Extracts trending hashtags, topics, and post counts.
Pricing
from $0.00005 / actor start
Rating
0.0
(0)
Developer
Akash Kumar Naik
Actor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
X (Twitter) Trending Topics Scraper | Real-Time Trend Extraction
Extract trending hashtags, topics, and conversations from X.com (Twitter) in real-time. Perfect for social media monitoring, market research, SEO analysis, and trend tracking.
What Is X Trending Topics Scraper?
X Trending Topics Scraper is a powerful Apify Actor that automatically extracts live trending topics from X.com's Explore page. Whether you need to monitor viral hashtags, track industry conversations, or analyze trending discussions, this scraper delivers structured JSON data you can use for analytics, sentiment analysis, or content strategy.
Key Features
- ✅ Real-Time Extraction - Get current trending topics as they happen
- ✅ Multiple Locations - Scrape trends for different regions
- ✅ Session-Based - Uses authentication cookies for reliable access
- ✅ Structured Output - Clean JSON ready for analysis
- ✅ Proxy Support - Built-in Apify proxy integration
- ✅ Pay-Per-Event - Only pay for results you get
Use Cases
| Who Is It For? | What Can They Do? |
|---|---|
| Digital Marketers | Monitor brand mentions, track viral hashtags, identify influencer topics |
| Journalists | Discover breaking news, find emerging stories, research public sentiment |
| SEO Specialists | Find trending keywords, discover content opportunities, track topic popularity |
| Data Scientists | Collect social media data for ML models, analyze trend patterns |
| Financial Analysts | Track market-moving discussions, monitor industry sentiment |
| Academics | Research social media trends, study viral content patterns |
Getting Started
Run the Actor with default settings:
apify call your-username/x-trending-scraper --input '{"url": "https://x.com/explore/tabs/trending"}'
Or use the Apify Console to run with custom input.
Input Schema Reference
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
url | String | Yes | - | Target X.com URL (e.g., https://x.com/explore/tabs/trending) |
max_trends | Integer | No | 20 | Maximum number of trends to extract (1-100) |
proxyConfiguration | Object | No | Apify Proxy | Proxy settings for anti-bot protection |
Output Data
The Actor outputs structured JSON to the default dataset:
[{"rank": 1,"name": "#POCOX8SeriesSale","category": "Trending in India","post_count": null,"scraped_at": "2026-03-23T12:47:36.755142","source_url": "https://x.com/explore/tabs/trending"},{"rank": 2,"name": "#ShaheedDiwas","category": "Only on X · Trending","post_count": null,"scraped_at": "2026-03-23T12:47:36.759591","source_url": "https://x.com/explore/tabs/trending"}]
Output Fields
| Field | Type | Description |
|---|---|---|
rank | Integer | Position in trending list (1, 2, 3...) |
name | String | Trend name or hashtag |
category | String | Trend category (e.g., "Trending in India", "Politics") |
post_count | String | Number of posts (when available) |
scraped_at | ISO DateTime | When the data was extracted |
source_url | String | Original source URL |
API Integration Examples
Python Example
from apify_client import ApifyClient# Initialize clientclient = ApifyClient('YOUR_APIFY_TOKEN')# Actor inputinput_data = {'url': 'https://x.com/explore/tabs/trending','max_trends': 50}# Run Actor and get resultscall_result = client.actor('your-username/x-trending-scraper').call(input_data)dataset_items = client.dataset(call_result['defaultDatasetId']).list_items()# Process resultsfor item in dataset_items['items']:print(f"#{item['rank']}: {item['name']} - {item['category']}")
JavaScript Example
const { ApifyClient } = require('apify-client');const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });const input = {url: 'https://x.com/explore/tabs/trending',max_trends: 50};const run = await client.actor('your-username/x-trending-scraper').call(input);const { items } = await client.dataset(run.defaultDatasetId).getItems();console.log(items);
cURL Example
apify call your-username/x-trending-scraper --input '{"url": "https://x.com/explore/tabs/trending"}'
Pricing
This Actor uses Pay-Per-Event pricing:
| Event Type | Price | Description |
|---|---|---|
results | $0.005 per trend | Charged per trending topic extracted |
Cost Examples
| Scenario | Trends Extracted | Cost |
|---|---|---|
| Quick check | 20 | $0.10 |
| Standard run | 100 | $0.50 |
| Large extraction | 1,000 | $5.00 |
💡 Tip: The Actor automatically uses the
apify-actor-startsynthetic event, giving you 5 seconds of free compute time per run.
Related Tools
Looking for more X.com data? Try these related Apify Actors:
- X (Twitter) Trends Scraper - Location-based global trends
- X Profile Scraper - User profiles and follower data
- X Posts Scraper - Tweet extraction by keyword or hashtag
- X Search Scraper - Advanced search results
Technical Details
| Specification | Value |
|---|---|
| Language | Python 3.14+ |
| Browser Engine | Playwright (Chromium) |
| Memory | 2 GB |
| Timeout | Configurable |
| Output Format | JSON (Dataset) |
Environment Variables
ACTOR_MAX_TOTAL_CHARGE_USD- User's spending limit (respected automatically)
Troubleshooting
"Session expired" or "Login required"
Your X.com cookies have expired. Get fresh cookies:
- Log out of X.com
- Log back in
- Copy new
auth_tokenandct0values
"No trends extracted"
- Increase wait time in the code
- Verify cookies are correct
- Try using Apify proxy for residential IPs
"Proxy blocked"
Enable Apify proxy in input:
"proxyConfiguration": {"useApifyProxy": true}
Legal & Ethical Notes
- ⚖️ Purpose: This tool is for educational and research purposes
- 📜 Terms: Respect X.com's Terms of Service
- 🔒 Privacy: Only scrape public data you have legitimate access to
- ⏳ Rate Limiting: Use proxies and delays to avoid overwhelming X.com servers
Support
Keywords
x scraper, twitter scraper, trending topics scraper, hashtag tracker, social media monitoring, trend analysis, web scraping, apify actor, python scraper, x.com data extraction, twitter api alternative, trend monitoring tool, social media research, viral content tracker, hashtag analytics
Built with ❤️ using Apify SDK and Playwright