Skip to content

Douyin (TikTok China) Video Search API (V4) ​

GET
API health status
Healthy Available Limited Mostly unavailable No data
Loading health status...

Searches Douyin (TikTok China) videos by keyword with sort, publish-time, duration, and page filters; later pages require the previous search ID. Use it to support content discovery and trend research.

Parameters ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-Access token for this API service.
keywordquerystringYes-The search keyword.
sortTypequerystringNo_0Sorting criteria for search results.


Available Values:

- _0: General

- _1: More likes

- _2: Newest
publishTimequerystringNo_0Filter by video publish time range.


Available Values:

- _0: No Limit

- _1: Last 24 Hours

- _7: Last 7 Days

- _180: Last 6 Months
durationquerystringNo_0Filter by video duration.


Available Values:

- _0: No Limit

- _1: Under 1 Minute

- _2: 1-5 Minutes

- _3: Over 5 Minutes
pagequeryintegerNo1Page number (starting from 1).
searchIdquerystringNo-Search ID; required for pages > 1. Use data.business_config.next_page.search_id from the previous response, and stop paging when data.business_config.has_more is 0.

Code Samples ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/douyin/search-video/v4?token=YOUR_API_KEY&keyword=VALUE'
text
I want to use the "Video Search (V4)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/douyin/search-video/v4?token=YOUR_API_KEY&keyword=VALUE
API Endpoint: BASE_URL + /api/douyin/search-video/v4?token=YOUR_API_KEY&keyword=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/douyin-tiktok-china/video-search-v4-en.json

Parameters:
- token (query): Access token for this API service. (Required)
- keyword (query): The search keyword. (Required)
- sortType (query): Sorting criteria for search results.

Available Values:
- `_0`: General
- `_1`: More likes
- `_2`: Newest
- publishTime (query): Filter by video publish time range.

Available Values:
- `_0`: No Limit
- `_1`: Last 24 Hours
- `_7`: Last 7 Days
- `_180`: Last 6 Months
- duration (query): Filter by video duration.

Available Values:
- `_0`: No Limit
- `_1`: Under 1 Minute
- `_2`: 1-5 Minutes
- `_3`: Over 5 Minutes
- page (query): Page number (starting from 1).
- searchId (query): Search ID; required for pages > 1. Use data.business_config.next_page.search_id from the previous response, and stop paging when data.business_config.has_more is 0.

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
import requests

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

url = BASE_URL + "/api/douyin/search-video/v4?token=YOUR_API_KEY&keyword=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
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/douyin/search-video/v4?token=YOUR_API_KEY&keyword=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
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/douyin/search-video/v4?token=YOUR_API_KEY&keyword=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
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/douyin/search-video/v4?token=YOUR_API_KEY&keyword=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
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/douyin/search-video/v4?token=YOUR_API_KEY&keyword=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).

Search results and pagination8 fields

data

Search results and pagination details supplied for the Douyin keyword query.

FieldTypeDescription
business_dataarraySearch result cards. The same video may appear on multiple pages. Use aweme_id to deduplicate video results.
business_configobjectPagination and query information.
business_config.keywordstringKeyword reported for this search.
business_config.card_countintegerNumber of cards reported for this result page.
business_config.has_moreinteger | stringStop when this flag is 0, including when a search ID is still present. An end-of-results response may contain only the pagination flag.
business_config.next_pageobjectContinuation information when supplied.
business_config.next_page.search_idstringSearch ID for the next page. Pass it as searchId, increment page by one and keep the keyword and filters unchanged. Successive pages may return the same search ID.
status_codenumber | stringDouyin search status code when supplied.
Result cards2 fields

data.business_data[]

FieldTypeDescription
data_idstringIdentifier of the card within the current response.
typeintegerResult kind code. Observed kinds include 1 for video results and 66667 for related searches.
Video information12 fields

data.business_data[].data.aweme_info

A Douyin video result when the card includes one.

FieldTypeDescription
aweme_idstringStable Douyin video ID encoded as a string. Use this value to identify the video across search pages.
group_idstringGroup identifier reported for the post.
author_user_idintegerNumeric ID of the posting account.
descstringPost description supplied by Douyin.
captionstringPost caption supplied by Douyin.
item_titlestringPost title, when supplied.
preview_titlestringTitle supplied for the post preview.
create_timeintegerVideo publication time as a Unix timestamp in seconds.
durationintegerVideo duration in milliseconds.
aweme_typeintegerPost type code reported by Douyin.
media_typeintegerMedia type code reported by Douyin.
ip_attributionstringIP region label reported by Douyin, when available.
Author26 fields

data.business_data[].data.aweme_info.author

Author profile information returned with the video.

