JustSERPDocs
YouTube

YouTube Search

One page of YouTube's results for a query, under the YouTube Search parameters and answered as the document: `search_metadata`, `search_parameters`, `search_information`, the blocks the page has (`videos`, `channels`, `movies`, `playlists`, `sections`, `shorts`, `posts`, `suggestions`, `featured_channel`, ...) and, when there is more, `pagination.next_page_token`.

GET
/v1/youtube/search

One page of YouTube's results for a query, under the YouTube Search parameters and answered as the document: search_metadata, search_parameters, search_information, the blocks the page has (videos, channels, movies, playlists, sections, shorts, posts, suggestions, featured_channel, ...) and, when there is more, pagination.next_page_token. Send that token back as sp for the next page: three pages of the same query repeated no video. sp also takes YouTube's own filter (EgIQAQ%3D%3D videos only, CAM%3D most viewed), encoded once or twice. ads and people_also_search_for are read from YouTube's known layout and were not seen for an anonymous visitor (2026-10-25). Results always come from the US; gl and hl choose the results.

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
q*string

What to search for.

Length1 <= length <= 500
sp?string

YouTube's filter (EgIQAQ%3D%3D videos, EgIQBA%3D%3D movies, CAM%3D most viewed...) or the previous answer's pagination.next_page_token. Encoded once or twice is accepted.

gl?string

Country of the results, two letters (us, gb, de...).

Default"us"
hl?string

Interface language (en, en-gb, de, pt-pt, zh-cn...).

Default"en"

Response Body

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

application/json
  1. response

The YouTube Search document. A block is present only when the page has it.

search_metadata?
search_parameters?
search_information?
suggestions?array<string>
ads?array<>

Read from YouTube's known layout; not seen for an anonymous visitor.

featured_channel?
channels?array<>
movies?array<>
videos?array<>
playlists?array<>

Playlists, courses and podcasts; type (ours) says which.

sections?array<>
shorts?array<>
posts?array<>
people_also_search_for?array<>

Read from YouTube's known layout; not seen for an anonymous visitor.

pagination?

Absent on the last page.

[key: string]?any
Example Request
curl -X GET 'https://api.justserp.com/v1/youtube/search?q=how+to+bake+bread&gl=us&hl=en'
Example Response
{  "search_metadata": {    "id": "string",    "status": "string",    "created_at": "string",    "request_url": "string"  },  "search_parameters": {    "engine": "youtube",    "q": "string",    "sp": "string",    "gl": "string",    "hl": "string"  },  "search_information": {    "total_results": 0,    "state": "string",    "corrected_query": "string",    "original_query": "string",    "original_query_sp": "string"  },  "suggestions": [    "string"  ],  "ads": [    {}  ],  "featured_channel": {},  "channels": [    {      "position": 0,      "id": "string",      "title": "string",      "handle": "string",      "link": "string",      "description": "string",      "is_verified": true,      "video_count": 0,      "subscribers": 0,      "thumbnail": {}    }  ],  "movies": [    {}  ],  "videos": [    {      "position": 0,      "id": "string",      "title": "string",      "link": "string",      "description": "string",      "views": 0,      "is_live": true,      "channel": {},      "length": "string",      "published_time": "string",      "badges": [        "string"      ],      "thumbnail": {},      "key_moments": [        {}      ]    }  ],  "playlists": [    {}  ],  "sections": [    {}  ],  "shorts": [    {}  ],  "posts": [    {}  ],  "people_also_search_for": [    {}  ],  "pagination": {    "next_page_token": "string"  }}