Docs · Reference
YouTube Search
GET /v1/youtube/search1 credit / pagecache 60 minYouTube search results exactly as a signed-out visitor sees them: videos (title, link, channel, published date, views, duration, thumbnail, description snippet, badges), Shorts, channels and playlists or courses, with filters for result type, upload date, duration and sort order. Fetches as many result pages as your limit needs and hands back a next_page_token to continue later. Billed per results page fetched (up to about 20 results each; pages heavy with Shorts shelves hold fewer, and type=video gives the densest pages); verification pages, blocks and failures are free.
Query parameters
qstring · required | Search query, as typed into YouTube's search box. |
typestring | Only return this kind of result (YouTube's own type filter). Default: "all" Allowed: all, video, short, channel, playlist |
sortstring | Result order. Default: "relevance" Allowed: relevance, popularity |
upload_datestring | Only videos uploaded within this period. Default: "any" Allowed: any, today, week, month, year |
durationstring | Only videos of this length. Default: "any" Allowed: any, under_3_min, 3_to_20_min, over_20_min |
limitinteger | Maximum results of the requested type (videos, channels and playlists for type=all; Shorts shelves come along, capped at the same number). Each results page fetched holds up to about 20 and costs 1 credit. Default: 20 |
hlstring | Interface language, e.g. en, de, pt-BR. Default: "en" |
glstring | Two-letter country code whose results to show. Default: "us" |
page_tokenstring | next_page_token from a previous response, to continue the same search where it stopped. Default: null |
max_ageinteger | Accept a cached answer up to this many seconds old, billed at 50%. |
Response data fields
Example
curl "https://api.gridlode.com/v1/youtube/search?q=python%20tutorial&limit=10" \
-H "Authorization: Bearer $GRIDLODE_KEY"Try it without code on the YouTube Search API page.