FieldTypeDescription
uidstringDouyin account ID encoded as a string.
sec_uidstringSecondary Douyin account identifier used by user profile endpoints.
nicknamestringAuthor’s display name.
unique_idstringPublic Douyin account handle, when available.
short_idstringShort account identifier reported by Douyin.
follower_countintegerFollower count reported for the author.
is_verifiedbooleanWhether Douyin reports the author as verified.
verification_typeintegerVerification category code reported for the author.
avatar_thumbobjectThumbnail avatar for the author.
avatar_thumb.uristringResource identifier reported by Douyin.
avatar_thumb.url_listarrayURLs supplied for the resource.
avatar_thumb.url_list[]stringURL supplied for the resource.
avatar_thumb.widthintegerResource width in pixels reported in the metadata.
avatar_thumb.heightintegerResource height in pixels reported in the metadata.
avatar_mediumobjectMedium avatar for the author.
avatar_medium.uristringResource identifier reported by Douyin.
avatar_medium.url_listarrayURLs supplied for the resource.
avatar_medium.url_list[]stringURL supplied for the resource.
avatar_medium.widthintegerResource width in pixels reported in the metadata.
avatar_medium.heightintegerResource height in pixels reported in the metadata.
avatar_largerobjectLarger avatar for the author.
avatar_larger.uristringResource identifier reported by Douyin.
avatar_larger.url_listarrayURLs supplied for the resource.
avatar_larger.url_list[]stringURL supplied for the resource.
avatar_larger.widthintegerResource width in pixels reported in the metadata.
avatar_larger.heightintegerResource height in pixels reported in the metadata.
Engagement7 fields

data.business_data[].data.aweme_info.statistics

Engagement counts reported for the video.

FieldTypeDescription
aweme_idstringDouyin video ID associated with these statistics.
digg_countintegerNumber of likes reported for the video.
comment_countintegerNumber of comments reported for the video.
collect_countintegerNumber of saves reported for the video.
share_countintegerNumber of shares reported for the video.
forward_countintegerForward count supplied in the response.
download_countintegerNumber of downloads reported for the video.
Video covers22 fields

data.business_data[].data.aweme_info.video

FieldTypeDescription
coverobjectVideo cover image.
cover.uristringResource identifier reported by Douyin.
cover.url_listarrayURLs supplied for the resource.
cover.url_list[]stringURL supplied for the resource.
cover.widthintegerResource width in pixels reported in the metadata.
cover.heightintegerResource height in pixels reported in the metadata.
origin_coverobjectCover image in the original cover field.
origin_cover.uristringResource identifier reported by Douyin.
origin_cover.url_listarrayURLs supplied for the resource.
origin_cover.url_list[]stringURL supplied for the resource.
origin_cover.widthintegerResource width in pixels reported in the metadata.
origin_cover.heightintegerResource height in pixels reported in the metadata.
dynamic_coverobjectMoving cover resource when available.
dynamic_cover.uristringResource identifier reported by Douyin.
dynamic_cover.url_listarrayURLs supplied for the resource.
dynamic_cover.url_list[]stringURL supplied for the resource.
dynamic_cover.widthintegerResource width in pixels reported in the metadata.
dynamic_cover.heightintegerResource height in pixels reported in the metadata.
animated_coverobjectAnimated cover resource when available.
animated_cover.uristringResource identifier reported by Douyin.
animated_cover.url_listarrayURLs supplied for the resource.
animated_cover.url_list[]stringURL supplied for the resource.
Playback and quality51 fields

data.business_data[].data.aweme_info.video

Video metadata and available playback resources.

