Kuaishou API in Python: videos and comments (2026)

Kuaishou Open Platform reads the authorising user's own videos, and its documents list no comment or search endpoint; to search videos and read comments from a program, use a third-party data API. Below it is done with DataXAPI's Python SDK; the free trial covers up to 333 calls. 2 endpoints do it: Kuaishou video search → Kuaishou video comments. The worked example below is 11 calls and costs $0.0400 in all; a failed call is not charged.

Updated 2026-11-06Open in ChatGPTOpen in Claude

Search a page of Kuaishou videos on a keyword, take the comments under the first 10, into one CSV: caption, plays, comment text, comment likes, time.

Step 1: Kuaishou video search

A page of videos for the search terms; each item's id is the video ID (starting 3x) and metrics.views its plays.

curl -G "https://api.dataxapi.com/v1/kuaishou/videos/search" \
  --data-urlencode "query=露营装备" \
  -H "Authorization: Bearer $DATAXAPI_API_KEY"
# pip install dataxapi
from dataxapi import DataXAPI

dx = DataXAPI()  # reads DATAXAPI_API_KEY
result = dx.kuaishou.videos.search(query="露营装备")
print(result["data"]["items"])
// npm i @dataxapi/sdk
import { DataXAPI } from "@dataxapi/sdk";

const dx = new DataXAPI(); // reads DATAXAPI_API_KEY
const result = await dx.kuaishou.videos.search({ query: "露营装备" });
console.log(result.data.items);
dataxapi call kuaishou.videos.search 'query=露营装备'
Recorded response
{
  "code": "ok",
  "request_id": "a19f2e0b-62a1-4300-9571-2f2b2807ce2b",
  "data": {
    "items": [
      {
        "id": "3xegr2ov53lfrqs",
        "url": "https://www.kuaishou.com/short-video/3xegr2ov53lfrqs",
        "text": "露营装备这件事,越简单越好",
        "published_at": "2026-10-10T23:04:11.943Z",
        "author": {
          "id": "3x1eyjiwkiajmm",
          "username": null,
          "name": "小林的周末",
          "avatar_url": "https://p2.a.yximgs.com/uhead/AB/2026/09/15/3500e4210a201dc1eadc48dd.jpg",
          "verified": false
        },
        "metrics": {
          "likes": 0,
          "comments": 0,
          "shares": 0,
          "favorites": 0,
          "views": 4
        }
      },
      // … 9 more
    ]
  },
  "page": {
    "next_cursor": "c1.6X2ZXQ7PYzJDBBMdubcMGSp6sl73SlvbUvsoO4Er",
    "cursor_expires_at": "2026-10-12T19:52:39.000Z",
    "has_more": true,
    "returned": 10
  },
  "warnings": [],
  "meta": {
    "capability": "kuaishou.videos.search",
    "result_status": "complete",
    "fetched_at": "2026-10-12T18:52:39.000Z",
    "cached": false,
    "replayed": false,
    "unavailable": {
      "type": "capability",
      "title": "platform",
      "lang": "capability",
      "author.followers": "capability",
      "metrics.reposts": "capability",
      "images": "capability",
      "hashtags": "capability",
      "mentions": "capability",
      "is_pinned": "capability",
      "post_id": "platform",
      "parent_id": "platform",
      "root_id": "platform"
    },
    "billing": {
      "amount": "0.02",
      "currency": "USD",
      "balance_after": "9.98"
    }
  }
}

From a response recorded 2026-10-12 18:52 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.

Kuaishou video search · $0.0200 / a call · Parameters, fields and errors on the endpoint's page →

Step 2: Kuaishou video comments

Put the video ID into id for a page of top-level comments with IP location; the next page comes from page.next_cursor.

curl -G "https://api.dataxapi.com/v1/kuaishou/videos/comments/list" \
  --data-urlencode "id=3x5pf8ia4zc76tc" \
  -H "Authorization: Bearer $DATAXAPI_API_KEY"
# pip install dataxapi
from dataxapi import DataXAPI

dx = DataXAPI()  # reads DATAXAPI_API_KEY
result = dx.kuaishou.videos.comments.list(id="3x5pf8ia4zc76tc")
print(result["data"]["items"])
// npm i @dataxapi/sdk
import { DataXAPI } from "@dataxapi/sdk";

