target_urlstringbắt buộc
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
}
}
]Chọn một ví dụ để nạp đầu vào và kết quả của nó vào 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.
Bắt đầu xây dựng
Endpoint API của nền tảng với xác thực và theo dõi mức sử dụng thống nhất.
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"
}'Đặt SandBase API key của bạn trong môi trường máy chủ. Các request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key của bạn trên máy chủ. Không hiển thị trong mã chạy trên trình duyệt.
target_urlstringbắt buộcTarget URL to be converted
Đây là phản hồi ví dụ đã lưu cho API này; không có request thực nào được gửi khi xem mục này.
[
{
"data": {
"code": 0,
"data": "https://example",
"message": "success",
"now": 1787219028
}
}
]Khám phá thêm
| API | Giá | Phản hồi |
|---|---|---|
Douyin URL ShortenerAPI này Douyin | $0.001 mỗi lần gọi | JSON |
Douyin | $0.001 mỗi lần gọi | JSON |
Douyin | $0.001 mỗi lần gọi | JSON |
Douyin | $0.001 mỗi lần gọi | JSON |
Douyin | $0.001 mỗi lần gọi | JSON |
Douyin | $0.03 mỗi lần gọi | JSON |
Câu hỏi
Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/douyin/web/shorten-url với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.
$0.001 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.
Bắt buộc: target_url (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.
Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.
Không. Douyin URL Shortener chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Douyin.