Skip to main content
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

CapabilityEndpointDescription
Track UsersPOST /track/twitterMonitor a Twitter account for new tweets
User ProfileGET /x/userFetch user profile by username
Get TweetGET /x/tweetFetch a specific tweet by ID
Search TweetsGET /x/searchFull-text search with pagination
Quick SearchGET /x/quick-searchTypeahead search for users, cashtags, topics
BackfillPUT /backfill/twitterTrigger historical data backfill
HistoryGET /account/historyRetrieve backfilled historical tweets

Track a Twitter User

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 Tweets

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"
  }
}
FieldTypeDescription
midstringMessage ID β€” the tweet ID
sidstringSource ID β€” the author’s Twitter user ID
sourcestring"twitter" or "fast-x" (fast push before GraphQL enrichment)
timestampnumberUnix timestamp (ms) when the event was received
payloadobjectFull ResolvedTweet object (see fields above)

API Reference

All tracking endpoints use /track/:source where :source is twitter, telegram, or discord.