Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Kuaishou Web Share Short URL

API 文档
https://api.sandbase.ai/v1/api/kuaishou/web/generate-share-short-url

Returns 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

输入
输出示例
响应outputs · 1.8 KB · 47 行
[
  {
    "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_id into a short https://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_id resolves 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

NameTypeRequiredDescription
photo_idstringYes

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

FieldMeaning
share.shareObject.shortLinkThe short URL for the post. It starts with https://v.kuaishou.com/.
share.shareObject.shareMessageThe full share text. It holds the short link, the post caption, the author name and a play count line, in Chinese.
share.shareObject.shareObjectIdThe ID of the shared post. It matches the photo_id you sent.
share.shareObject.kwaiTokenA token string for the share. Kuaishou uses it for the copy-link share method.
share.shareObject.shareIdThe ID of this share action.
share.shareObject.shareResourceType / share.subBizThe 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.shareModeHow the share is made. The sample shows COPY_LINK, TOKEN and APP.
share.extParams.shareInfoWrapA JSON string with extra share details, such as the share title text and shareType.
resultA status code for the call. The sample returns 1.
error_msgAn error message. It is null in the sample response.

Notes

  • Send photo_id as a string. It is a long numeric ID, for example 5193494945927590140.
  • Read the link from share.shareObject.shortLink. share.shareObject.shareMessage already includes the same link.
  • share.extParams.shareInfoWrap and share.extParams.logExt are 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.

探索更多

相关 APIs

全部 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

指南:Best Kuaishou API in 2026: Pricing Compared

问题

常见问题

如何使用 Kuaishou Web Share Short URL API?

向 https://api.sandbase.ai/v1/api/kuaishou/web/generate-share-short-url 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 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 key 吗?

不需要。Kuaishou Web Share Short URL 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Kuaishou API 访问权限。