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"
}
}
]Выберите пример, чтобы загрузить его входные данные и результат в playground.
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 |
Вопросы
Отправьте POST-запрос на https://api.sandbase.ai/v1/api/toutiao/app/user-id, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.
$0.001 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.
Обязательные: user_profile_url (string). В таблице Parameters и в Playground на этой странице перечислены все поля.
JSON-ответ, возвращаемый в том же HTTP-запросе (синхронно). В README на этой странице приведен пример ответа.
Нет. Toutiao Profile User ID работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API Toutiao.