Kuaishou Video Details API (V2)
Retrieve public details for a Kuaishou video identified by its video ID. Use it to inspect a selected video after search or user-published-video discovery.
Highlights
Guidance
Read videoId from the clientCacheKey parameter in main_url and remove the .jpg suffix.
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | Access token for this API service. |
videoId | query | string | Yes | - | The unique video identifier returned by Kuaishou. |
Code Samples
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/kuaishou/get-video-detail/v2?token=YOUR_API_KEY&videoId=VALUE'I want to use the "Video Details (V2)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/kuaishou/get-video-detail/v2?token=YOUR_API_KEY&videoId=VALUE
API Endpoint: BASE_URL + /api/kuaishou/get-video-detail/v2?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-details-v2-en.json
Parameters:
- token (query): Access token for this API service. (Required)
- videoId (query): The unique video identifier returned by Kuaishou. (Required)
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.import requests
BASE_URL = "https://api.justoneapi.com" # Provided by OpenAPI servers
url = BASE_URL + "/api/kuaishou/get-video-detail/v2?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")const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/kuaishou/get-video-detail/v2?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`);
}
}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-detail/v2?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");
}
}
}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-detail/v2?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
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/kuaishou/get-video-detail/v2?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;
}Response Fields
Key fields in a successful response (code = 0).
Video details9 fields
data.photos[]
One Kuaishou video record.
| Field | Type | Description |
|---|---|---|
photo_id | integer | Numeric Kuaishou video ID. Preserve its full precision when parsing JSON. |
originalPhotoId | string | String identifier for the original Kuaishou video. |
caption | string | Caption published with the video. |
time | string | Publication time label displayed for the video. |
timestamp | integer | Video publication time as a Unix timestamp in milliseconds. |
duration | integer | Video duration in milliseconds. |
type | integer | Video type code reported by Kuaishou. |
photo_status | integer | Video status code reported by Kuaishou. |
longVideo | boolean | Whether Kuaishou marks the item as a long video. |
Engagement6 fields
data.photos[]
| Field | Type | Description |
|---|---|---|
view_count | integer | Reported number of video views. |
like_count | integer | Reported number of video likes. |
comment_count | integer | Reported number of video comments. |
collect_count | integer | Reported number of video saves. |
share_count | integer | Reported number of video shares. |
forward_count | integer | Reported number of video forwards. |
Video author7 fields
data.photos[]
| Field | Type | Description |
|---|---|---|
user_id | integer | Numeric Kuaishou account ID of the video author. |
user_name | string | Display name of the video author. |
kwaiId | string | Public Kuaishou account identifier, when available. |
verified | boolean | Whether the video author's account is shown as verified. |
headurls | array | Avatar URLs for the video author. |
headurls[] | object | One available link variant. |
headurls[].url | string | URL for this variant. |
Video files and cover images13 fields
data.photos[]
| Field | Type | Description |
|---|---|---|
main_mv_urls | array | Available URLs for the primary video asset. |
main_mv_urls[] | object | One available link variant. |
main_mv_urls[].url | string | URL for this variant. |
cover_thumbnail_urls | array | Available thumbnail URLs for the video cover. |
cover_thumbnail_urls[] | object | One available link variant. |
cover_thumbnail_urls[].url | string | URL for this variant. |
ff_cover_thumbnail_urls | array | Additional video cover thumbnail URLs reported by Kuaishou. |
ff_cover_thumbnail_urls[] | object | One available link variant. |
ff_cover_thumbnail_urls[].url | string | URL for this variant. |
ext_params | object | Additional video dimensions. |
ext_params.w | integer | Width recorded in the video metadata, in pixels. |
ext_params.h | integer | Height recorded in the video metadata, in pixels. |
streamManifest | object | Playback manifest and technical video and audio metadata. |
Playback manifest and stream groups7 fields
data.photos[].streamManifest
| Field | Type | Description |
|---|---|---|
version | string | Version of the playback manifest. |
videoId | string | Video identifier used by the playback manifest. |
adaptationSet | array | Groups of available playback renditions. |
adaptationSet[] | object | One group of playback renditions. |
adaptationSet[].id | integer | Identifier of the rendition group in the manifest. |
adaptationSet[].duration | integer | Playback duration recorded for this group, in milliseconds. |
adaptationSet[].representation | array | Available renditions within this playback group. |
Playback renditions19 fields
data.photos[].streamManifest.adaptationSet[].representation[]
One playback rendition.
| Field | Type | Description |
|---|---|---|
id | integer | Identifier of this rendition in the playback manifest. |
url | string | Playback URL reported for this rendition. |
maxBitrate | integer | Maximum bitrate reported for the rendition, in kilobits per second. |
avgBitrate | integer | Average bitrate reported for the rendition, in kilobits per second. |
width | integer | Rendition width in pixels. |
height | integer | Rendition height in pixels. |
frameRate | number | Frame rate of this rendition, in frames per second. |
quality | number | Numeric video-quality indicator for this rendition. |
qualityType | string | Quality category code reported for this rendition. |
qualityLabel | string | Display label for the rendition's video quality. |
hdrType | integer | HDR type code reported for this rendition. |
fileSize | integer | Rendition file size in bytes. |
mute | boolean | Whether this rendition is marked as muted. |
backupUrl | array | Backup playback URLs for this rendition. |
backupUrl[] | string | One backup playback URL. |
volumeInfo | object | Audio loudness measurements for this rendition. |
volumeInfo.loudness | number | Reported audio loudness. |
volumeInfo.lra | number | Reported loudness range. |
volumeInfo.tp | number | Reported audio true peak. |
Image and audio measurements14 fields
data.photos[].streamManifest
| Field | Type | Description |
|---|---|---|
videoFeature | object | Reported technical measurements for the video image. |
videoFeature.blurProbability | number | Reported probability of image blur. |
videoFeature.blockyProbability | number | Reported probability of visible block artifacts. |
videoFeature.avgEntropy | number | Reported average image entropy. |
videoFeature.mosScore | number | Reported Mean Opinion Score (MOS) quality metric. |
videoFeature.contrast | number | Reported image contrast metric. |
audioFeature | object | Reported technical measurements for the video's audio. |
audioFeature.audioQuality | number | Reported audio-quality indicator. |
audioFeature.musicProbability | number | Reported probability that music is present. |
audioFeature.dialogProbability | number | Reported probability that dialogue is present. |
audioFeature.backgroundSoundProbability | number | Reported probability that background sound is present. |
audioFeature.stereophonicRichness | number | Reported stereo richness indicator. |
audioFeature.audioSnr | number | Reported audio signal-to-noise ratio. |
audioFeature.effectiveBandwidthInHz | number | Reported effective audio bandwidth in hertz. |
Soundtrack20 fields
data.photos[].soundTrack
Soundtrack metadata and related resources.
| Field | Type | Description |
|---|---|---|
id | string | Identifier of the soundtrack. |
name | string | Title displayed for the soundtrack. |
artist | string | Artist name displayed for the soundtrack. |
duration | integer | Reported soundtrack duration in seconds. |
photoId | integer | Numeric ID of the Kuaishou video associated with this soundtrack. Preserve its full precision when parsing JSON. |
type | integer | Soundtrack type code reported by Kuaishou. |
audioType | integer | Audio type code reported for the soundtrack. |
genreId | integer | Genre identifier reported for the soundtrack. |
loudness | number | Reported soundtrack loudness. |
isOffline | boolean | Whether Kuaishou reports that this soundtrack is offline. |
hasCopyright | boolean | Copyright flag reported by Kuaishou for this soundtrack. |
audioUrls | array | Available playback URLs for the soundtrack. |
audioUrls[] | object | One available link variant. |
audioUrls[].url | string | URL for this variant. |
imageUrls | array | Available image URLs for the soundtrack. |
imageUrls[] | object | One available link variant. |
imageUrls[].url | string | URL for this variant. |
avatarUrls | array | Available avatar URLs displayed with the soundtrack. |
avatarUrls[] | object | One available link variant. |
avatarUrls[].url | string | URL for this variant. |
Account shown with the soundtrack7 fields
data.photos[].soundTrack.user
Public account information displayed with the soundtrack.
| Field | Type | Description |
|---|---|---|
user_id | integer | Numeric Kuaishou account ID displayed with the soundtrack. |
user_name | string | Account display name shown with the soundtrack. |
kwaiId | string | Public Kuaishou account identifier, when available. |
headurl | string | Primary avatar URL of the account shown with the soundtrack. |
headurls | array | Avatar URL variants for the account shown with the soundtrack. |
headurls[] | object | One available link variant. |
headurls[].url | string | URL for this variant. |
Response status2 fields
data
Kuaishou video details, when present in the response.
| Field | Type | Description |
|---|---|---|
result | integer | Kuaishou's payload status code. The populated responses observed here use 1. |
photos | array | Video records returned for the requested identifier, when available. |