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.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform 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 key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
target_urlstringจำเป็นTarget URL to be converted
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
[
{
"data": {
"code": 0,
"data": "https://example",
"message": "success",
"now": 1787219028
}
}
]สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
Douyin URL ShortenerAPI นี้ Douyin | $0.001 ต่อการเรียก | JSON |
Douyin | $0.001 ต่อการเรียก | JSON |
Douyin | $0.001 ต่อการเรียก | JSON |
Douyin | $0.001 ต่อการเรียก | JSON |
Douyin | $0.001 ต่อการเรียก | JSON |
Douyin | $0.03 ต่อการเรียก | JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/douyin/web/shorten-url โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.001 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: target_url (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Douyin URL Shortener ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Douyin API แยกต่างหาก