channelstring必填
Channel username (required).
https://api.sandbase.ai/v1/api/telegram/web/channel-searchReturns messages matching a search keyword from a specific Telegram channel. Filter results using channel username, query term, and result limit.
[
{
"data": {
"backend": "web",
"channel": "telegram",
"matched": 3,
"messages": [
{
"author": "Telegram News",
"channel": "telegram",
"date": "2026-07-19T17:57:15+00:00",
"forwarded_from": null,
"id": 450,
"is_forwarded": false,
"link_preview": null,
"media": {
"has_unsupported": true,
"photos": [],
"videos": [
{
"duration": "0:14",
"thumb": "https://cdn1.telesco.pe/file/XKRY6qR5SfrtXQ5AYuJ_eqq3Xdp15_X-5xmDozNhQrVplm9BF1upUGc_aENpwCJsftJMbCv_ntEJSvBNGUBLSt_bMWA-asFIfdXcwRqgZ17e0vUPqV_cXAO5o8NaRMBGFbNBnvgd1fmUYTTJ7dCKg8RTa4SM-ysNwkeUoQe7P2tQragKkY0EP9V2UUqIyigUSK6Zb8vOVCNoEhZw5EFV6CoOabMVQ3h-CvD0i22dRhC0oJRDB4mYbaAqw6mPOTLGqlJtMQj2-7bNrOVgmj6TI2f9HADZRSkLSovMYGkRYjMnCAi2csl5u6WavBpEgqIt73VCjo8ExXO-cel6nMDmPg",
"url": "https://cdn1.telesco.pe/file/9998a6a814.mp4?token=D3EGEoodYLO8iHY9DBJzfm7rrV0E8OfAkONlHEl7Xug_CMtQLzZz854yjRaxU7-NwZFDBUH2qUnHQz73Zg1Fc-2mzGIDNA_IXE-QzW5Q6duMQbsrQ15fT2B9nGJahl7kp3gK8Km0UY6x_Zfd5yx6_5OdHJ-Zi-vbgDq-Yj6l8M_1RgZw-_30Z91nf8n5KSLpXUv6BaIp5IcFJ2_BvEN_dM_fem0rsDrV03JL3WzwItnKs0WOCwI_QY6_AM2ICe31SnSTZF8mMBX9C3t6XyxJ3IxRiR-079qN7tX46T5A1sVPJWixbdCjRZYmAMKWi-8nyRS08CFVtR6e3-qkdJFGpA"
}
]
},
"reactions": [],
"reply_to": null,
"text": "⭐️ Rich Text Editor. You can now create articles and long posts in a visual editor that supports dozens of formatting options and allows you to generate text with privacy-conscious AI tools.\n\nJuly Features\n1 • 2 • 3 • 4 • More",
"text_html": "⭐️ <b>Rich Text Editor.</b> You can now create articles and long posts in a <b>visual editor</b> that supports <b>dozens of formatting options</b> and allows you to <b>generate text</b> with privacy-conscious AI tools.<br><br>July Features<br><b>1</b> • <a href=\"https://t.me/telegram/451\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm('Open this link?\\n\\n'+this.href);\">2</a> • <a href=\"https://t.me/telegram/452\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm('Open this link?\\n\\n'+this.href);\">3</a> • <a href=\"https://t.me/telegram/453\" target=\"_blank\" rel=\"noopener\" o…",
"type": "video",
"url": "https://t.me/telegram/450",
"views": "1.25M"
},
{
"author": "Telegram News",
"channel": "telegram",
"date": "2026-04-09T07:02:48+00:00",
"forwarded_from": null,
"id": 439,
"is_forwarded": false,
"link_preview": {
"description": "In today's update we introduce an AI Editor that can translate, transform, or fix your text in just two taps, new features for Polls like attaching media and suggesting new responses for active polls, support for Live and Motion Photos in all apps, bots that…",
"site_name": "Telegram",
"title": "AI Editor, Mighty Polls, Live Photos, Bots Managed by Bots, and More",
"url": "https://telegram.org/blog/ai-editor-mighty-polls-and-more"
},
"media": {
"has_unsupported": false,
"photos": [],
"videos": []
},
"reactions": [],
"reply_to": null,
"text": "For all the features from this update, like scanning documents on iOS, extra security alerts to protect user privacy, and even more options for polls – check out our blog:\nhttps://telegram.org/blog/ai-editor-mighty-polls-and-more\n\nMarch Features\n1 • 2 • 3 • 4 • 5 • 6 • 7 • 8 • 9 • More",
"text_html": "For all the features from this update, like <b>scanning documents</b> on iOS, extra <b>security alerts</b> to protect user privacy, and even more options for polls – check out our blog:<br><a href=\"https://telegram.org/blog/ai-editor-mighty-polls-and-more\" target=\"_blank\" rel=\"noopener\">https://telegram.org/blog/ai-editor-mighty-polls-and-more</a><br><br>March Features<br><a href=\"https://t.me/telegram/429\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm('Open this link?\\n\\n'+this.href);\">1</a> • <a href=\"https://t.me/telegram/430\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm(…",
"type": "text",
"url": "https://t.me/telegram/439",
"views": "3.01M"
},
{
"author": "Telegram News",
"channel": "telegram",
"date": "2026-01-07T18:17:14+00:00",
"forwarded_from": null,
"id": 421,
"is_forwarded": false,
"link_preview": null,
"media": {
"has_unsupported": true,
"photos": [],
"videos": [
{
"duration": "0:06",
"thumb": "https://cdn1.telesco.pe/file/qe5GGy7aw2nxTfzF0neoh9J7LEh9ucW2rFEMr_xLvdMaW3Nn7coSWXqzBSpLsv867V4e_XrCk0JhG80mVPfv6d8PioQpQmxlNn3BDMD8HcpU7iIYULjJAQRRGhsJiPTpYd6Egfl8wIzXOz2sTzEXs0Gmjv_UKEGbpB0kBR1LbPIRbpSQ789JhOkhhtZ1nUJMxNOYHrTrF_654yg0DoDc_52grBklRO8KVZskocQ2RDl8TgKo8pc67ey044SqcpLmvCKfUJ0XJwSDcZGVdPfWr1prNLLml90QhMPp6j4kpEE_lDA6wogOQzUIwYbsaxJGe9rKu7Q4HemoBTUAR2jSMA",
"url": "https://cdn1.telesco.pe/file/042af6c2a6.mp4?token=Hltkrr43lCkAS-vJkzp061vat1eIC8SZeamlPbiM2YXCRZ87ekBxlXBEV94o-SEBt5yJASplA8w_brRts8IvbYBvfS_7Bkwt_4_pITg0N9tfGBRU5fKRbTuINUjmztX1Hu2KydvHndhOwo7ntj83lHhe14KGm2cvnIDz6f55g2z9KF8Mv1PDOHY_A3uf1kjtilEQJ_XllF4yaVmvCfOGbekpS6g7Wqs5p779sWfj-cw3w9kAtFQ6VIEf3x739OI1gYbzlq-PmcpEIp4FdhUo6L_oCSVVT-AwAHb8AAeidR44n1A-cJcBd5t8alw5Lxke1iT9zG_4YsLztMIMwYmDXA"
}
]
},
"reactions": [],
"reply_to": null,
"text": "AI Summaries. Long posts in channels can now be instantly summarized – and Instant View articles (like our blog) show an AI summary at the top.\n\nThese summaries use open-source AI models running on Cocoon – a decentralized network built by Telegram to maximize privacy.\n\nJanuary Features\n1 • 2 • 3 • More",
"text_html": "<b>AI Summaries.</b> Long posts in channels can now be <b>instantly summarized</b> – and Instant View articles <i>(like our blog)</i> <b>show an AI summary</b> at the top.<br><br>These summaries use <b>open-source AI models</b> running on <a href=\"https://t.me/durov/462\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm('Open this link?\\n\\n'+this.href);\">Cocoon</a> – a <b>decentralized network</b> built by Telegram to <b>maximize privacy</b>.<br><br>January Features<br><b>1</b> • <a href=\"https://t.me/telegram/422\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm('Ope…",
"type": "video",
"url": "https://t.me/telegram/421",
"views": "1.88M"
}
],
"note": "网页预览无原生搜索,此为近期历史的尽力过滤;完整搜索需启用 MTProto 后端",
"query": "privacy",
"scanned": 100
}
}
]选择一个示例,将其输入和结果加载到 playground 中。
Returns messages from a public Telegram channel that match a keyword. It needs a channel username in channel and a search term in query, and takes an optional limit.
curl -X POST "https://api.sandbase.ai/v1/api/telegram/web/channel-search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"channel": "telegram", "query": "privacy"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
channel | string | Yes | Channel username (required). |
query | string | Yes | Keyword (required). |
limit | integer | No | Number of hits (1-100, default 20). |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"backend": "web",
"channel": "telegram",
"matched": 3,
"messages": [
{
"author": "Telegram News",
"channel": "telegram",
"date": "2026-07-19T17:57:15+00:00",
"forwarded_from": null,
"id": 450,
"is_forwarded": false,
"link_preview": null,
"media": {
"has_unsupported": true,
"photos": [],
"videos": [
{
"duration": "0:14",
"thumb": "https://cdn1.telesco.pe/file/ghRXw4zEVSj-LcfQyAhVPpz2VZBisrnmpWFJfVERFhfIM4tIdSz…",
"url": "https://cdn1.telesco.pe/file/9998a6a814.mp4?token=RnY3mzsEyhcUooxfanOTo__6Mlhb_N…"
}
]
},
"reactions": [],
"reply_to": null,
"text": "⭐️ Rich Text Editor. You can now create articles and long posts in a visual edit…",
"text_html": "⭐️ <b>Rich Text Editor.</b> You can now create articles and long posts in a <b>v…"
}
],
"note": "网页预览无原生搜索,此为近期历史的尽力过滤;完整搜索需启用 MTProto 后端",
"query": "privacy",
"scanned": 100
}
| Field | Meaning |
|---|---|
matched / scanned | matched is the number of messages that matched the keyword. scanned is the number of recent messages that were checked (100 in this response). |
messages[].id | Numeric ID of the message within the channel. |
messages[].url | Public t.me link to the message. |
messages[].date | Post time as an ISO 8601 timestamp with a UTC offset. |
messages[].text / text_html | Message text as plain text and as HTML. The HTML version keeps formatting such as bold tags. |
messages[].type | Kind of post, such as text or video. |
messages[].views | View count as a short string, for example 1.34M. |
messages[].link_preview.title / link_preview.description / link_preview.url | Title, description and target link of the web page previewed in the post. The value is null when the post has no preview. |
messages[].media.videos[].duration / media.videos[].url | Length of an attached video and its file URL. media.photos lists attached photos. |
messages[].is_forwarded / forwarded_from / reply_to / reactions | Whether the post was forwarded and from where, what it replies to, and its reactions. In this response these are empty, false or null. |
note field in the response says the web preview has no native search. The API filters recent history on a best-effort basis, so older posts may not appear.views is a formatted string like 3.05M, not a number.$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
开始构建
具备统一身份验证和使用情况跟踪的平台 API 端点。
curl -X POST "https://api.sandbase.ai/v1/api/telegram/web/channel-search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"limit": 20,
"query": "privacy",
"channel": "telegram"
}'将您的 SandBase API 密钥设置到服务器环境中。请求使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它。
channelstring必填Channel username (required).
querystring必填Keyword (required).
limitintegerNumber of hits (1-100, default 20).
默认值:20
这是该 API 保存的示例响应;查看时不会发起实时请求。
[
{
"data": {
"backend": "web",
"channel": "telegram",
"matched": 3,
"messages": [
{
"author": "Telegram News",
"channel": "telegram",
"date": "2026-07-19T17:57:15+00:00",
"forwarded_from": null,
"id": 450,
"is_forwarded": false,
"link_preview": null,
"media": {
"has_unsupported": true,
"photos": [],
"videos": [
{
"duration": "0:14",
"thumb": "https://cdn1.telesco.pe/file/XKRY6qR5SfrtXQ5AYuJ_eqq3Xdp15_X-5xmDozNhQrVplm9BF1upUGc_aENpwCJsftJMbCv_ntEJSvBNGUBLSt_bMWA-asFIfdXcwRqgZ17e0vUPqV_cXAO5o8NaRMBGFbNBnvgd1fmUYTTJ7dCKg8RTa4SM-ysNwkeUoQe7P2tQragKkY0EP9V2UUqIyigUSK6Zb8vOVCNoEhZw5EFV6CoOabMVQ3h-CvD0i22dRhC0oJRDB4mYbaAqw6mPOTLGqlJtMQj2-7bNrOVgmj6TI2f9HADZRSkLSovMYGkRYjMnCAi2csl5u6WavBpEgqIt73VCjo8ExXO-cel6nMDmPg",
"url": "https://cdn1.telesco.pe/file/9998a6a814.mp4?token=D3EGEoodYLO8iHY9DBJzfm7rrV0E8OfAkONlHEl7Xug_CMtQLzZz854yjRaxU7-NwZFDBUH2qUnHQz73Zg1Fc-2mzGIDNA_IXE-QzW5Q6duMQbsrQ15fT2B9nGJahl7kp3gK8Km0UY6x_Zfd5yx6_5OdHJ-Zi-vbgDq-Yj6l8M_1RgZw-_30Z91nf8n5KSLpXUv6BaIp5IcFJ2_BvEN_dM_fem0rsDrV03JL3WzwItnKs0WOCwI_QY6_AM2ICe31SnSTZF8mMBX9C3t6XyxJ3IxRiR-079qN7tX46T5A1sVPJWixbdCjRZYmAMKWi-8nyRS08CFVtR6e3-qkdJFGpA"
}
]
},
"reactions": [],
"reply_to": null,
"text": "⭐️ Rich Text Editor. You can now create articles and long posts in a visual editor that supports dozens of formatting options and allows you to generate text with privacy-conscious AI tools.\n\nJuly Features\n1 • 2 • 3 • 4 • More",
"text_html": "⭐️ <b>Rich Text Editor.</b> You can now create articles and long posts in a <b>visual editor</b> that supports <b>dozens of formatting options</b> and allows you to <b>generate text</b> with privacy-conscious AI tools.<br><br>July Features<br><b>1</b> • <a href=\"https://t.me/telegram/451\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm('Open this link?\\n\\n'+this.href);\">2</a> • <a href=\"https://t.me/telegram/452\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm('Open this link?\\n\\n'+this.href);\">3</a> • <a href=\"https://t.me/telegram/453\" target=\"_blank\" rel=\"noopener\" o…",
"type": "video",
"url": "https://t.me/telegram/450",
"views": "1.25M"
},
{
"author": "Telegram News",
"channel": "telegram",
"date": "2026-04-09T07:02:48+00:00",
"forwarded_from": null,
"id": 439,
"is_forwarded": false,
"link_preview": {
"description": "In today's update we introduce an AI Editor that can translate, transform, or fix your text in just two taps, new features for Polls like attaching media and suggesting new responses for active polls, support for Live and Motion Photos in all apps, bots that…",
"site_name": "Telegram",
"title": "AI Editor, Mighty Polls, Live Photos, Bots Managed by Bots, and More",
"url": "https://telegram.org/blog/ai-editor-mighty-polls-and-more"
},
"media": {
"has_unsupported": false,
"photos": [],
"videos": []
},
"reactions": [],
"reply_to": null,
"text": "For all the features from this update, like scanning documents on iOS, extra security alerts to protect user privacy, and even more options for polls – check out our blog:\nhttps://telegram.org/blog/ai-editor-mighty-polls-and-more\n\nMarch Features\n1 • 2 • 3 • 4 • 5 • 6 • 7 • 8 • 9 • More",
"text_html": "For all the features from this update, like <b>scanning documents</b> on iOS, extra <b>security alerts</b> to protect user privacy, and even more options for polls – check out our blog:<br><a href=\"https://telegram.org/blog/ai-editor-mighty-polls-and-more\" target=\"_blank\" rel=\"noopener\">https://telegram.org/blog/ai-editor-mighty-polls-and-more</a><br><br>March Features<br><a href=\"https://t.me/telegram/429\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm('Open this link?\\n\\n'+this.href);\">1</a> • <a href=\"https://t.me/telegram/430\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm(…",
"type": "text",
"url": "https://t.me/telegram/439",
"views": "3.01M"
},
{
"author": "Telegram News",
"channel": "telegram",
"date": "2026-01-07T18:17:14+00:00",
"forwarded_from": null,
"id": 421,
"is_forwarded": false,
"link_preview": null,
"media": {
"has_unsupported": true,
"photos": [],
"videos": [
{
"duration": "0:06",
"thumb": "https://cdn1.telesco.pe/file/qe5GGy7aw2nxTfzF0neoh9J7LEh9ucW2rFEMr_xLvdMaW3Nn7coSWXqzBSpLsv867V4e_XrCk0JhG80mVPfv6d8PioQpQmxlNn3BDMD8HcpU7iIYULjJAQRRGhsJiPTpYd6Egfl8wIzXOz2sTzEXs0Gmjv_UKEGbpB0kBR1LbPIRbpSQ789JhOkhhtZ1nUJMxNOYHrTrF_654yg0DoDc_52grBklRO8KVZskocQ2RDl8TgKo8pc67ey044SqcpLmvCKfUJ0XJwSDcZGVdPfWr1prNLLml90QhMPp6j4kpEE_lDA6wogOQzUIwYbsaxJGe9rKu7Q4HemoBTUAR2jSMA",
"url": "https://cdn1.telesco.pe/file/042af6c2a6.mp4?token=Hltkrr43lCkAS-vJkzp061vat1eIC8SZeamlPbiM2YXCRZ87ekBxlXBEV94o-SEBt5yJASplA8w_brRts8IvbYBvfS_7Bkwt_4_pITg0N9tfGBRU5fKRbTuINUjmztX1Hu2KydvHndhOwo7ntj83lHhe14KGm2cvnIDz6f55g2z9KF8Mv1PDOHY_A3uf1kjtilEQJ_XllF4yaVmvCfOGbekpS6g7Wqs5p779sWfj-cw3w9kAtFQ6VIEf3x739OI1gYbzlq-PmcpEIp4FdhUo6L_oCSVVT-AwAHb8AAeidR44n1A-cJcBd5t8alw5Lxke1iT9zG_4YsLztMIMwYmDXA"
}
]
},
"reactions": [],
"reply_to": null,
"text": "AI Summaries. Long posts in channels can now be instantly summarized – and Instant View articles (like our blog) show an AI summary at the top.\n\nThese summaries use open-source AI models running on Cocoon – a decentralized network built by Telegram to maximize privacy.\n\nJanuary Features\n1 • 2 • 3 • More",
"text_html": "<b>AI Summaries.</b> Long posts in channels can now be <b>instantly summarized</b> – and Instant View articles <i>(like our blog)</i> <b>show an AI summary</b> at the top.<br><br>These summaries use <b>open-source AI models</b> running on <a href=\"https://t.me/durov/462\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm('Open this link?\\n\\n'+this.href);\">Cocoon</a> – a <b>decentralized network</b> built by Telegram to <b>maximize privacy</b>.<br><br>January Features<br><b>1</b> • <a href=\"https://t.me/telegram/422\" target=\"_blank\" rel=\"noopener\" onclick=\"return confirm('Ope…",
"type": "video",
"url": "https://t.me/telegram/421",
"views": "1.88M"
}
],
"note": "网页预览无原生搜索,此为近期历史的尽力过滤;完整搜索需启用 MTProto 后端",
"query": "privacy",
"scanned": 100
}
}
]探索更多
| API | 价格 | 响应 |
|---|---|---|
Telegram | $0.001 每次调用 | JSON |
Telegram | $0.008 每次调用 | JSON |
Telegram | $0.001 每次调用 | JSON |
Telegram | $0.001 每次调用 | JSON |
Telegram | $0.001 每次调用 | JSON |
Telegram | $0.001 每次调用 | JSON |
问题
向 https://api.sandbase.ai/v1/api/telegram/web/channel-search 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。
每次调用 $0.001,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。
必填:channel (string) 和 query (string)。 可选:limit (integer)。 Parameters 表和本页的 Playground 列出了每个字段。
在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。
不需要。Telegram Channel Post Search 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Telegram API 访问权限。