YouTube API V3: Where can i find a list of each 'videoCategoryId'? YouTube API V3: Where can i find a list of each 'videoCategoryId'? php php

YouTube API V3: Where can i find a list of each 'videoCategoryId'?


Using YouTube API v3 video category id list by Dinesh Gowtham Prathap at https://gist.github.com/dgp/1b24bf2961521bd75d6c

1 - Film & Animation 2 - Autos & Vehicles10 - Music15 - Pets & Animals17 - Sports18 - Short Movies19 - Travel & Events20 - Gaming21 - Videoblogging22 - People & Blogs23 - Comedy24 - Entertainment25 - News & Politics26 - Howto & Style27 - Education28 - Science & Technology29 - Nonprofits & Activism30 - Movies31 - Anime/Animation32 - Action/Adventure33 - Classics34 - Comedy35 - Documentary36 - Drama37 - Family38 - Foreign39 - Horror40 - Sci-Fi/Fantasy41 - Thriller42 - Shorts43 - Shows44 - Trailers


Video categories are region specific -- that's why the category list service requires either a category ID or a region, but not both. This endpoint:

https://www.googleapis.com/youtube/v3/videoCategories?part=snippet&regionCode={two-character-region}&key={YOUR_API_KEY}

will return all categories, along with their ids, for a given region. So as Ikai Lan pointed out in the comments, the ID for music is '10' in the US and, in fact, in all regions where this category is allowed; but there may be some regions where it isn't allowed, or some regions that aren't supported at all.


At the bottom of: https://developers.google.com/youtube/v3/docs/videoCategories/list is a 'try it now' section.

Put 'snippet' in the field labelled 'part' and add a region code, e.g. GB or US in the field labelled 'regionCode'.

This will bring back a full list of categories for your chosen region.