ソーシャルデータ(ベータ)

GET /v1/social/{platform}/{capability} は、Douyin、Xiaohongshu、TikTok、YouTube などのソーシャルプラットフォームの公開データを返します。API キーと残高はモデル呼び出しと共通です。料金はプラットフォームと機能ごとに、成功した呼び出し 1 回単位で決まります。data はプラットフォーム自身のレスポンスそのままで、フィールドはプラットフォーム間で統一されていません。

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": {...}}
ベータ:有料アカウント限定 呼び出す前に初回チャージを完了してください。トライアルクレジットはこれらのエンドポイントには使えません。一度もチャージしていないアカウントには HTTP 403 model_requires_topup が返ります。ベータ版には SLA がなく、対応プラットフォーム、エンドポイント、料金は変更される場合があります。

認証と課金

モデル呼び出しと同じく、ChinaAPI キーを bearer トークンとして https://api.chinaapi.ai に送ります。課金は HTTP 200 でデータが返った場合に限り、エンドポイントに表示された料金で 1 回だけ行われます。結果が空の場合、パラメータが拒否された場合、上流が失敗した場合は課金されません。ページを 1 つ取得するごとに別の呼び出しになります。利用履歴には、各呼び出しがエンドポイントに表示された名前(social-douyin-search など)で記録されます。

レスポンスとエラー

成功したレスポンスは、プラットフォームのデータを小さなエンベロープで包んで返します。data の中身(フィールド名、ページネーションカーソル、ID)はすべてプラットフォーム自身のものです。カーソルは受け取ったとおりにそのまま渡し返してください。

{
  "object": "social.result",
  "platform": "douyin",
  "capability": "search",
  "data": { "...": "the platform's own fields" }
}
  • 400 — パラメータが不明、重複、長すぎる、型が違う、または欠けている場合です。「いずれか 1 つ以上」のグループから 1 つも指定されていない場合も含みます。どれに当たるかはエラーの code(unknown_parameter や missing_parameter など)でわかります。
  • 403 model_requires_topup — このアカウントは初回チャージを完了していません。
  • 404 — そのプラットフォームと機能の組み合わせが存在しないか、プラットフォームがこのパラメータで何も見つけられませんでした(social_data_no_result)。
  • 429 social_data_capacity_reached — ベータの当日分の容量を使い切ったか(00:00 UTC にリセット)、プラットフォームが混雑しています。後者なら数秒後の再試行で通ります。間隔を空けずに再試行を繰り返さないでください。
  • 502 social_data_no_result — データソースが応答しなかったか、データなしで応答しました。
  • 503 social_data_unavailable — このエンドポイントは現在一時停止中で、ライブカタログでは paused と表示されます。

これらのレスポンスはいずれも課金されません。

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.

利用上の注意

各プラットフォームの規約と、あなたに適用されるデータ保護規則に従ってください。この API を個人のプロファイリングに使わないでください。ログイン、連絡先情報の抽出、エンゲージメントの操作、非公開または有料コンテンツへのアクセスは、このベータの対象外です。

プラットフォームと料金

成功した呼び出し 1 回あたりの USD 料金です。各料金は下のエンドポイントにリンクしており、ダッシュはそのプラットフォームがその機能を提供していないことを示します。いま販売中のもの(一時停止中のエンドポイントを含む)は、ライブカタログ GET https://dash.chinaapi.ai/api/social/catalog(キー不要)が正となります。

エンドポイント

パラメータはプラットフォーム自身の名前でクエリ文字列に入れます。例はカタログから取ったものです。識別子は取得したいコンテンツのものに置き換えてください。