Created
June 29, 2019 11:49
-
-
Save cereme/9129128b0f14ad11d54b03c4f11c8369 to your computer and use it in GitHub Desktop.
youtube api get assignable categories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const your_api_key = ""; | |
const region_code = "kr"; | |
fetch(`https://www.googleapis.com/youtube/v3/videoCategories?part=snippet®ionCode=${region_code}&key=${your_api_key}`,{method:'get'}) | |
.then(res=>res.json()) | |
.then(res=>res.items.filter(e=>e.snippet.assignable).forEach(e=>console.log(e.id, e.snippet.title))); | |
/* | |
1 Film & Animation | |
2 Autos & Vehicles | |
10 Music | |
15 Pets & Animals | |
17 Sports | |
19 Travel & Events | |
20 Gaming | |
22 People & Blogs | |
23 Comedy | |
24 Entertainment | |
25 News & Politics | |
26 Howto & Style | |
27 Education | |
28 Science & Technology | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment