acme.com. The matching messages come back in the same response, newest first, each with a text excerpt, its channel, its date, the links it contains and the name of any attached file.
This is an expert search: one indexed source, searched on its own terms. The Telegram source saves every search for your organization and returns its search_history_id. Use that ID to read more pages and to export the results as a file.
To watch a term continuously instead of searching on demand, create a monitor on the Telegram source.
Availability and cost
Availability: Telegram/Discord Monitoring. The same plan feature covers Discord. Plans and quotas lists what each plan includes. Cost: no metered allowance. As with every call made with an API key, each call that returns2xx counts once against your monthly API Calls allowance. See Rate limits.
Without the feature, or when your license is not active, every endpoint on this page returns 403:
429 here always comes from the per-second rate limit or the API Calls allowance. Errors explains each body.
Search
telegram-search-create runs the search and returns the first page of matches.
Scope a search to channels and a date range:
Query syntax
Matching is case-insensitive. A plain word also matches longer words that start with it, soacme finds acmecorp.
Three rules shape a query:
ANDbinds beforeOR.acme.com AND combo OR credentialsreads as(acme.com AND combo) OR credentials. Parentheses do not group terms, so leave them out and repeat the shared term:acme.com AND combo OR acme.com AND credentials.- Ten terms at most. A longer query returns
400. - Symbol terms need length. A term with symbols needs at least 3 characters besides them, 4 if it contains one
*or?, and 5 if it contains more.
400 with the reason after Invalid search query::
created: range or channel_ids, a symbol term that is too short, and a date filter in any form other than the two created: formats.
What comes back
total— messages that match. Treat it as approximate whentotal_is_estimateistrue.total_is_estimate—truewhen the exact count took too long.totalis then the database’s estimate, or the number of rows read so far when no estimate is available.channels_matched— distinct channels with a match. It reads0when more than 10,000 messages match or whentotalis an estimate.page,page_size,total_pages— where you are in the result set.query_info— how the source read your query.parsed_query.termslists each term with itsoperator(ANDorOR, how it joins the term before),negated,is_phraseandfuzzy_distance. Check it when a query returns less than you expect.search_history_id— the ID of the saved search. Use it to read more pages and to export.warning— set when more than 10,000 messages match, with suggestions to narrow the query. Otherwisenull.
results is one message:
message_id— the message’s ID in its Telegram channel.channel_id— the channel’sidintelegram-channels. Send it inchannel_idsto search that channel again.channel_username— the channel’s username or link, ornull.user_id— the source’s internal ID for the sender, ornull.text_preview— an excerpt about twicecontext_charswide that starts about 60 characters before the first match....marks trimmed text. When no term appears literally in the message, it is the start of the message.date— when the message was posted, as an ISO 8601 timestamp.has_media,media_type,file_name— whether the message carries an attachment, its type and its file name.links— the URLs in the message, ornull.channel_count,channels_list— alwaysnull.
Read more pages
telegram-search-history-results/{history_id} returns another page of a saved search. Pass the search_history_id in the path.
pageis 1-based.page_sizedefaults to10, max100.- The call runs the saved search again with its saved query, channels,
context_charsandunique_only, so it reflects messages collected since. Eachpageandpage_sizepair is then cached for 5 minutes, so paging back and forth inside that window stays consistent. - The response has the same shape as the search.
search_history_idandwarningarenull, andquery_infoadds anote.
telegram-search-create again with a higher page also works, but it saves a new search each time.
Export the results
telegram-search-history-export/{history_id} runs a saved search again and returns up to 10,000 matching messages as a file.
- CSV columns:
Message ID,Channel,Channel ID,Date,Message Preview,Has Media,Media Type,File Name,Links. - JSON: an array of objects with
message_id,channel,channel_id,date,text_preview,has_media,media_type,file_nameandlinks. - The export does not apply
unique_only. It returns every matching message, duplicates included.
List saved searches
telegram-search-history lists your organization’s saved Telegram searches, newest first.
pageis 1-based.page_sizedefaults to20, max200.- The response holds
items,total,page,page_sizeandtotal_pages. - Each item carries
id(thehistory_idfor the results and export calls),query,parsed_query,channel_ids,context_chars,total_matches,channels_matched,searched_atandexecution_time_ms.
Channels and categories
telegram-channels lists the tracked channels. The list is the same for every organization.
The response holds
items, total, page, page_size and total_pages. Each channel carries id, channel_id, username, title, description, category_id, category_name, is_active, is_private, requires_invite, last_scraped_at, total_messages_scraped and created_at.
Send the channel
id in channel_ids. channel_id on a channel item is Telegram’s own channel ID and can be null. The channel_id on a search result is the channel id.telegram-channels-categories returns every category in one response, with no paging: items and total. Each category carries id, category_name, category_description, channel_count and created_at. Pass its id as category_id.
Suggest a channel
telegram-channels-suggestions-create proposes a channel for collection. The DarknetSearch team reviews each suggestion.
channel_url is required. suggested_category and reason are optional. The call returns 201 with the suggestion: id, channel_url, suggested_category, reason, status (pending), organization_id and created_at.