Find videos by category
Learn how to retrieve videos from a specific category using YouTube Data API.
In this example we will show how to retrieve videos from a specific category using the YouTube Data API. We will use the GET /search
endpoint to search for videos by category. Our example will search for videos in the “Gaming” category. You can find the full list of categories in the Categories page.
Request examples
In this request we are searching for videos in the Gaming 20
category. We are also setting the maxResults
parameter to 1 to get only one video. You can change the videoCategoryId
parameter to search for videos in a different category. Setting the type
parameter to video
required for the request when using videoCategoryId
parameter.
Response example
The result is similar to what you would see on the YouTube website when searching for videos. Get more details about this API endpoint in the API Search documentation.