---
title: "Kuaishou Video Comments API (V1)"
description: "Retrieve public comments for a Kuaishou video, with optional cursor-based pagination. Use it to review audience discussion and continue through additional comment pages."
aiUsagePrompt: true
---

# Kuaishou Video Comments API \(V1\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/kuaishou/get-video-comment/v1\"")'
  :summary='JSON.parse("\"Video Comments (V1)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/kuaishou/video-comments-v1-en.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"Access token for this API service.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"videoId\",\"in\":\"query\",\"description\":\"The Kuaishou video identifier or numeric refer_photo_id returned by a related response.\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"pcursor\",\"in\":\"query\",\"description\":\"Pagination cursor for subsequent pages.\",\"required\":false,\"schema\":{\"type\":\"string\"}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"OK\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"Public comments and reply previews for a Kuaishou video.\",\"properties\":{\"result\":{\"type\":\"integer\",\"description\":\"Status code reported in the Kuaishou comment payload.\"},\"rootComments\":{\"type\":\"array\",\"description\":\"Top-level comments returned on this page.\",\"items\":{\"type\":\"object\",\"description\":\"One top-level comment.\",\"properties\":{\"comment_id\":{\"type\":\"integer\",\"description\":\"Identifier of the comment.\"},\"photo_id\":{\"type\":\"integer\",\"description\":\"Numeric ID of the video being discussed. Preserve the integer exactly if your JSON parser rounds large numbers.\"},\"content\":{\"type\":\"string\",\"description\":\"Text of the comment.\"},\"likedCount\":{\"type\":\"integer\",\"description\":\"Number of likes on the comment.\"},\"time\":{\"type\":\"string\",\"description\":\"Time label displayed with the comment.\"},\"timestamp\":{\"type\":\"integer\",\"description\":\"Comment time as a Unix timestamp in milliseconds.\"},\"type\":{\"type\":\"integer\",\"description\":\"Comment type code reported by Kuaishou.\"},\"reply_to\":{\"type\":\"integer\",\"description\":\"Reply-target account ID. Top-level comments in the observed responses report 0.\"},\"isKwaiShopItemComment\":{\"type\":\"boolean\",\"description\":\"Shop-item comment flag reported by Kuaishou.\"},\"subCommentCount\":{\"type\":\"integer\",\"description\":\"Reported number of replies to this comment. The response may include only a preview of those replies.\"},\"hot\":{\"type\":\"boolean\",\"description\":\"Hot-comment marker, when present.\"},\"godComment\":{\"type\":\"boolean\",\"description\":\"Kuaishou God Comment marker, when present.\"},\"author_id\":{\"type\":\"integer\",\"description\":\"Kuaishou account ID of the comment author.\"},\"author_name\":{\"type\":\"string\",\"description\":\"Display name of the comment author.\"},\"authorArea\":{\"type\":\"string\",\"description\":\"Location label shown with the comment author.\"},\"authorVerified\":{\"type\":\"boolean\",\"description\":\"Whether the comment author&#39;s account is shown as verified.\"},\"headurl\":{\"type\":\"string\",\"description\":\"Primary avatar URL for the comment author.\"},\"headurls\":{\"type\":\"array\",\"description\":\"Available avatar URL variants for the comment author.\",\"items\":{\"type\":\"object\",\"description\":\"One avatar variant.\",\"properties\":{\"url\":{\"type\":\"string\",\"description\":\"URL for this avatar variant.\"}}}},\"authorVerifiedDetail\":{\"type\":\"object\",\"description\":\"Details displayed for a verified author, when available.\",\"properties\":{\"description\":{\"type\":\"string\",\"description\":\"Text describing the author&#39;s verification.\"}}}}}},\"commentCount\":{\"type\":\"integer\",\"description\":\"Reported comment count for the video.\"},\"pcursor\":{\"type\":\"string\",\"description\":\"Opaque pagination cursor for top-level comments. To request another page, pass it unchanged as pcursor with the same videoId.\"},\"subCommentsMap\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\",\"description\":\"Reply preview and cursor for one top-level comment.\",\"properties\":{\"pcursor\":{\"type\":\"string\",\"description\":\"Opaque cursor for this parent comment&#39;s replies. The value no_more means there are no further replies in this branch.\"},\"subComments\":{\"type\":\"array\",\"description\":\"Reply preview returned for this top-level comment.\",\"items\":{\"type\":\"object\",\"description\":\"One reply to a top-level comment.\",\"properties\":{\"comment_id\":{\"type\":\"integer\",\"description\":\"Identifier of the comment.\"},\"photo_id\":{\"type\":\"integer\",\"description\":\"Numeric ID of the video being discussed. Preserve the integer exactly if your JSON parser rounds large numbers.\"},\"content\":{\"type\":\"string\",\"description\":\"Text of the comment.\"},\"likedCount\":{\"type\":\"integer\",\"description\":\"Number of likes on the comment.\"},\"time\":{\"type\":\"string\",\"description\":\"Time label displayed with the comment.\"},\"timestamp\":{\"type\":\"integer\",\"description\":\"Comment time as a Unix timestamp in milliseconds.\"},\"type\":{\"type\":\"integer\",\"description\":\"Comment type code reported by Kuaishou.\"},\"reply_to\":{\"type\":\"integer\",\"description\":\"Kuaishou account ID of the user being replied to.\"},\"isKwaiShopItemComment\":{\"type\":\"boolean\",\"description\":\"Shop-item comment flag reported by Kuaishou.\"},\"replyToUserName\":{\"type\":\"string\",\"description\":\"Display name of the user being replied to.\"},\"author_id\":{\"type\":\"integer\",\"description\":\"Kuaishou account ID of the comment author.\"},\"author_name\":{\"type\":\"string\",\"description\":\"Display name of the comment author.\"},\"authorArea\":{\"type\":\"string\",\"description\":\"Location label shown with the comment author.\"},\"authorVerified\":{\"type\":\"boolean\",\"description\":\"Whether the comment author&#39;s account is shown as verified.\"},\"headurl\":{\"type\":\"string\",\"description\":\"Primary avatar URL for the comment author.\"},\"headurls\":{\"type\":\"array\",\"description\":\"Available avatar URL variants for the comment author.\",\"items\":{\"type\":\"object\",\"description\":\"One avatar variant.\",\"properties\":{\"url\":{\"type\":\"string\",\"description\":\"URL for this avatar variant.\"}}}}}}}}},\"description\":\"Reply previews grouped by top-level comment ID. Each map key is the string form of a root comment identifier.\"}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"Invalid request parameters or body\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"Invalid or inactive access token\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"Permission denied\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"Request rate or daily quota limit exceeded\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"Internal server error\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"Service temporarily unavailable\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"Global production API (default)\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/kuaishou/get-video-comment/v1\"")' />

