Data sosial (beta)

GET /v1/social/{platform}/{capability} mengembalikan data publik dari Douyin, Xiaohongshu, TikTok, YouTube, dan platform sosial lainnya, dengan kunci API dan saldo yang sama seperti panggilan model Anda. Setiap platform dan kapabilitas diberi harga per panggilan yang berhasil, dan data adalah respons asli platform — field tidak diseragamkan antarplatform.

GET /v1/social/{platform}/{capability}
curl --get "https://api.chinaapi.ai/v1/social/bilibili/search" \
  -H "Authorization: Bearer $CHINAAPI_KEY" \
  --data-urlencode 'keyword=Python'

# HTTP 200
# {"object": "social.result", "platform": "tiktok", "capability": "search", "data": {...}}
Beta: hanya akun berbayar Selesaikan isi ulang pertama Anda sebelum memanggil. Kredit uji coba tidak dapat dipakai untuk endpoint ini; akun yang belum pernah isi ulang akan menerima HTTP 403 model_requires_topup. Beta ini tidak memiliki SLA, dan platform, endpoint, serta harganya dapat berubah.

Autentikasi dan penagihan

Kirim kunci ChinaAPI Anda sebagai bearer token ke https://api.chinaapi.ai, sama seperti panggilan model mana pun. Satu panggilan ditagih sekali, sesuai harga yang tercantum untuk endpoint-nya, hanya jika mengembalikan HTTP 200 dengan data; hasil kosong, parameter yang ditolak, atau kegagalan upstream tidak dikenai biaya. Setiap halaman yang Anda ambil adalah panggilan terpisah. Log penggunaan Anda mencantumkan setiap panggilan dengan nama yang ditampilkan bersama endpoint-nya, misalnya social-douyin-search.

Respons dan error

Respons yang berhasil membungkus data platform dalam amplop kecil. Semua yang ada di dalam data — nama field, kursor paginasi, ID — milik platform itu sendiri; kirim kembali kursor persis seperti yang Anda terima.

{
  "object": "social.result",
  "platform": "douyin",
  "capability": "search",
  "data": { "...": "the platform's own fields" }
}
  • 400 — parameter tidak dikenal, berulang, terlalu panjang, bertipe salah, atau tidak ada, termasuk ketika tidak ada anggota grup "setidaknya salah satu dari" yang diberikan. code pada error menunjukkan yang mana, misalnya unknown_parameter atau missing_parameter.
  • 403 model_requires_topup — akun belum menyelesaikan isi ulang pertamanya.
  • 404 — pasangan platform dan kapabilitas tersebut tidak ada, atau platform tidak menemukan apa pun untuk parameter ini (social_data_no_result).
  • 429 social_data_capacity_reached — kapasitas harian beta sudah habis dan direset pada 00:00 UTC, atau platform sedang sibuk dan mencoba lagi beberapa detik kemudian sudah cukup. Jangan mencoba ulang dalam loop yang rapat.
  • 502 social_data_no_result — sumber data tidak menjawab, atau menjawab tanpa data.
  • 503 social_data_unavailable — endpoint ini sedang dijeda; katalog langsung mencantumkannya sebagai paused.

Tidak ada satu pun respons ini yang ditagih.

LinkedIn asynchronous tasks

The post-async, user-async and company-async capabilities use POST, query parameters and an empty body. Supply an Idempotency-Key (8–128 characters) unique to your intended operation. Reusing the same key and parameters returns the original submission without another charge; changing parameters under that key returns HTTP 409. A lost response is retried with the same key.

curl --get -X POST "https://api.chinaapi.ai/v1/social/linkedin/company-async" \
  -H "Authorization: Bearer $CHINAAPI_KEY" \
  -H "Idempotency-Key: company-research-20261029-001" \
  --data-urlencode 'url=https://www.linkedin.com/company/microsoft/'

# HTTP 202 returns a ChinaAPI task id and Location.
curl "https://api.chinaapi.ai/v1/social-tasks/TASK_ID" \
  -H "Authorization: Bearer $CHINAAPI_KEY"

Creation reserves the catalog price. A task with usable records keeps that charge; failure, empty results or timeout refund the reservation. Status and result reads are free, require the same account, and do not create another task. Poll no faster than every five seconds. Results are available for 30 days; do not submit another paid task just to read the same result. submission_pending means the submission outcome is uncertain: keep the same key and contact support if it persists.

These asynchronous capabilities are available through REST. The data MCP fetch tool lists synchronous capabilities only.

Xiaohongshu creator hot topics

GET /v1/social/xiaohongshu/creator-hot-topics returns the creator center’s hot inspiration feed. This is a separate capability, not a platform-wide trending ranking; the old trending endpoint remains unavailable. The live catalog lists its per-call price.

Leave cursor empty on the first request. Pass the response’s data.data.cursor unchanged to fetch the next page; items are in data.data.items. Stop when data.data.end_flag is true, a cursor repeats, or a page has no new items. Each successful nonempty page is billed separately. Empty results and business errors are not charged.

Telegram public channels

Telegram user returns a public channel profile, post returns one channel post, and user-posts returns channel posts. These endpoints do not retrieve personal account profiles or private chats. Pass channel=durov; a post also needs its post_id. Comments remain unavailable.

For user-posts, limit is 1–100 (upstream default 20). Fetch older posts with the preceding response's data.pagination.before_cursor as before; fetch newer posts with data.pagination.after_cursor as after. Choose one direction per request. Read posts from data.messages, deduplicate by post ID, and stop on an empty page, repeated cursor, no new IDs or your page/spending limit. has_more_before=false ends backward collection. Each nonempty successful page is billed separately; unavailable previews and empty results are not charged. Media links can expire.

Search implementation changes

TikTok search uses the App V3 implementation with keyword, offset, count, sort_type and publish_time. Start at offset 0; the former Web search_id is not supported. Returned data retains App V3 fields. Threads search returns top results and supports no pagination; results can vary by query and retrieval time. These path changes keep the previous per-call prices.

Pagination and bounded collection

Douyin comments and comment replies use the App V3 cursor contract. Start with cursor=0 and count=20; only count 20 is supported. Comment replies require both item_id (video ID) and comment_id (parent comment ID). Pass the returned cursor unchanged within the same capability. Old Web cursors cannot be reused.

Pages can overlap even when the cursor advances. Deduplicate by cid, stop when has_more is false, when a cursor repeats, or when no new IDs arrive; set a maximum page count and a spending limit. Each successful page is separately billed, including overlapping items. An empty page returns an uncharged no-result error and should end collection.

Threads comments and top search currently support the first page only. Sending a nonempty end_cursor is rejected before billing. Do not interpret a first-page response as a complete comment history. For every platform, use only the pagination parameters advertised in the live catalog.

Penggunaan yang diizinkan

Patuhi ketentuan setiap platform dan aturan perlindungan data yang berlaku bagi Anda. Jangan gunakan API ini untuk membangun profil individu. Login, mengekstrak detail kontak, memanipulasi engagement, dan mengakses konten privat atau berbayar berada di luar cakupan beta ini.

Platform dan harga

USD per panggilan yang berhasil. Setiap harga tertaut ke endpoint-nya di bawah, dan tanda pisah berarti platform tidak menawarkan kapabilitas tersebut. Katalog langsung — GET https://dash.chinaapi.ai/api/social/catalog, tanpa kunci — menjadi acuan untuk apa yang dijual saat ini, termasuk endpoint yang sedang dijeda.

Endpoint

Parameter diletakkan di query string dengan nama milik platform. Contoh diambil dari katalog; ganti pengenal dengan konten yang ingin Anda ambil.