Documentation has been updated: see help center and changelog in one place.

YouTube Search

Learn how to get YouTube search data for videos, channels, and playlists using the Web Scraper API. Find out more about its parameters and see an example request.

You can search YouTube for videos, channels, playlists or movies by providing a search query to the youtube_search or youtube_search_max source.

Theyoutube_search source allows retrieving up to 20 search results, while the youtube_search_max source can return up to 700 results in a single response.

This source can also be combined with youtube_autocomplete source to include suggestions and target relevant keywords and search terms.

The following examples demonstrate how to utilize youtube_search source to retrieve YouTube videos based on a search query.

curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "youtube_search",
        "query": "how to make a website"
    }'

We use the synchronous Realtime integration method in our examples. If you would like to use the Push-Pull integration, refer to the Integration Methods section.

Query parameters

Parameter
Description
Default Value
Type

source

Sets the scraper.

youtube_search or youtube_search_max

String

query

Search term.

-

String

- required parameter

Filters

You can customize your search by using all the filters available via YouTube GUI.

Filters query parameters

Parameter
Description
Default Value
Type

upload_date

Filters videos by when they were uploaded. Available values are: today, last_hour, this_week, this_month, this_year.

-

String

type

Returns results by content type. Available values are: video, channel, playlist, movie.

-

String

duration

Content duration in minutes. Available values are: <4, 4-20, >20.

-

String

sort_by

Determines how search results are ordered. Available values are rating, relevance, view_count,upload_date.

relevance

String

360

Returns 360-degree videos in search results.

-

Boolean

3d

Returns 3D videos in search results.

-

Boolean

4k

Returns 4K resolution videos in search results.

-

Boolean

creative_commons

Returns only videos with Creative Commons licenses.

-

Boolean

hd

Returns high-definition videos in search results.

-

Boolean

hdr

Returns HDR (High Dynamic Range) videos in search results.

-

Boolean

live

Returns live streams in search results.

-

Boolean

location

Returns videos with location information.

-

Boolean

purchased

Returns purchased content in search results.

-

Boolean

subtitles

Returns videos with subtitles or closed captions.

-

Boolean

vr180

Returns VR180 format videos in search results.

-

Boolean

Last updated

Was this helpful?