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
}
}
]例を選択すると、その入力と結果がプレイグラウンドに読み込まれます。
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 |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/douyin/web/shorten-url に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.001、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
必須: target_url (string)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。
いいえ。Douyin URL Shortener は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Douyin の API アクセスを別途申請する必要はありません。