<p>Retrieve public comments for a Kuaishou video, with optional cursor-based pagination. Use it to review audience discussion and continue through additional comment pages.</p>

## Parameters

<div class="api-doc-table api-doc-table--params">

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | Yes | - | Access token for this API service. |
| <code>videoId</code> | query | <code>string</code> | Yes | - | The Kuaishou video identifier or numeric refer_photo_id returned by a related response. |
| <code>pcursor</code> | query | <code>string</code> | No | - | Pagination cursor for subsequent pages. |

</div>

## Code Samples

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/kuaishou/get-video-comment/v1?token=YOUR_API_KEY&videoId=VALUE'
```

```text [🤖 AI Prompt]
I want to use the "Video Comments (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/kuaishou/get-video-comment/v1?token=YOUR_API_KEY&videoId=VALUE
API Endpoint: BASE_URL + /api/kuaishou/get-video-comment/v1?token=YOUR_API_KEY&videoId=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/kuaishou/video-comments-v1-en.json

Parameters:
- token (query): Access token for this API service. (Required)
- videoId (query): The Kuaishou video identifier or numeric refer_photo_id returned by a related response. (Required)
- pcursor (query): Pagination cursor for subsequent pages.

Return format: safely handle JSON or text according to the actual Content-Type.

Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
3. Business Code Reference:
   - 0: Success
   - 100: Invalid or Inactive Token
   - 301: Collection Failed. Please Retry.
   - 302: Rate Limit Exceeded
   - 303: Daily Quota Exceeded
   - 400: Invalid Parameters
   - 500: Internal Server Error
   - 600: Permission Denied
   - 601: Insufficient Balance
   - 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.

