channelstring必須
Channel username; post_id: Post ID; limit: number of comments (1-100).
https://api.sandbase.ai/v1/api/telegram/web/post-commentsReturns comments from the linked discussion group of a specified Telegram channel post. Filters include the channel username, post ID, and an optional limit.
[
{
"data": {
"channel": "example",
"comments": [],
"mtproto_required": true,
"note": "帖子评论需要在「设置」页启用并登录 MTProto 后端",
"post_id": 1
}
}
]例を選択すると、その入力と結果がプレイグラウンドに読み込まれます。
Returns comments from the linked discussion group of a Telegram channel post. It needs the channel username in channel and the numeric post_id. An optional limit sets how many comments to return.
curl -X POST "https://api.sandbase.ai/v1/api/telegram/web/post-comments" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"channel": "telegram", "post_id": 450}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
channel | string | Yes | Channel username; post_id: Post ID; limit: number of comments (1-100). |
post_id | integer | Yes | Post ID |
limit | integer | No | Number of comments |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"channel": "telegram",
"comments": [],
"mtproto_required": true,
"note": "帖子评论需要在「设置」页启用并登录 MTProto 后端",
"post_id": 450
}
| Field | Meaning |
|---|---|
channel | The channel username that the request used. |
post_id | The ID of the post that the request asked about. |
comments | List of comments on the post. In the sample response it is empty []. |
mtproto_required | When true, the call needs an MTProto backend to be enabled and logged in before it can return comments. |
note | Text message that explains why the result is empty. In the sample it says post comments need MTProto to be enabled and logged in on the settings page. |
@ sign, for example telegram.limit accepts whole numbers from 1 to 100.mtproto_required first. If it is true, comments stays empty and note explains the reason.$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/post-comments" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "example",
"post_id": 1
}'SandBaseのAPIキーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開しないでください。
channelstring必須Channel username; post_id: Post ID; limit: number of comments (1-100).
post_idinteger必須Post ID
limitintegerNumber of comments
このAPIの保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
[
{
"data": {
"channel": "example",
"comments": [],
"mtproto_required": true,
"note": "帖子评论需要在「设置」页启用并登录 MTProto 后端",
"post_id": 1
}
}
]さらに探索
| API | 価格 | レスポンス |
|---|---|---|
Telegram Post Commentsこの 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 |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/telegram/web/post-comments に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.001。各組織には UTC 日ごとに 100 回の無料呼び出しが付与され、この API を含む対象の SandBase API 全体で共有されます。それ以降は、各呼び出しが SandBase 残高からこの料金で課金されます。サブスクリプションはありません。
必須: channel (string) と post_id (integer)。 任意: limit (integer)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。
いいえ。Telegram Post Comments は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Telegram の API アクセスを別途申請する必要はありません。