Monitor Twitter/X accounts in real-time with sub-second latency. Track users, search tweets by keyword or cashtag, fetch user profiles, and backfill historical data.
What You Can Do
| Capability | Endpoint | Description |
|---|
| Track Users | POST /track/twitter | Monitor a Twitter account for new tweets |
| User Profile | GET /x/user | Fetch user profile by username |
| Get Tweet | GET /x/tweet | Fetch a specific tweet by ID |
| Search Tweets | GET /x/search | Full-text search with pagination |
| Quick Search | GET /x/quick-search | Typeahead search for users, cashtags, topics |
| Backfill | PUT /backfill/twitter | Trigger historical data backfill |
| History | GET /account/history | Retrieve backfilled historical tweets |
Start receiving real-time tweets from any public Twitter account.
curl -X POST https://scrape.st/track/twitter \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sid": "elonmusk"}'
Response:
{
"data": {
"id": "src_123",
"source": "TWITTER",
"externalId": "elonmusk",
"username": "elonmusk",
"name": "Elon Musk"
},
"message": "Now tracking elonmusk on twitter"
}
Search for tweets matching a keyword, cashtag, or phrase. Useful for monitoring token mentions like $BTC, $ETH, or any trending topic.
# Search for Bitcoin-related tweets
curl -X GET "https://scrape.st/x/search?q=%24BTC&count=20" \
-H "x-api-key: YOUR_API_KEY"
# Quick search (typeahead) for users and cashtags
curl -X GET "https://scrape.st/x/quick-search?q=solana&resultTypes=users,cashtags" \
-H "x-api-key: YOUR_API_KEY"
Backfill History
Trigger a historical backfill to retrieve past tweets from tracked accounts.
In the examples below, src_123 is the external ID (e.g. the Twitter user ID) of the account whose historical data you want to pull. This is the same externalId returned when you created the tracking via POST /track/twitter.
# Trigger backfill
curl -X PUT https://scrape.st/backfill/twitter \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sid": "src_123"}'
# Check backfill status
curl -X GET "https://scrape.st/backfill/status?sid=src_123" \
-H "x-api-key: YOUR_API_KEY"
# Retrieve historical data
curl -X GET "https://scrape.st/account/history/twitter/src_123?page=1&limit=50" \
-H "x-api-key: YOUR_API_KEY"
Webhook Payload
When a tracked Twitter user posts, your webhook receives a SourceEvent object. This is the exact shape sent via JSON.stringify to your webhook URL:
{
"mid": "1886493083207827456",
"sid": "44196397",
"source": "twitter",
"timestamp": 1712072400000,
"payload": {
"id": "1886493083207827456",
"text": "Bitcoin hits new all-time high! π $BTC",
"created_at": "2024-04-02T15:30:00.000Z",
"lang": "en",
"favorite_count": 15000,
"retweet_count": 3000,
"reply_count": 800,
"quote_count": 400,
"bookmark_count": 1200,
"author": {
"id": "44196397",
"name": "Elon Musk",
"screen_name": "elonmusk",
"profile_image_url": "https://pbs.twimg.com/profile_images/xxx/photo.jpg",
"verified": true,
"is_blue_verified": true
},
"entities": {
"symbols": [{ "text": "BTC" }],
"hashtags": [],
"urls": [],
"user_mentions": []
},
"media": [],
"retweeted_tweet": false,
"link": "https://x.com/elonmusk/status/1886493083207827456"
}
}
| Field | Type | Description |
|---|
mid | string | Message ID β the tweet ID |
sid | string | Source ID β the authorβs Twitter user ID |
source | string | "twitter" or "fast-x" (fast push before GraphQL enrichment) |
timestamp | number | Unix timestamp (ms) when the event was received |
payload | object | Full ResolvedTweet object (see fields above) |
API Reference
All tracking endpoints use /track/:source where :source is twitter, telegram, or discord.