Skip to content

YOUKU Video Search API (V1) ​

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

Searches Youku videos by keyword with page-based pagination. Use it to discover videos related to a topic, title, creator, or other search term.

Parameters ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-TOKEN
keywordquerystringYes-Keyword to search for.
pagequeryintegerNo1Page number for pagination, starting from 1.

Code Samples ​

bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/youku/search-video/v1?token=YOUR_API_KEY&keyword=VALUE'
text
I want to use the "Video Search (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/youku/search-video/v1?token=YOUR_API_KEY&keyword=VALUE
API Endpoint: BASE_URL + /api/youku/search-video/v1?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/youku/video-search-v1-en.json

Parameters:
- token (query): TOKEN (Required)
- keyword (query): Keyword to search for. (Required)
- page (query): Page number for pagination, starting from 1.

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/youku/search-video/v1?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/youku/search-video/v1?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/youku/search-video/v1?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/youku/search-video/v1?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/youku/search-video/v1?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).

Page and search metadata9 fields

data.data

Search page metadata and nested result groups.

FieldTypeDescription
morebooleanWhether Youku reports additional results for this search page.
dataobjectSearch metadata for the returned page.
data.pgintegerPage number reported for this search response.
data.pzintegerPage size reported by Youku. The number of returned result groups can differ.
data.totalintegerTotal reported for this search response. It can change between pages.
data.isEndintegerEnd-of-results indicator reported by Youku. Checked responses used 0 for more results and 1 at the end.
data.displaySearchTermsstringSearch terms returned for display.
data.highlightWordstringSearch text returned for highlighting.
data.statusstringSearch status text reported by Youku.
Result tree9 fields

data.data

FieldTypeDescription
nodesarrayFirst-level search result groups.
nodes[].typeintegerPlatform type code for this result node.
nodes[].levelintegerNesting level reported for this result node.
nodes[].nodesarrayNested result groups with optional show information and cards.
nodes[].nodes[].typeintegerPlatform type code for this result node.
nodes[].nodes[].levelintegerNesting level reported for this result node.
nodes[].nodes[].nodesarrayNested cards for videos, shows, episodes, and other result content.
nodes[].nodes[].nodes[].typeintegerPlatform type code for this result node.
nodes[].nodes[].nodes[].levelintegerNesting level reported for this result node.
Show results22 fields

data.data.nodes[].nodes[].data

Show metadata returned on some result groups.

FieldTypeDescription
showIdstringShow identifier returned by Youku.
programIdstringProgram identifier returned by Youku as text.
titleDTOobjectTitle display information for the result.
titleDTO.displayNamestringDisplay title returned for the result.
tempTitlestringAdditional title text returned for the result.
cateIdintegerContent category code returned for the result.
catsstringContent category labels displayed with the result.
infostringDescription text returned for the show.
episodeTotalintegerReported total episode count for the show.
episodeTypeintegerEpisode type code reported for the show.
completedintegerPlatform indicator for completion.
isTrailerintegerPlatform indicator for a trailer.
paidintegerPlatform indicator for paid content.
exclusiveintegerPlatform indicator for exclusive content.
sourceNamestringPublic video service name displayed with the result.
thumbUrlstringThumbnail URL returned for the result.
posterDTOobjectPoster display information for the result.
posterDTO.vThumbUrlstringPoster image URL returned for the result.
posterDTO.iconCornerobjectCorner badge attached to the image.
posterDTO.iconCorner.tagTextstringText shown on the badge.
posterDTO.iconCorner.tagTypeintegerPlatform type code for this badge.
posterDTO.posterTypestringDisplay type text returned for the poster.
Videos and episodes32 fields

data.data.nodes[].nodes[].nodes[].data

Card data. Available fields vary by result type.

