user_profile_urlstring必須
User profile URL
https://api.sandbase.ai/v1/api/toutiao/app/user-idResolves a Toutiao user profile URL into numeric and secure user identifiers. Returns the user ID and sec_user_id associated with the provided profile link.
[
{
"data": {
"sec_user_id": "MS4wLjABAAAAwK6echNksY69R8l2vcZudupfhTItbGSGt-8ineO5UaB4L-djqkYDgB6TkAdMvrmW",
"user_id": "1352838578180211"
}
}
]例を選択すると、その入力と結果がプレイグラウンドに読み込まれます。
This API takes a Toutiao user profile URL and returns the numeric user_id and the sec_user_id for that account. It needs one input, user_profile_url.
user_id before you look up the account.sec_user_id from a profile link to use in other Toutiao requests.user_id values.curl -X POST "https://api.sandbase.ai/v1/api/toutiao/app/user-id" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user_profile_url": "https://www.toutiao.com/c/user/token/MS4wLjABAAAAwK6echNksY69R8l2vcZudupfhTItbGSGt-8ineO5UaB4L-djqkYDgB6TkAdMvrmW/"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
user_profile_url | string | Yes | User profile URL |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"sec_user_id": "MS4wLjABAAAAwK6echNksY69R8l2vcZudupfhTItbGSGt-8ineO5UaB4L-djqkYDgB6TkAdMvrmW",
"user_id": "1352838578180211"
}
| Field | Meaning |
|---|---|
user_id | Numeric ID of the Toutiao account. It is returned as a string. |
sec_user_id | Secure user ID for the same account. In the example, it matches the token segment at the end of the profile URL. |
user_profile_url. The example uses the form https://www.toutiao.com/c/user/token/<token>/.user_id to Toutiao User Profile.$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/toutiao/app/user-id" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"user_profile_url": "https://static.sandbase.ai/examples/4494279d-e579-4329-bbf7-b759ee763f46/input/9295e84f-2dcb-46b2-9db8-9e97dabb7c99.bin"
}'SandBaseのAPIキーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開しないでください。
user_profile_urlstring必須User profile URL
このAPIの保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
[
{
"data": {
"sec_user_id": "MS4wLjABAAAAwK6echNksY69R8l2vcZudupfhTItbGSGt-8ineO5UaB4L-djqkYDgB6TkAdMvrmW",
"user_id": "1352838578180211"
}
}
]さらに探索
| API | 価格 | レスポンス |
|---|---|---|
Toutiao Profile User IDこの API Toutiao | $0.001 / 回 | JSON |
Toutiao | $0.001 / 回 | JSON |
Toutiao | $0.001 / 回 | JSON |
Toutiao | $0.001 / 回 | JSON |
Toutiao | $0.001 / 回 | JSON |
Toutiao | $0.071429 / 回 | JSON |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/toutiao/app/user-id に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.001、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
必須: user_profile_url (string)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。
いいえ。Toutiao Profile User ID は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Toutiao の API アクセスを別途申請する必要はありません。