Kuaishou Web Share Short URL
https://api.sandbase.ai/v1/api/kuaishou/web/generate-share-short-urlReturns a shareable short URL for a specified Kuaishou video or photo post. Supply the target post identifier using the photo_id query parameter.
- 價格
- $0.001美元/次呼叫
- 方法
- POST
- 回應
- JSON
- 參數
- 1 個必填 · 0 個選填
Playground
[
{
"data": {
"cache-scope": "nocache",
"error_msg": null,
"host-name": "public-bjzey-c34-kce-node2692.idchb1az3.hb1.kwaidc.com",
"hostName": "public-bjzey-c34-kce-node2692.idchb1az3.hb1.kwaidc.com",
"max-age": 0,
"result": 1,
"share": {
"appIconUrl": "https://static.yximgs.com/udata/pkg/ks-share-sdk/cardlogonew.png",
"appName": "as",
"extParams": {
"battleTemplateId": "",
"expTag": "1_i/0_unknown0",
"logExt": "{\"expTag\":\"1_i/0_unknown0\",\"trendingType\":\"\"}",
"shareInfoWrap": "{\"shareTitleInfo\":{\"title\":\"分享一个作品给你\",\"subTitle\":\"推荐你看这个视频\"},\"shareId\":\"19139080234162\",\"docId\":9,\"groupName\":\"\",\"shareType\":\"PHOTO_OTHER\",\"coverUrlKey\":null,\"coverUrl\":null,\"tagType\":null,\"webShareVerifyData\":null}",
"shareMethod": "token",
"shareMode": "app",
"styleKey": "",
"templateGenerationType": "",
"templateStyle": "",
"tokenExtParams": "{}",
"useMmuTitle": false
},
"kpn": "KUAISHOU",
"shareChannel": "COPY_LINK",
"shareMethod": "TOKEN",
"shareMethodType": null,
"shareMode": "APP",
"shareObject": {
"copyPopupWindowType": "DEFAULT",
"copylinkFailedTips": "复制失败",
"copylinkSuccessTips": "链接复制成功,快去分享给朋友吧",
"kwaiToken": "X5B2v6BG2NvB1sp",
"shareId": "19139080234162",
"shareMessage": "https://v.kuaishou.com/KXF28siR 哥哥我会魔法一人就能变成两 \"李秀妍u \"为自己代言 该作品在快手被播放过157.6万次,点击链接,打开【快手】直接观看!",
"shareObjectId": "5193494945927590140",
"shareResourceType": "PHOTO_OTHER",
"shortLink": "https://v.kuaishou.com/KXF28siR",
"toastDisplayTimeMillis": 1000
},
"subBiz": "BROWSE_SLIDE_PHOTO"
}
}
}
]範例
選擇一個範例,將其輸入與結果載入 playground。
API README
Kuaishou Web Share Short URL API
This API returns a Kuaishou short link for one video or photo post, along with the ready-made share message text. It needs the post's photo_id as input.
Use cases
- Turn a known
photo_idinto a shorthttps://v.kuaishou.com/link for use in chat messages or posts. - Collect the ready-to-paste share text for a video, including its title text and play count.
- Store a short link next to each post in a content tracking sheet.
- Check that a
photo_idresolves to a shareable post before you build a link list.
Request
curl -X POST "https://api.sandbase.ai/v1/api/kuaishou/web/generate-share-short-url" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"photo_id": "5193494945927590140"}'
The result is returned in outputs[0].data.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
photo_id | string | Yes |
Example response
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"cache-scope": "nocache",
"error_msg": null,
"host-name": "public-bjmt-c34-kce-node1110.idchb1az4.hb1.kwaidc.com",
"hostName": "public-bjmt-c34-kce-node1110.idchb1az4.hb1.kwaidc.com",
"max-age": 0,
"result": 1,
"share": {
"appIconUrl": "https://static.yximgs.com/udata/pkg/ks-share-sdk/cardlogonew.png",
"appName": "as",
"extParams": {
"battleTemplateId": "",
"expTag": "1_i/0_unknown0",
"logExt": "{\"expTag\":\"1_i/0_unknown0\",\"trendingType\":\"\"}",
"shareInfoWrap": "{\"shareTitleInfo\":{\"title\":\"分享一个作品给你\",\"subTitle\":\"推荐你看这个视频\"},\"shareId\":\"19166994…",
"shareMethod": "token",
"shareMode": "app",
"styleKey": "",
"templateGenerationType": "",
"templateStyle": "",
"tokenExtParams": "{}",
"useMmuTitle": false
},
"kpn": "KUAISHOU",
"shareChannel": "COPY_LINK",
"shareMethod": "TOKEN",
"shareMethodType": null,
"shareMode": "APP",
"shareObject": {
"copyPopupWindowType": "DEFAULT",
"copylinkFailedTips": "复制失败",
"copylinkSuccessTips": "链接复制成功,快去分享给朋友吧",
"kwaiToken": "X-2bp1gS…",
"shareId": "19166994375513",
"shareMessage": "https://v.kuaishou.com/KuPc5nPF 哥哥我会魔法一人就能变成两 \"李秀妍u \"为自己代言 该作品在快手被播放过157.6万次,点击链…",
"shareObjectId": "5193494945927590140",
"shareResourceType": "PHOTO_OTHER",
"shortLink": "https://v.kuaishou.com/KuPc5nPF",
"toastDisplayTimeMillis": 1000
},
"subBiz": "BROWSE_SLIDE_PHOTO"
}
}
Response fields
| Field | Meaning |
|---|---|
share.shareObject.shortLink | The short URL for the post. It starts with https://v.kuaishou.com/. |
share.shareObject.shareMessage | The full share text. It holds the short link, the post caption, the author name and a play count line, in Chinese. |
share.shareObject.shareObjectId | The ID of the shared post. It matches the photo_id you sent. |
share.shareObject.kwaiToken | A token string for the share. Kuaishou uses it for the copy-link share method. |
share.shareObject.shareId | The ID of this share action. |
share.shareObject.shareResourceType / share.subBiz | The type of the shared resource and the context it was shared from, for example PHOTO_OTHER and BROWSE_SLIDE_PHOTO. |
share.shareChannel / share.shareMethod / share.shareMode | How the share is made. The sample shows COPY_LINK, TOKEN and APP. |
share.extParams.shareInfoWrap | A JSON string with extra share details, such as the share title text and shareType. |
result | A status code for the call. The sample returns 1. |
error_msg | An error message. It is null in the sample response. |
Notes
- Send
photo_idas a string. It is a long numeric ID, for example5193494945927590140. - Read the link from
share.shareObject.shortLink.share.shareObject.shareMessagealready includes the same link. share.extParams.shareInfoWrapandshare.extParams.logExtare JSON strings. Parse them again if you need their contents.- To get post details for the same ID, call Kuaishou Single Video Details.
Pricing
$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/kuaishou/web/generate-share-short-url" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"photo_id": "5193494945927590140"
}'2. 驗證
請將您的 SandBase API 金鑰設定在伺服器環境中。請求使用 Bearer 驗證。
export SANDBASE_API_KEY="YOUR_API_KEY"請將金鑰保留在伺服器端,不要在瀏覽器程式碼中公開。
3. 參數
4. 回應
這是此 API 的已儲存範例回應;檢視時不會發出即時請求。
[
{
"data": {
"cache-scope": "nocache",
"error_msg": null,
"host-name": "public-bjzey-c34-kce-node2692.idchb1az3.hb1.kwaidc.com",
"hostName": "public-bjzey-c34-kce-node2692.idchb1az3.hb1.kwaidc.com",
"max-age": 0,
"result": 1,
"share": {
"appIconUrl": "https://static.yximgs.com/udata/pkg/ks-share-sdk/cardlogonew.png",
"appName": "as",
"extParams": {
"battleTemplateId": "",
"expTag": "1_i/0_unknown0",
"logExt": "{\"expTag\":\"1_i/0_unknown0\",\"trendingType\":\"\"}",
"shareInfoWrap": "{\"shareTitleInfo\":{\"title\":\"分享一个作品给你\",\"subTitle\":\"推荐你看这个视频\"},\"shareId\":\"19139080234162\",\"docId\":9,\"groupName\":\"\",\"shareType\":\"PHOTO_OTHER\",\"coverUrlKey\":null,\"coverUrl\":null,\"tagType\":null,\"webShareVerifyData\":null}",
"shareMethod": "token",
"shareMode": "app",
"styleKey": "",
"templateGenerationType": "",
"templateStyle": "",
"tokenExtParams": "{}",
"useMmuTitle": false
},
"kpn": "KUAISHOU",
"shareChannel": "COPY_LINK",
"shareMethod": "TOKEN",
"shareMethodType": null,
"shareMode": "APP",
"shareObject": {
"copyPopupWindowType": "DEFAULT",
"copylinkFailedTips": "复制失败",
"copylinkSuccessTips": "链接复制成功,快去分享给朋友吧",
"kwaiToken": "X5B2v6BG2NvB1sp",
"shareId": "19139080234162",
"shareMessage": "https://v.kuaishou.com/KXF28siR 哥哥我会魔法一人就能变成两 \"李秀妍u \"为自己代言 该作品在快手被播放过157.6万次,点击链接,打开【快手】直接观看!",
"shareObjectId": "5193494945927590140",
"shareResourceType": "PHOTO_OTHER",
"shortLink": "https://v.kuaishou.com/KXF28siR",
"toastDisplayTimeMillis": 1000
},
"subBiz": "BROWSE_SLIDE_PHOTO"
}
}
}
]探索更多
相關 APIs
| API | 價格 | 回應 |
|---|---|---|
Kuaishou | 每次呼叫 $0.001 | JSON |
Kuaishou | 每次呼叫 $0.001 | JSON |
Kuaishou | 每次呼叫 $0.001 | JSON |
Kuaishou | 每次呼叫 $0.001 | JSON |
Kuaishou | 每次呼叫 $0.002 | JSON |
Kuaishou | 每次呼叫 $0.002 | JSON |
問題
常見問題
我要如何使用 Kuaishou Web Share Short URL API?
使用 POST 請求將您的 SandBase API 金鑰放在 Authorization 標頭(Bearer)中,並以 JSON 主體傳入參數,即可呼叫 https://api.sandbase.ai/v1/api/kuaishou/web/generate-share-short-url。您也可以直接在本頁的 Playground 試用,不必撰寫程式碼。
Kuaishou Web Share Short URL API 的費用是多少?
每次 $0.001,並從您的 SandBase 餘額中扣款。您只會為實際發出的呼叫付費;沒有訂閱方案。
Kuaishou Web Share Short URL API 接受哪些參數?
必要:photo_id (string)。 本頁的 Parameters 表格與 Playground 會列出每個欄位。
Kuaishou Web Share Short URL API 會回傳什麼?
在同一個 HTTP 請求中回傳的 JSON 回應(同步)。 本頁的 README 包含範例回應。
我需要 Kuaishou 開發者帳號或 API 金鑰嗎?
不需要。Kuaishou Web Share Short URL 是透過 SandBase 運作,因此一組 SandBase API 金鑰即可使用此端點以及目錄中的其他所有 API 和模型。您不需要另外申請 Kuaishou API 存取權。