FieldTypeDescription
durationintegerVideo duration in milliseconds.
widthintegerVideo width reported by Douyin in pixels.
heightintegerVideo height reported by Douyin in pixels.
formatstringVideo format reported by Douyin.
ratiostringResolution label reported by Douyin.
has_watermarkbooleanWatermark flag from the video metadata.
play_addrobjectPrimary playback address supplied for the video.
play_addr.uristringResource identifier reported by Douyin.
play_addr.url_listarrayURLs supplied for the resource.
play_addr.url_list[]stringURL supplied for the resource.
play_addr.widthintegerResource width in pixels reported in the metadata.
play_addr.heightintegerResource height in pixels reported in the metadata.
play_addr.data_sizeintegerResource file size in bytes reported in the metadata.
play_addr_h264objectAddress supplied for the H.264 variant.
play_addr_h264.uristringResource identifier reported by Douyin.
play_addr_h264.url_listarrayURLs supplied for the resource.
play_addr_h264.url_list[]stringURL supplied for the resource.
play_addr_h264.widthintegerResource width in pixels reported in the metadata.
play_addr_h264.heightintegerResource height in pixels reported in the metadata.
play_addr_h264.data_sizeintegerResource file size in bytes reported in the metadata.
play_addr_265objectAddress supplied in the H.265 playback field.
play_addr_265.uristringResource identifier reported by Douyin.
play_addr_265.url_listarrayURLs supplied for the resource.
play_addr_265.url_list[]stringURL supplied for the resource.
play_addr_265.widthintegerResource width in pixels reported in the metadata.
play_addr_265.heightintegerResource height in pixels reported in the metadata.
play_addr_265.data_sizeintegerResource file size in bytes reported in the metadata.
download_addrobjectDownload address supplied for the video.
download_addr.uristringResource identifier reported by Douyin.
download_addr.url_listarrayURLs supplied for the resource.
download_addr.url_list[]stringURL supplied for the resource.
download_addr.widthintegerResource width in pixels reported in the metadata.
download_addr.heightintegerResource height in pixels reported in the metadata.
download_addr.data_sizeintegerResource file size in bytes reported in the metadata.
bit_ratearrayPlayback encodings and bitrate metadata supplied for the video.
bit_rate[]objectOne playback encoding supplied for the video.
bit_rate[].bit_rateintegerEncoding bitrate in bits per second.
bit_rate[].FPSintegerFrame rate in frames per second.
bit_rate[].formatstringMedia format reported for this encoding.
bit_rate[].gear_namestringEncoder preset label reported for this variant.
bit_rate[].quality_typeintegerQuality category code reported for this encoding.
bit_rate[].is_h265integerH.265 encoding flag reported for this variant.
bit_rate[].HDR_typestringHDR category label returned for the encoding.
bit_rate[].HDR_bitstringHDR bit-depth label returned for the encoding.
bit_rate[].play_addrobjectPlayback address for this encoding.
bit_rate[].play_addr.uristringResource identifier reported by Douyin.
bit_rate[].play_addr.url_listarrayURLs supplied for the resource.
bit_rate[].play_addr.url_list[]stringURL supplied for the resource.
bit_rate[].play_addr.widthintegerResource width in pixels reported in the metadata.
bit_rate[].play_addr.heightintegerResource height in pixels reported in the metadata.
bit_rate[].play_addr.data_sizeintegerResource file size in bytes reported in the metadata.
Music and audio17 fields

data.business_data[].data.aweme_info.music

Music or sound metadata associated with the video.

FieldTypeDescription
idintegerNumeric music ID. Use a lossless JSON parser to retain the full value in JavaScript.
id_strstringMusic ID encoded as a string.
midstringMusic ID returned in the mid field.
titlestringTitle of the sound or music track.
authorstringArtist or sound creator name returned with the track.
albumstringAlbum title when supplied.
is_original_soundbooleanWhether Douyin marks the track as original sound.
cover_thumbobjectThumbnail cover for the sound or music track.
cover_thumb.uristringResource identifier reported by Douyin.
cover_thumb.url_listarrayURLs supplied for the resource.
cover_thumb.url_list[]stringURL supplied for the resource.
cover_thumb.widthintegerResource width in pixels reported in the metadata.
cover_thumb.heightintegerResource height in pixels reported in the metadata.
play_urlobjectPlayback resource for the sound or music track.
play_url.uristringResource identifier reported by Douyin.
play_url.url_listarrayURLs supplied for the resource.
play_url.url_list[]stringURL supplied for the resource.
Sharing, topics, and mentions19 fields

data.business_data[].data.aweme_info

FieldTypeDescription
share_urlstringDouyin share URL for the video.
share_infoobjectMetadata supplied for sharing the video.
share_info.share_urlstringURL supplied for sharing the video.
share_info.share_titlestringTitle supplied for sharing the video.
share_info.share_descstringDescription supplied for sharing the video.
text_extraarray | nullHashtags and user mentions associated with the post text. This list may be null.
text_extra[]objectOne text annotation.
text_extra[].typeintegerAnnotation type code reported by Douyin.
text_extra[].hashtag_idstringID of the annotated hashtag when the annotation represents a hashtag.
text_extra[].hashtag_namestringName of the annotated hashtag.
text_extra[].user_idstringDouyin account ID when the annotation mentions a user.
text_extra[].sec_uidstringSecondary Douyin account ID for the mentioned user.
text_extra[].is_commercebooleanWhether Douyin flags the annotated hashtag as commercial.
cha_listarray | nullTopic or challenge details associated with the post. This list may be null.
cha_list[]objectOne topic or challenge.
cha_list[].cidstringDouyin topic or challenge ID.
cha_list[].cha_namestringTopic or challenge name.
cha_list[].descstringDescription of the topic or challenge.
cha_list[].is_commercebooleanWhether Douyin flags the topic or challenge as commercial.
Related searches3 fields

data.business_data[].data

FieldTypeDescription
related_word_listarraySuggested related search terms when the card includes them.
related_word_list[]objectOne related search suggestion.
related_word_list[].related_wordstringSuggested related search term.
Other fields2 fields
Field pathTypeDescription
data.business_data[]objectOne card returned in the search result list.
data.business_data[].dataobjectContent supplied for the result card. Fields depend on the card kind.

Response Example ​

Loading the response example...