Skip to content

YouTube Video Details API (V1) ​

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

Retrieve public details for a YouTube video identified by video ID. Use it to inspect a known video before further content or comment analysis.

Parameters ​

NameInTypeRequiredDefaultDescription
tokenquerystringYes-Access token for this API service.
videoIdquerystringYes-The unique identifier for a YouTube video.
langquerystringNo-Optional IETF language tag for localized video details, such as en-US. Leave empty to use the default language.

Code Samples ​

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

Parameters:
- token (query): Access token for this API service. (Required)
- videoId (query): The unique identifier for a YouTube video. (Required)
- lang (query): Optional IETF language tag for localized video details, such as en-US. Leave empty to use the default language.

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/youtube/get-video-detail/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
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/youtube/get-video-detail/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
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/youtube/get-video-detail/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
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/youtube/get-video-detail/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
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/youtube/get-video-detail/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;
}

Response Fields ​

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

Video details13 fields

data

Public details for the requested YouTube video.

FieldTypeDescription
errorIdstringStatus returned in the video detail payload. It is Success for successful details.
typestringContent type reported for the video.
idstringYouTube video identifier.
titlestringVideo title.
descriptionstringVideo description text.
lengthSecondsintegerVideo duration in seconds.
publishedTimestringVideo publication date and time as text with a UTC offset.
publishedTimeTextstringVideo publication time as display text.
thumbnailsarrayVideo thumbnail image options.
thumbnails[]objectOne thumbnail image option.
thumbnails[].urlstringURL of the image.
thumbnails[].widthintegerImage width in pixels.
thumbnails[].heightintegerImage height in pixels.
Channel13 fields

data

FieldTypeDescription
channelobjectYouTube channel that published the video.
channel.typestringReported type of the channel entry.
channel.idstringYouTube channel identifier.
channel.namestringChannel display name.
channel.handlestringPublic handle of the YouTube channel.
channel.isVerifiedbooleanWhether the channel is marked as verified.
channel.isVerifiedArtistbooleanWhether the channel is marked as a verified artist.
channel.subscriberCountTextstringChannel subscriber count as display text.
channel.avatararrayChannel avatar image options.
channel.avatar[]objectOne channel avatar image option.
channel.avatar[].urlstringURL of the image.
channel.avatar[].widthintegerImage width in pixels.
channel.avatar[].heightintegerImage height in pixels.
Engagement and availability8 fields

data

FieldTypeDescription
viewCountintegerReported video view count.
likeCountintegerReported video like count.
isLiveStreambooleanWhether the video is identified as a live stream. Use isLiveNow to check current live status.
isLiveNowbooleanWhether the video is currently live.
isRegionRestrictedbooleanWhether a regional availability restriction is reported for the video.
isUnlistedbooleanWhether the video is marked as unlisted.
isCommentDisabledbooleanWhether comments are disabled for this video.
commentCountTextstringVideo comment count as display text.
Music credits9 fields

data

FieldTypeDescription
musicCreditsarrayMusic attribution entries attached to the video.
musicCredits[]objectOne music attribution entry.
musicCredits[].titlestringTitle of the credited music track.
musicCredits[].artiststringArtist displayed in the music credit.
musicCredits[].albumstringAlbum displayed in the music credit.
musicCredits[].descriptionstringDescription text associated with the music credit.
musicCredits[].thumbnailsarrayThumbnail images for this music credit.
musicCredits[].thumbnails[]objectOne thumbnail image option.
musicCredits[].thumbnails[].urlstringURL of the image.
Video formats17 fields

data

FieldTypeDescription
videosobjectVideo format bundle for this video.
videos.errorIdstringStatus reported for this media bundle.
videos.reasonstringReason the media formats or tracks were unavailable, when provided.
videos.expirationintegerUnix timestamp in seconds when the URLs in this bundle expire.
videos.itemsarrayAvailable video formats.
videos.items[]objectOne available video format.
videos.items[].urlstringURL for this video format. The URL can expire.
videos.items[].lengthMsintegerDuration of this format in milliseconds.
videos.items[].mimeTypestringMedia MIME type for this format.
videos.items[].extensionstringFile extension for this format.
videos.items[].lastModifiedintegerReported last modification timestamp for this media format.
videos.items[].sizeintegerReported size of this format in bytes.
videos.items[].sizeTextstringFile size of this format as display text.
videos.items[].hasAudiobooleanWhether the video format includes an audio track.
videos.items[].qualitystringReported video quality label.
videos.items[].widthintegerVideo frame width in pixels.
videos.items[].heightintegerVideo frame height in pixels.
Audio formats14 fields

