channelstringbắt buộc
Channel username.
https://api.sandbase.ai/v1/api/telegram/web/similar-channelsReturns Telegram's official similar channel recommendations based on a specified channel username for channel discovery and audience research.
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
Returns Telegram's similar channel recommendations for one channel, using the channel username in channel. The response can also carry an mtproto_required flag and a note when recommendations are not available for the request.
similar.curl -X POST "https://api.sandbase.ai/v1/api/telegram/web/similar-channels" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"channel": "telegram"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
channel | string | Yes | Channel username. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"channel": "telegram",
"mtproto_required": true,
"note": "相似频道推荐需要在「设置」页启用并登录 MTProto 后端",
"similar": []
}
| Field | Meaning |
|---|---|
channel | The channel username the request was made for. It repeats the channel input. |
similar | List of recommended channels. It is an empty list in the sample response, so check its length before you read items. |
mtproto_required | Boolean flag. When it is true, the response says recommendations need an MTProto backend that is not active for this request. |
note | Short text that explains the mtproto_required flag. In the sample it says similar channel recommendations need MTProto to be enabled and logged in on the Settings page. |
channel, for example telegram.mtproto_required is true and similar is empty, the call returned no recommendations. Read note for the reason.$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Bắt đầu xây dựng
Endpoint API của nền tảng với xác thực và theo dõi mức sử dụng thống nhất.
curl -X POST "https://api.sandbase.ai/v1/api/telegram/web/similar-channels" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "telegram"
}'Đặt SandBase API key của bạn trong môi trường máy chủ. Các request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key của bạn trên máy chủ. Không hiển thị trong mã chạy trên trình duyệt.
channelstringbắt buộcChannel username.
Đây là phản hồi ví dụ đã lưu cho API này; không có request thực nào được gửi khi xem mục này.
Chưa có phản hồi đã lưu nào được công bố. Chạy API trong Playground để xem phản hồi.
Khám phá thêm
| API | Giá | Phản hồi |
|---|---|---|
Telegram Similar ChannelsAPI này Telegram | $0.001 mỗi lần gọi | JSON |
Telegram | $0.008 mỗi lần gọi | JSON |
Telegram | $0.001 mỗi lần gọi | JSON |
Telegram | $0.001 mỗi lần gọi | JSON |
Telegram | $0.001 mỗi lần gọi | JSON |
Telegram | $0.001 mỗi lần gọi | JSON |
Câu hỏi
Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/telegram/web/similar-channels với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.
$0.001 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.
Bắt buộc: channel (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.
Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.
Không. Telegram Similar Channels chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Telegram.