Skip to main content
Track Telegram groups and channels in real-time. Capture messages, token mentions, and media — then backfill historical data on demand.

What You Can Do

CapabilityEndpointDescription
Track GroupPOST /track/telegramMonitor a Telegram group or channel
Get SourceGET /track/telegramRetrieve a tracked Telegram source
Delete TrackingDELETE /track/telegramStop tracking a Telegram source
BackfillPUT /backfillTrigger historical message backfill
HistoryGET /account/history/:idRetrieve backfilled historical messages

Track a Telegram Group

Start receiving real-time messages from any Telegram group or channel.
curl -X POST https://scrape.st/track/telegram \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sid": "crypto_signals_group"}'
Response: Telegram tracking is an asynchronous process because the Telegram client may need to resolve the invite link or username and join the channel. The API returns a 202 Accepted status along with a jobId:
{
  "message": "Tracking request for \"crypto_signals_group\" on telegram has been queued",
  "jobId": "65"
}

Check Tracking Status

You can poll the status endpoint to know when the tracking process completes and to get the internal ID (src_...) of the source.
curl -X GET "https://scrape.st/track/status/telegram/65" \
  -H "x-api-key: YOUR_API_KEY"
Response (In Progress):
{
  "jobId": "65",
  "name": "track",
  "state": "active",
  "progress": 0,
  "attempts": 0
}
Response (Completed):
{
  "jobId": "65",
  "name": "track",
  "state": "completed",
  "progress": 100,
  "attempts": 1,
  "returnValue": {
    "name": "Crypto Signals Group",
    "username": "crypto_signals_group",
    "id": "src_456",
    "externalId": "-1001234567890"
  }
}
You’ll need the id from the returnValue (src_456 in this example) if you want to run historical backfills for this group later.

Search Messages & Users

Search for messages matching a keyword globally or within specific channels. You can also search for Telegram users and channel participants.
# Search globally for crypto messages
curl -X GET "https://scrape.st/telegram/search?q=crypto&limit=20" \
  -H "x-api-key: YOUR_API_KEY"

# Search messages within a specific channel
curl -X GET "https://scrape.st/telegram/channel/@durov/search?q=update&limit=20" \
  -H "x-api-key: YOUR_API_KEY"

# Search for users by username
curl -X GET "https://scrape.st/telegram/users/search?q=satoshi&limit=10" \
  -H "x-api-key: YOUR_API_KEY"

Backfill History

Retrieve historical messages from tracked Telegram groups.
In the examples below, src_456 is the internal ID of the Telegram group/channel whose historical data you want to pull. This is the same id returned when you created the tracking via POST /track/telegram.
# Trigger backfill for a Telegram source
curl -X PUT https://scrape.st/backfill \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id": "src_456"}'

# Check backfill status
curl -X GET "https://scrape.st/backfill/status?id=src_456" \
  -H "x-api-key: YOUR_API_KEY"

# Retrieve historical messages
curl -X GET "https://scrape.st/account/history/src_456?limit=50" \
  -H "x-api-key: YOUR_API_KEY"

Download Media

You can download media attached to a Telegram message using the channel ID and message ID. This endpoint returns the raw file buffer with appropriate Content-Type headers and is aggressively rate-limited to 2 requests per minute to prevent abuse.
# Download a photo/video/document from a message
curl -X GET "https://scrape.st/telegram/media/2453451956/2410" \
  -H "x-api-key: YOUR_API_KEY" \
  --output media.jpg

Webhook Payload

When a tracked Telegram group receives a message, your webhook receives a SourceEvent object. This is the exact shape sent via JSON.stringify to your webhook URL:
{
  "mid": 2410,
  "sid": "2453451956|-3611607141753548436",
  "source": "telegram",
  "timestamp": 1777820233000,
  "payload": {
    "id": 2410,
    "fromId": {
      "userId": "976665869",
      "className": "PeerUser"
    },
    "fromBoostsApplied": null,
    "peerId": {
      "channelId": "2453451956",
      "className": "PeerChannel"
    },
    "fwdFrom": null,
    "viaBotId": null,
    "viaBusinessBotId": null,
    "replyTo": null,
    "date": 1777820233,
    "message": "Let's see what a payload looks like",
    "media": null,
    "replyMarkup": null,
    "entities": null,
    "views": null,
    "forwards": null,
    "replies": {
      "flags": 0,
      "comments": false,
      "replies": 0,
      "repliesPts": 3051,
      "recentRepliers": null,
      "className": "MessageReplies"
    },
    "editDate": null,
    "ttlPeriod": null,
    "quickReplyShortcutId": null,
    "effect": null,
    "factcheck": null,
    "reportDeliveryUntilDate": null,
    "className": "Message"
    // ... other MTProto fields (flags, media, forwards, replies, etc.)
  }
}
FieldTypeDescription
midnumberMessage ID — the Telegram message ID
sidstringSource ID — the Telegram chat/channel ID
sourcestring"telegram"
timestampnumberUnix timestamp (ms) when the event was received
payloadobjectRaw Telegram message object

Delivery Methods

Telegram data is delivered through all the same channels as X:
  • Webhooks — Push to your endpoint
  • WebSocket — Real-time bidirectional stream
  • SSE — Server-sent events with auto-reconnect

API Reference

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

Telegram Queries