JustSERPDocs
YouTube

YouTube Video

One YouTube video's details, answered as the document: `video`, `channel`, `comment`, `key_moments`, `chapters`, `available_transcripts_languages`, `recommended_videos` (the first 20 the watch page holds) and `merchant_items`.

GET
/v1/youtube/video

One YouTube video's details, answered as the document: video, channel, comment, key_moments, chapters, available_transcripts_languages, recommended_videos (the first 20 the watch page holds) and merchant_items. A block the page lacks is left out. video.formats list every format's itag, size and quality and no address (playback addresses carry the visitor's IP and are dropped). A video that cannot be played and has no details (removed, private) is a 200 with error and nothing else; one with details that cannot be played carries playability. Not read: the comments' text, the channel's join date. Results always come from the US; gl and hl choose the page. zero_retention is not handled.

Authorization

headerX-API-Key<token>

Your API key.

Query Parameters

cancel_token?string

A name you make up for this request (a UUID is fine), so you can later GET /v1/cancel with it. Only you know it, so only you can cancel. Use a new one for every request, retries included: a cancelled token stays cancelled for a few minutes.

Length1 <= length <= 128
video_id*string

The video's 11-character id, or a watch, shorts, embed or live address, or a youtu.be share link.

gl?string

Country of the page, a supported YouTube country (two letters).

Default"us"
hl?string

Language of the page, a supported YouTube language.

Default"en"

Response Body

The video, as the document. When the page could not be parsed, the usual envelope.

application/json
  1. response

The first keys of a document-form answer. Unlike DocumentHead there is no search_information unless the engine has one (there is none for the AI engines, Events, Events Details, Facebook, Tripadvisor Place, Trending Now and the Apple engines' places).

search_metadata*
search_parameters*

The parameters the search ran with, defaults filled in; engine is the engine's name.

search_information?
error?string

YouTube's reason when the video has no details, e.g. "This video is unavailable".

playability?

Present when the video has details but cannot be played.

video?
channel?
comment?
key_moments?array<>
chapters?array<>
available_transcripts_languages?array<>
recommended_videos?
merchant_items?array<>
Example Request
curl -X GET 'https://api.justserp.com/v1/youtube/video?video_id=RcYjXbSJBN8&gl=us&hl=en'
Example Response
{  "search_metadata": {    "id": "string",    "status": "Success",    "created_at": "string",    "request_url": "string",    "html_url": "string"  },  "search_parameters": {},  "search_information": {},  "error": "string",  "playability": {    "status": "string",    "reason": "string"  },  "video": {    "id": "string",    "title": "string",    "length_seconds": 0,    "views": 0,    "likes": 0,    "author": "string",    "category": "string",    "published_time": "string",    "description": "string",    "keywords": [      "string"    ],    "is_family_safe": true,    "thumbnail": "string",    "formats": [      {        "itag": 0,        "mime_type": "string",        "bitrate": 0,        "width": 0,        "height": 0,        "last_modified_unix": "string",        "last_modified": "string",        "content_length": "string",        "quality": "string",        "fps": 0,        "quality_label": "string",        "projection_type": "string"      }    ]  },  "channel": {    "id": "string",    "name": "string",    "link": "string",    "subscribers": 0,    "featured_channel": {},    "thumbnail": "string",    "is_verified": true  },  "comment": {    "total": 0  },  "key_moments": [    {      "title": "string",      "start_seconds": 0,      "thumbnail": "string"    }  ],  "chapters": [    {      "title": "string",      "timestamp": "string",      "thumbnail": "string"    }  ],  "available_transcripts_languages": [    {      "name": "string",      "lang": "string"    }  ],  "recommended_videos": {    "videos": [      {        "position": 0,        "id": "string",        "title": "string",        "link": "string",        "views": 0,        "channel": {},        "length": "string",        "published_time": "string",        "thumbnail": "string"      }    ],    "playlists": [      {        "position": 0,        "id": "string",        "title": "string",        "link": "string",        "description": "string"      }    ]  },  "merchant_items": [    {      "title": "string",      "link": "string",      "description": "string",      "price": "string",      "extracted_price": 0,      "seller": "string",      "thumbnail": "string"    }  ]}