Please help me write a script in my preferred programming language to call this API and handle the response.
```

```python [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # Provided by OpenAPI servers

url = BASE_URL + "/api/kuaishou/get-video-comment/v1?token=YOUR_API_KEY&videoId=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
```

```js [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/kuaishou/get-video-comment/v1?token=YOUR_API_KEY&videoId=VALUE";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
```

```java [☕ Java]
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
        final String url = BASE_URL + "/api/kuaishou/get-video-comment/v1?token=YOUR_API_KEY&videoId=VALUE";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
```

```go [🐹 Go]
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/kuaishou/get-video-comment/v1?token=YOUR_API_KEY&videoId=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
```

```php [🐘 PHP]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/kuaishou/get-video-comment/v1?token=YOUR_API_KEY&videoId=VALUE';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/kuaishou/video-comments-v1-en.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[OpenAPI Definition (JSON)]</a>
</div>

## Response Fields

Key fields in a successful response (`code = 0`).

<div class="api-doc-table api-doc-table--response">

| Field path | Type | Description |
| --- | --- | --- |
| <code>data</code> | <code>object</code> | Public comments and reply previews for a Kuaishou video. |
| <code>data.result</code> | <code>integer</code> | Status code reported in the Kuaishou comment payload. |
| <code>data.rootComments</code> | <code>array</code> | Top-level comments returned on this page. |
| <code>data.rootComments[]</code> | <code>object</code> | One top-level comment. |
| <code>data.rootComments[].comment_id</code> | <code>integer</code> | Identifier of the comment. |
| <code>data.rootComments[].photo_id</code> | <code>integer</code> | Numeric ID of the video being discussed. Preserve the integer exactly if your JSON parser rounds large numbers. |
| <code>data.rootComments[].content</code> | <code>string</code> | Text of the comment. |
| <code>data.rootComments[].likedCount</code> | <code>integer</code> | Number of likes on the comment. |
| <code>data.rootComments[].time</code> | <code>string</code> | Time label displayed with the comment. |
| <code>data.rootComments[].timestamp</code> | <code>integer</code> | Comment time as a Unix timestamp in milliseconds. |
| <code>data.rootComments[].type</code> | <code>integer</code> | Comment type code reported by Kuaishou. |
| <code>data.rootComments[].reply_to</code> | <code>integer</code> | Reply-target account ID. Top-level comments in the observed responses report 0. |
| <code>data.rootComments[].isKwaiShopItemComment</code> | <code>boolean</code> | Shop-item comment flag reported by Kuaishou. |
| <code>data.rootComments[].subCommentCount</code> | <code>integer</code> | Reported number of replies to this comment. The response may include only a preview of those replies. |
| <code>data.rootComments[].hot</code> | <code>boolean</code> | Hot-comment marker, when present. |
| <code>data.rootComments[].godComment</code> | <code>boolean</code> | Kuaishou God Comment marker, when present. |
| <code>data.rootComments[].author_id</code> | <code>integer</code> | Kuaishou account ID of the comment author. |
| <code>data.rootComments[].author_name</code> | <code>string</code> | Display name of the comment author. |
| <code>data.rootComments[].authorArea</code> | <code>string</code> | Location label shown with the comment author. |
| <code>data.rootComments[].authorVerified</code> | <code>boolean</code> | Whether the comment author's account is shown as verified. |
| <code>data.rootComments[].headurl</code> | <code>string</code> | Primary avatar URL for the comment author. |
| <code>data.rootComments[].headurls</code> | <code>array</code> | Available avatar URL variants for the comment author. |
| <code>data.rootComments[].headurls[]</code> | <code>object</code> | One avatar variant. |
| <code>data.rootComments[].headurls[].url</code> | <code>string</code> | URL for this avatar variant. |
| <code>data.rootComments[].authorVerifiedDetail</code> | <code>object</code> | Details displayed for a verified author, when available. |
| <code>data.rootComments[].authorVerifiedDetail.description</code> | <code>string</code> | Text describing the author's verification. |
| <code>data.commentCount</code> | <code>integer</code> | Reported comment count for the video. |
| <code>data.pcursor</code> | <code>string</code> | Opaque pagination cursor for top-level comments. To request another page, pass it unchanged as pcursor with the same videoId. |
| <code>data.subCommentsMap</code> | <code>object</code> | Reply previews grouped by top-level comment ID. Each map key is the string form of a root comment identifier. |
| <code>data.subCommentsMap.{key}</code> | <code>object</code> | Reply preview and cursor for one top-level comment. |
| <code>data.subCommentsMap.{key}.pcursor</code> | <code>string</code> | Opaque cursor for this parent comment's replies. The value no_more means there are no further replies in this branch. |
| <code>data.subCommentsMap.{key}.subComments</code> | <code>array</code> | Reply preview returned for this top-level comment. |
| <code>data.subCommentsMap.{key}.subComments[]</code> | <code>object</code> | One reply to a top-level comment. |
| <code>data.subCommentsMap.{key}.subComments[].comment_id</code> | <code>integer</code> | Identifier of the comment. |
| <code>data.subCommentsMap.{key}.subComments[].photo_id</code> | <code>integer</code> | Numeric ID of the video being discussed. Preserve the integer exactly if your JSON parser rounds large numbers. |
| <code>data.subCommentsMap.{key}.subComments[].content</code> | <code>string</code> | Text of the comment. |
| <code>data.subCommentsMap.{key}.subComments[].likedCount</code> | <code>integer</code> | Number of likes on the comment. |
| <code>data.subCommentsMap.{key}.subComments[].time</code> | <code>string</code> | Time label displayed with the comment. |
| <code>data.subCommentsMap.{key}.subComments[].timestamp</code> | <code>integer</code> | Comment time as a Unix timestamp in milliseconds. |
| <code>data.subCommentsMap.{key}.subComments[].type</code> | <code>integer</code> | Comment type code reported by Kuaishou. |
| <code>data.subCommentsMap.{key}.subComments[].reply_to</code> | <code>integer</code> | Kuaishou account ID of the user being replied to. |
| <code>data.subCommentsMap.{key}.subComments[].isKwaiShopItemComment</code> | <code>boolean</code> | Shop-item comment flag reported by Kuaishou. |
| <code>data.subCommentsMap.{key}.subComments[].replyToUserName</code> | <code>string</code> | Display name of the user being replied to. |
| <code>data.subCommentsMap.{key}.subComments[].author_id</code> | <code>integer</code> | Kuaishou account ID of the comment author. |
| <code>data.subCommentsMap.{key}.subComments[].author_name</code> | <code>string</code> | Display name of the comment author. |
| <code>data.subCommentsMap.{key}.subComments[].authorArea</code> | <code>string</code> | Location label shown with the comment author. |
| <code>data.subCommentsMap.{key}.subComments[].authorVerified</code> | <code>boolean</code> | Whether the comment author's account is shown as verified. |
| <code>data.subCommentsMap.{key}.subComments[].headurl</code> | <code>string</code> | Primary avatar URL for the comment author. |
| <code>data.subCommentsMap.{key}.subComments[].headurls</code> | <code>array</code> | Available avatar URL variants for the comment author. |
| <code>data.subCommentsMap.{key}.subComments[].headurls[]</code> | <code>object</code> | One avatar variant. |
| <code>data.subCommentsMap.{key}.subComments[].headurls[].url</code> | <code>string</code> | URL for this avatar variant. |

</div>

## Response Example

<ApiExampleSection :api='JSON.parse("\"/api/kuaishou/get-video-comment/v1\"")' />