FieldTypeDescription
showIdstringShow identifier returned by Youku.
programIdstringProgram identifier returned by Youku as text.
titleDTOobjectTitle display information for the result.
titleDTO.displayNamestringDisplay title returned for the result.
tempTitlestringAdditional title text returned for the result.
cateIdintegerContent category code returned for the result.
catsstringContent category labels displayed with the result.
infostringDescription text returned for the show.
episodeTotalintegerReported total episode count for the show.
episodeTypeintegerEpisode type code reported for the show.
completedintegerPlatform indicator for completion.
isTrailerintegerPlatform indicator for a trailer.
paidintegerPlatform indicator for paid content.
exclusiveintegerPlatform indicator for exclusive content.
sourceNamestringPublic video service name displayed with the result.
videoIdstringVideo identifier returned for the result.
vidstringVideo identifier returned as numeric text on an episode card.
realShowIdstringShow identifier returned in the realShowId field.
docIdinteger | stringSearch document identifier returned for the result. It can be an integer or a string.
titlestringTitle text returned directly by this result card.
subtitlestringSubtitle returned for this result card.
displayNamestringDisplay name returned directly with an episode.
releaseDatestringRelease year displayed for the result as text.
publishTimestringPublication-time label returned for the video as displayed text.
userNamestringPublic uploader name returned for a video result.
userIdstringUploader identifier returned for a video result.
sourceImgstringIcon image URL for the video service shown with the result.
bulletScreenCountstringReported bullet-comment count, returned as numeric text.
secondsstringEpisode duration in seconds, returned as numeric text.
showVideoSeqintegerReported sequence number of a video in the show.
showVideoStagestringEpisode or stage label returned for display.
noticestringPublic notice text returned with the result.
Thumbnails and badges27 fields

data.data.nodes[].nodes[].nodes[].data

FieldTypeDescription
thumbUrlstringThumbnail URL returned for the result.
iconCornerobjectCorner badge attached to the image.
iconCorner.tagTextstringText shown on the badge.
iconCorner.tagTypeintegerPlatform type code for this badge.
posterDTOobjectPoster display information for the result.
posterDTO.vThumbUrlstringPoster image URL returned for the result.
posterDTO.iconCornerobjectCorner badge attached to the image.
posterDTO.iconCorner.tagTextstringText shown on the badge.
posterDTO.iconCorner.tagTypeintegerPlatform type code for this badge.
posterDTO.posterTypestringDisplay type text returned for the poster.
posterDTO.labelInfoobjectDisplay label attached to the poster.
posterDTO.labelInfo.textobjectTitle and subtitle text of the poster label.
posterDTO.labelInfo.text.titlestringTitle text displayed in the poster label.
posterDTO.labelInfo.text.subTitlestringSubtitle text displayed in the poster label.
posterDTO.leftBottomTextobjectDisplay text in the lower left of the poster.
posterDTO.leftBottomText.titlestringPrimary display text in the lower-left poster badge.
posterDTO.topLeftCornerobjectDisplay text in the upper left of the poster.
posterDTO.topLeftCorner.firstTextstringPrimary text in the upper-left poster badge.
posterDTO.topLeftCorner.recommendTextstringRecommendation text in the upper-left poster badge.
screenShotDTOobjectVideo thumbnail and display overlays.
screenShotDTO.thumbUrlstringThumbnail URL returned for the result.
screenShotDTO.rightBottomTextstringText displayed in the lower-right corner of the thumbnail.
screenShotDTO.iconCornerobjectCorner badge attached to the image.
screenShotDTO.iconCorner.tagTextstringText shown on the badge.
screenShotDTO.iconCorner.tagTypeintegerPlatform type code for this badge.
screenShotDTO.newImgInfoobjectAlternative video thumbnail information.
screenShotDTO.newImgInfo.thumbUrlstringThumbnail URL returned for the result.
Displayed filter options15 fields

data.data.data.filter

Search options returned for display.

FieldTypeDescription
catearrayCategories available for display in the platform search interface.
cate[].idstringCategory option identifier returned as text.
cate[].titlestringDisplay name of the option.
durationarrayDuration options returned for display.
duration[].titlestringDisplay name of the option.
duration[].valuestringString value returned for the option.
formatarrayFormat options returned for display.
format[].titlestringDisplay name of the option.
format[].valueintegerInteger value returned for the option.
tabarraySearch tabs returned for display.
tab[].idstringSearch tab identifier returned as text.
tab[].titlestringDisplay name of the option.
tab[].ordersarraySort options returned for this tab.
tab[].orders[].titlestringDisplay name of the option.
tab[].orders[].valueintegerInteger value returned for the option.
Platform status2 fields

data

Youku video search results and platform status.

FieldTypeDescription
retarrayStatus messages returned by Youku.
ret[]stringIndividual platform status message.

Response Example ​

Loading the response example...