Every request must include your API key in the request headers.
Header
x-api-key
Value
The API_KEY value from your .env file
Fetch recent messages from any Telegram channel, group, or user you have access to.
Parameters
target required
string
β
Username, invite link, or ID (e.g. BinanceWaves)
limit
integer
50
Max number of messages to return
search
string
β
Filter messages by keyword
download_media
boolean
false
If true, downloads photos/videos and returns URL
Example β cURL
curl -X GET "https://your-domain.com/api/v1/messages?target=BinanceWaves&limit=5" \
-H "x-api-key: YOUR_API_KEY"
Example β Search with Media
curl -X GET "https://your-domain.com/api/v1/messages?target=MyChannel&search=Bitcoin&download_media=true" \
-H "x-api-key: YOUR_API_KEY"
Response
{
"target": "BinanceWaves",
"count": 2,
"messages": [
{
"id": 14502,
"text": "Bitcoin has reached a new all-time high!",
"date": "2026-04-30T10:15:00+00:00",
"sender_id": 123456789,
"views": 45000,
"media": null
},
{
"id": 14501,
"text": "Trading pairs for $XYZ listed tomorrow.",
"date": "2026-04-30T09:30:00+00:00",
"sender_id": 123456789,
"views": 41200,
"media": "/api/v1/media/photo_14501.jpg"
}
]
}