const dx = new DataXAPI(); // reads DATAXAPI_API_KEY
const result = await dx.kuaishou.videos.comments.list({ id: "3x5pf8ia4zc76tc" });
console.log(result.data.items);
dataxapi call kuaishou.videos.comments.list id=3x5pf8ia4zc76tc
Recorded response
{
  "code": "ok",
  "request_id": "2354bd49-19e7-4ca7-9aba-b0c17ee78ce1",
  "data": {
    "items": [
      {
        "id": "948497417289",
        "text": "我上次也踩了这个坑哈哈",
        "published_at": "2026-10-07T06:43:52.190Z",
        "author": {
          "id": "3x57ho06xwpq3a",
          "name": "南边的风",
          "avatar_url": "https://p2.a.yximgs.com/uhead/AB/2026/09/10/a8ecbe3d983a2aea397ec191.jpg"
        },
        "metrics": { "likes": 165 },
        "parent_id": null,
        "root_id": null
      },
      // … 39 more
    ]
  },
  "page": {
    "next_cursor": "c1.On_Z5HrTQ4A7icSIi9hOTJhfytcRE_3fa1WWArPB",
    "cursor_expires_at": "2026-10-12T19:53:57.000Z",
    "has_more": true,
    "returned": 40
  },
  "warnings": [],
  "meta": {
    "capability": "kuaishou.videos.comments.list",
    "result_status": "complete",
    "fetched_at": "2026-10-12T18:53:57.000Z",
    "cached": false,
    "replayed": false,
    "unavailable": {
      "url": "platform",
      "author.username": "capability",
      "metrics.comments": "capability",
      "post_id": "capability"
    },
    "billing": {
      "amount": "0.002",
      "currency": "USD",
      "balance_after": "9.998"
    }
  }
}

From a response recorded 2026-10-12 18:53 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.

Kuaishou video comments · $0.0020 / a call · Parameters, fields and errors on the endpoint's page →

What the example costs

One page of search results, then a page of comments under 10 videos

EndpointCallsPriceSubtotal
Kuaishou video search1$0.0200$0.0200
Kuaishou video comments10$0.0020$0.0200
Total11$0.0400

Prices are the prices in force when this page was built. A failed call costs nothing.

In your AI (MCP)

Connect DataXAPI to your AI client once. Then say what you want; the agent finds these endpoints, checks the price and calls them on your balance.

Say: Search Kuaishou for 露营装备 (camping gear), get the comments under the first 10 videos, as one table: video, comment, likes, IP location.
What the agent sends to the call tool
{
  "capability": "kuaishou.videos.search",
  "query": "露营装备",
  "idempotency_key": "<a new UUID>"
}

Sign in to copy the setup prompt with your keyAbout the MCP server →

With a Skill

Why DataXAPI

  • Steady: endpoints were available 100% of the last 30 days, on a public status page you can check.
  • Fast: a paid call took 3.4 seconds at the median over the last 7 days (counted 2026-11-06).
  • Fewer tokens: across 8 endpoints on Kuaishou, one recorded real response each, the platform's own JSON comes to 271k tokens and what an AI reads through DataXAPI's MCP server to 12k, 95% fewer; the JSON of a direct API call is 93% fewer too (counted 2026-11-06). Every platform answers in one shape: the author in author, counts in metrics, the next page in page.next_cursor, so another platform needs no new parser.
  • See before you pay: every endpoint's page shows a recorded real response, field by field.
  • Spending you control: a failed call is not charged; each key can have a limit, X-Max-Price caps one call, and the same Idempotency-Key within 24 hours is never charged twice.
  • Ready for AI: a remote MCP server listed in the official MCP registry as com.dataxapi/mcp, usable from Claude, Cursor and ChatGPT.
  • Free trial of up to 333 calls, no card.

Good to know

  • No Kuaishou account, cookie or device identity.
  • With only share text, put the whole of it into url of kuaishou.videos.get; the answer has the video ID.
  • Without code: connect DataXAPI to Claude or ChatGPT and say the sentence under “In your AI”.

The whole script

The task above as one script that runs as it is: Python, the SDK, your key from DATAXAPI_API_KEY. It writes a CSV file and ends by printing what it called, fetched and was charged.

Python
# pip install dataxapi
# export DATAXAPI_API_KEY=dx_...   (your key)
import csv
from decimal import Decimal
from dataxapi import DataXAPI

dx = DataXAPI()
calls, fetched, charged = 0, 0, Decimal("0")

def run(capability, params):
    """One call; counts it and what it was charged."""
    global calls, charged
    result = dx.call(capability, params)
    calls += 1
    charged += Decimal(str(result["meta"]["billing"]["amount"]))
    return result

QUERY = "露营装备"
VIDEOS = 10

# 1. A page of videos for the search terms.
videos = run("kuaishou.videos.search", {"query": QUERY})["data"]["items"][:VIDEOS]

# 2. The first page of comments under each.
rows = []
for video in videos:
    for comment in run("kuaishou.videos.comments.list", {"id": video["id"]})["data"]["items"]:
        rows.append([video.get("text"), video["metrics"].get("views"), comment.get("text"), comment["metrics"].get("likes"), comment.get("published_at")])

fetched = len(rows)
with open("kuaishou-comments.csv", "w", newline="", encoding="utf-8") as file:
    csv.writer(file).writerows([["caption", "plays", "comment", "comment_likes", "published_at"], *rows])

print(f"calls: {calls}, items: {fetched}, charged: ${charged}")