target_urlstringобязательно
Target URL to be converted
https://api.sandbase.ai/v1/api/douyin/web/shorten-urlShortens a target web address for Douyin web workflows. Accepts a full destination link and returns a compact shortened URL.
[
{
"data": {
"code": 0,
"data": "https://example",
"message": "success",
"now": 1787219028
}
}
]Выберите пример, чтобы загрузить его входные данные и результат в playground.
Takes one full Douyin web address in target_url and returns a short https://v.douyin.com/ link for it. The response holds the short link as a single string in data.
curl -X POST "https://api.sandbase.ai/v1/api/douyin/web/shorten-url" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"target_url": "https://www.douyin.com/video/7575136499386720761"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
target_url | string | Yes | Target URL to be converted |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"code": 0,
"data": "https://v.douyin.com/nzl1K-jOpdo/",
"message": "success",
"now": 1793691150
}
| Field | Meaning |
|---|---|
data | The shortened URL for the submitted target_url. In this example it is https://v.douyin.com/nzl1K-jOpdo/. |
code | Status code of the call. 0 appears with a successful result. |
message | Short status text. It reads success when the call works. |
now | Number in the response, 1793691150 in this example. It looks like a Unix timestamp in seconds. |
target_url, including https://, for example a video page like https://www.douyin.com/video/7575136499386720761.data, not an object.$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/douyin/web/shorten-url" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"target_url": "example"
}'Укажите свой ключ SandBase API в окружении сервера. Запросы используют аутентификацию Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Храните ключ на сервере. Не раскрывайте его в коде браузера.
target_urlstringобязательноTarget URL to be converted
Сохранённый пример ответа для этого API; при просмотре живой запрос не выполняется.
[
{
"data": {
"code": 0,
"data": "https://example",
"message": "success",
"now": 1787219028
}
}
]Посмотреть больше
| API | Цена | Ответ |
|---|---|---|
Douyin URL ShortenerЭтот API Douyin | $0.001 за запрос | JSON |
Douyin | $0.001 за запрос | JSON |
Douyin | $0.001 за запрос | JSON |
Douyin | $0.001 за запрос | JSON |
Douyin | $0.001 за запрос | JSON |
Douyin | $0.03 за запрос | JSON |
Руководства:Best Douyin API in 2026: Pricing Compared
Вопросы
Отправьте POST-запрос на https://api.sandbase.ai/v1/api/douyin/web/shorten-url, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.
$0.001 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.
Обязательные: target_url (string). В таблице Parameters и в Playground на этой странице перечислены все поля.
JSON-ответ, возвращаемый в том же HTTP-запросе (синхронно). В README на этой странице приведен пример ответа.
Нет. Douyin URL Shortener работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API Douyin.