YOUKU Video Search API (V1)
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
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | TOKEN |
keyword | query | string | Yes | - | Keyword to search for. |
page | query | integer | No | 1 | Page 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.
| Field | Type | Description |
|---|---|---|
more | boolean | Whether Youku reports additional results for this search page. |
data | object | Search metadata for the returned page. |
data.pg | integer | Page number reported for this search response. |
data.pz | integer | Page size reported by Youku. The number of returned result groups can differ. |
data.total | integer | Total reported for this search response. It can change between pages. |
data.isEnd | integer | End-of-results indicator reported by Youku. Checked responses used 0 for more results and 1 at the end. |
data.displaySearchTerms | string | Search terms returned for display. |
data.highlightWord | string | Search text returned for highlighting. |
data.status | string | Search status text reported by Youku. |
Result tree9 fields
data.data
| Field | Type | Description |
|---|---|---|
nodes | array | First-level search result groups. |
nodes[].type | integer | Platform type code for this result node. |
nodes[].level | integer | Nesting level reported for this result node. |
nodes[].nodes | array | Nested result groups with optional show information and cards. |
nodes[].nodes[].type | integer | Platform type code for this result node. |
nodes[].nodes[].level | integer | Nesting level reported for this result node. |
nodes[].nodes[].nodes | array | Nested cards for videos, shows, episodes, and other result content. |
nodes[].nodes[].nodes[].type | integer | Platform type code for this result node. |
nodes[].nodes[].nodes[].level | integer | Nesting level reported for this result node. |
Show results22 fields
data.data.nodes[].nodes[].data
Show metadata returned on some result groups.
| Field | Type | Description |
|---|---|---|
showId | string | Show identifier returned by Youku. |
programId | string | Program identifier returned by Youku as text. |
titleDTO | object | Title display information for the result. |
titleDTO.displayName | string | Display title returned for the result. |
tempTitle | string | Additional title text returned for the result. |
cateId | integer | Content category code returned for the result. |
cats | string | Content category labels displayed with the result. |
info | string | Description text returned for the show. |
episodeTotal | integer | Reported total episode count for the show. |
episodeType | integer | Episode type code reported for the show. |
completed | integer | Platform indicator for completion. |
isTrailer | integer | Platform indicator for a trailer. |
paid | integer | Platform indicator for paid content. |
exclusive | integer | Platform indicator for exclusive content. |
sourceName | string | Public video service name displayed with the result. |
thumbUrl | string | Thumbnail URL returned for the result. |
posterDTO | object | Poster display information for the result. |
posterDTO.vThumbUrl | string | Poster image URL returned for the result. |
posterDTO.iconCorner | object | Corner badge attached to the image. |
posterDTO.iconCorner.tagText | string | Text shown on the badge. |
posterDTO.iconCorner.tagType | integer | Platform type code for this badge. |
posterDTO.posterType | string | Display type text returned for the poster. |
Videos and episodes32 fields
data.data.nodes[].nodes[].nodes[].data
Card data. Available fields vary by result type.
| Field | Type | Description |
|---|---|---|
showId | string | Show identifier returned by Youku. |
programId | string | Program identifier returned by Youku as text. |
titleDTO | object | Title display information for the result. |
titleDTO.displayName | string | Display title returned for the result. |
tempTitle | string | Additional title text returned for the result. |
cateId | integer | Content category code returned for the result. |
cats | string | Content category labels displayed with the result. |
info | string | Description text returned for the show. |
episodeTotal | integer | Reported total episode count for the show. |
episodeType | integer | Episode type code reported for the show. |
completed | integer | Platform indicator for completion. |
isTrailer | integer | Platform indicator for a trailer. |
paid | integer | Platform indicator for paid content. |
exclusive | integer | Platform indicator for exclusive content. |
sourceName | string | Public video service name displayed with the result. |
videoId | string | Video identifier returned for the result. |
vid | string | Video identifier returned as numeric text on an episode card. |
realShowId | string | Show identifier returned in the realShowId field. |
docId | integer | string | Search document identifier returned for the result. It can be an integer or a string. |
title | string | Title text returned directly by this result card. |
subtitle | string | Subtitle returned for this result card. |
displayName | string | Display name returned directly with an episode. |
releaseDate | string | Release year displayed for the result as text. |
publishTime | string | Publication-time label returned for the video as displayed text. |
userName | string | Public uploader name returned for a video result. |
userId | string | Uploader identifier returned for a video result. |
sourceImg | string | Icon image URL for the video service shown with the result. |
bulletScreenCount | string | Reported bullet-comment count, returned as numeric text. |
seconds | string | Episode duration in seconds, returned as numeric text. |
showVideoSeq | integer | Reported sequence number of a video in the show. |
showVideoStage | string | Episode or stage label returned for display. |
notice | string | Public notice text returned with the result. |
Thumbnails and badges27 fields
data.data.nodes[].nodes[].nodes[].data
| Field | Type | Description |
|---|---|---|
thumbUrl | string | Thumbnail URL returned for the result. |
iconCorner | object | Corner badge attached to the image. |
iconCorner.tagText | string | Text shown on the badge. |
iconCorner.tagType | integer | Platform type code for this badge. |
posterDTO | object | Poster display information for the result. |
posterDTO.vThumbUrl | string | Poster image URL returned for the result. |
posterDTO.iconCorner | object | Corner badge attached to the image. |
posterDTO.iconCorner.tagText | string | Text shown on the badge. |
posterDTO.iconCorner.tagType | integer | Platform type code for this badge. |
posterDTO.posterType | string | Display type text returned for the poster. |
posterDTO.labelInfo | object | Display label attached to the poster. |
posterDTO.labelInfo.text | object | Title and subtitle text of the poster label. |
posterDTO.labelInfo.text.title | string | Title text displayed in the poster label. |
posterDTO.labelInfo.text.subTitle | string | Subtitle text displayed in the poster label. |
posterDTO.leftBottomText | object | Display text in the lower left of the poster. |
posterDTO.leftBottomText.title | string | Primary display text in the lower-left poster badge. |
posterDTO.topLeftCorner | object | Display text in the upper left of the poster. |
posterDTO.topLeftCorner.firstText | string | Primary text in the upper-left poster badge. |
posterDTO.topLeftCorner.recommendText | string | Recommendation text in the upper-left poster badge. |
screenShotDTO | object | Video thumbnail and display overlays. |
screenShotDTO.thumbUrl | string | Thumbnail URL returned for the result. |
screenShotDTO.rightBottomText | string | Text displayed in the lower-right corner of the thumbnail. |
screenShotDTO.iconCorner | object | Corner badge attached to the image. |
screenShotDTO.iconCorner.tagText | string | Text shown on the badge. |
screenShotDTO.iconCorner.tagType | integer | Platform type code for this badge. |
screenShotDTO.newImgInfo | object | Alternative video thumbnail information. |
screenShotDTO.newImgInfo.thumbUrl | string | Thumbnail URL returned for the result. |
Displayed filter options15 fields
data.data.data.filter
Search options returned for display.
| Field | Type | Description |
|---|---|---|
cate | array | Categories available for display in the platform search interface. |
cate[].id | string | Category option identifier returned as text. |
cate[].title | string | Display name of the option. |
duration | array | Duration options returned for display. |
duration[].title | string | Display name of the option. |
duration[].value | string | String value returned for the option. |
format | array | Format options returned for display. |
format[].title | string | Display name of the option. |
format[].value | integer | Integer value returned for the option. |
tab | array | Search tabs returned for display. |
tab[].id | string | Search tab identifier returned as text. |
tab[].title | string | Display name of the option. |
tab[].orders | array | Sort options returned for this tab. |
tab[].orders[].title | string | Display name of the option. |
tab[].orders[].value | integer | Integer value returned for the option. |
Platform status2 fields
data
Youku video search results and platform status.
| Field | Type | Description |
|---|---|---|
ret | array | Status messages returned by Youku. |
ret[] | string | Individual platform status message. |
Response Example
Loading the response example...