data

FieldTypeDescription
audiosobjectAudio format bundle for this video.
audios.errorIdstringStatus reported for this media bundle.
audios.reasonstringReason the media formats or tracks were unavailable, when provided.
audios.expirationintegerUnix timestamp in seconds when the URLs in this bundle expire.
audios.itemsarrayAvailable audio formats.
audios.items[]objectOne available audio format.
audios.items[].urlstringURL for this audio format. The URL can expire.
audios.items[].lengthMsintegerDuration of this format in milliseconds.
audios.items[].mimeTypestringMedia MIME type for this format.
audios.items[].extensionstringFile extension for this format.
audios.items[].lastModifiedintegerReported last modification timestamp for this media format.
audios.items[].sizeintegerReported size of this format in bytes.
audios.items[].sizeTextstringFile size of this format as display text.
audios.items[].isDrcbooleanWhether dynamic range compression is indicated for this audio format.
Subtitle tracks8 fields

data

FieldTypeDescription
subtitlesobjectSubtitle track bundle for this video.
subtitles.errorIdstringStatus reported for this media bundle.
subtitles.reasonstringReason the media formats or tracks were unavailable, when provided.
subtitles.expirationintegerUnix timestamp in seconds when the URLs in this bundle expire.
subtitles.itemsarrayAvailable subtitle tracks.
subtitles.items[]objectOne available subtitle track.
subtitles.items[].urlstringURL for this subtitle track. The URL can expire.
subtitles.items[].codestringLanguage or track code reported for the subtitle.
Related videos43 fields

data

FieldTypeDescription
relatedobjectRelated video results included with the details.
related.nextTokenstringOpaque continuation value reported for the related video results.
related.itemsarrayRelated video entries returned with the details.
related.items[]objectOne related video entry.
related.items[].typestringContent type reported for the related video.
related.items[].idstringYouTube video identifier.
related.items[].titlestringTitle of the related video.
related.items[].channelobjectYouTube channel that published the related video.
related.items[].channel.typestringReported type of the channel entry.
related.items[].channel.idstringYouTube channel identifier.
related.items[].channel.namestringChannel display name.
related.items[].channel.handlestringPublic handle of the YouTube channel.
related.items[].channel.isVerifiedbooleanWhether the channel is marked as verified.
related.items[].channel.isVerifiedArtistbooleanWhether the channel is marked as a verified artist.
related.items[].channel.avatararrayChannel avatar image options.
related.items[].channel.avatar[]objectOne channel avatar image option.
related.items[].channel.avatar[].urlstringURL of the image.
related.items[].channel.avatar[].widthintegerImage width in pixels.
related.items[].channel.avatar[].heightintegerImage height in pixels.
related.items[].isLiveNowbooleanWhether the related video is currently live.
related.items[].lengthTextstringRelated video duration as display text.
related.items[].viewCountTextstringRelated video view count as display text.
related.items[].publishedTimeTextstringRelated video publication time as display text.
related.items[].thumbnailsarrayRelated video thumbnail image options.
related.items[].thumbnails[]objectOne thumbnail image option.
related.items[].thumbnails[].urlstringURL of the image.
related.items[].thumbnails[].widthintegerImage width in pixels.
related.items[].thumbnails[].heightintegerImage height in pixels.
related.items[].thumbnails[].movingbooleanWhether the thumbnail is an animated preview.
related.items[].collaboratorsarrayCollaborating channels listed for the related video.
related.items[].collaborators[]objectA collaborating YouTube channel listed for the related video.
related.items[].collaborators[].typestringReported type of the channel entry.
related.items[].collaborators[].idstringYouTube channel identifier.
related.items[].collaborators[].namestringChannel display name.
related.items[].collaborators[].handlestringPublic handle of the YouTube channel.
related.items[].collaborators[].isVerifiedbooleanWhether the channel is marked as verified.
related.items[].collaborators[].isVerifiedArtistbooleanWhether the channel is marked as a verified artist.
related.items[].collaborators[].subscriberCountTextstringChannel subscriber count as display text.
related.items[].collaborators[].avatararrayChannel avatar image options.
related.items[].collaborators[].avatar[]objectOne channel avatar image option.
related.items[].collaborators[].avatar[].urlstringURL of the image.
related.items[].collaborators[].avatar[].widthintegerImage width in pixels.
related.items[].collaborators[].avatar[].heightintegerImage height in pixels.

Response Example ​

Loading the response example...