Skip to content

Instantly share code, notes, and snippets.

@stpe
Last active April 6, 2024 22:36
Show Gist options
  • Star 23 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save stpe/2951130dfc8f1d0d1a2ad736bef3b703 to your computer and use it in GitHub Desktop.
Save stpe/2951130dfc8f1d0d1a2ad736bef3b703 to your computer and use it in GitHub Desktop.
YouTube Topic IDs

Music topics

  • /m/04rlf Music
  • /m/05fw6t Children's music
  • /m/02mscn Christian music
  • /m/0ggq0m Classical music
  • /m/01lyv Country
  • /m/02lkt Electronic music
  • /m/0glt670 Hip hop music
  • /m/05rwpb Independent music
  • /m/03_d0 Jazz
  • /m/028sqc Music of Asia
  • /m/0g293 Music of Latin America
  • /m/064t9 Pop music
  • /m/06cqb Reggae
  • /m/06j6l Rhythm and blues
  • /m/06by7 Rock music
  • /m/0gywn Soul music

Gaming topics

  • /m/0bzvm2 Gaming
  • /m/025zzc Action game
  • /m/02ntfj Action-adventure game
  • /m/0b1vjn Casual game
  • /m/02hygl Music video game
  • /m/04q1x3q Puzzle video game
  • /m/01sjng Racing video game
  • /m/0403l3g Role-playing video game
  • /m/021bp2 Simulation video game
  • /m/022dc6 Sports game
  • /m/03hf_rm Strategy video game

Sports topics

  • /m/06ntj Sports
  • /m/0jm_ American football
  • /m/018jz Baseball
  • /m/018w8 Basketball
  • /m/01cgz Boxing
  • /m/09xp_ Cricket
  • /m/02vx4 Football
  • /m/037hz Golf
  • /m/03tmr Ice hockey
  • /m/01h7lh Mixed martial arts
  • /m/0410tth Motorsport
  • /m/066wd Professional wrestling
  • /m/07bs0 Tennis
  • /m/07_53 Volleyball

Entertainment topics

  • /m/02jjt Entertainment
  • /m/095bb Animated cartoon
  • /m/09kqc Humor
  • /m/02vxn Movies
  • /m/05qjc Performing arts

Lifestyle topics

  • /m/019_rr Lifestyle
  • /m/032tl Fashion
  • /m/027x7n Fitness
  • /m/02wbm Food
  • /m/0kt51 Health
  • /m/03glg Hobby
  • /m/068hy Pets
  • /m/041xxh Physical attractiveness [Beauty]
  • /m/07c1v Technology
  • /m/07bxq Tourism
  • /m/07yv9 Vehicles

Other topics

  • /m/01k8wb Knowledge
  • /m/098wr Society
@akincan-kilic
Copy link

Here is the JSON version of @seomikewaltman 's comment

[
  {
    "id": "/m/04rlf",
    "topic": "Music",
    "parent": true
  },
  {
    "id": "/m/02mscn",
    "topic": "Christian music"
  },
  {
    "id": "/m/0ggq0m",
    "topic": "Classical music"
  },
  {
    "id": "/m/01lyv",
    "topic": "Country"
  },
  {
    "id": "/m/02lkt",
    "topic": "Electronic music"
  },
  {
    "id": "/m/0glt670",
    "topic": "Hip hop music"
  },
  {
    "id": "/m/05rwpb",
    "topic": "Independent music"
  },
  {
    "id": "/m/03_d0",
    "topic": "Jazz"
  },
  {
    "id": "/m/028sqc",
    "topic": "Music of Asia"
  },
  {
    "id": "/m/0g293",
    "topic": "Music of Latin America"
  },
  {
    "id": "/m/064t9",
    "topic": "Pop music"
  },
  {
    "id": "/m/06cqb",
    "topic": "Reggae"
  },
  {
    "id": "/m/06j6l",
    "topic": "Rhythm and blues"
  },
  {
    "id": "/m/06by7",
    "topic": "Rock music"
  },
  {
    "id": "/m/0gywn",
    "topic": "Soul music"
  },
  {
    "id": "/m/0bzvm2",
    "topic": "Gaming",
    "parent": true
  },
  {
    "id": "/m/025zzc",
    "topic": "Action game"
  },
  {
    "id": "/m/02ntfj",
    "topic": "Action-adventure game"
  },
  {
    "id": "/m/0b1vjn",
    "topic": "Casual game"
  },
  {
    "id": "/m/02hygl",
    "topic": "Music video game"
  },
  {
    "id": "/m/04q1x3q",
    "topic": "Puzzle video game"
  },
  {
    "id": "/m/01sjng",
    "topic": "Racing video game"
  },
  {
    "id": "/m/0403l3g",
    "topic": "Role-playing video game"
  },
  {
    "id": "/m/021bp2",
    "topic": "Simulation video game"
  },
  {
    "id": "/m/022dc6",
    "topic": "Sports game"
  },
  {
    "id": "/m/03hf_rm",
    "topic": "Strategy video game"
  },
  {
    "id": "/m/06ntj",
    "topic": "Sports",
    "parent": true
  },
  {
    "id": "/m/0jm_",
    "topic": "American football"
  },
  {
    "id": "/m/018jz",
    "topic": "Baseball"
  },
  {
    "id": "/m/018w8",
    "topic": "Basketball"
  },
  {
    "id": "/m/01cgz",
    "topic": "Boxing"
  },
  {
    "id": "/m/09xp_",
    "topic": "Cricket"
  },
  {
    "id": "/m/02vx4",
    "topic": "Football"
  },
  {
    "id": "/m/037hz",
    "topic": "Golf"
  },
  {
    "id": "/m/03tmr",
    "topic": "Ice hockey"
  },
  {
    "id": "/m/01h7lh",
    "topic": "Mixed martial arts"
  },
  {
    "id": "/m/0410tth",
    "topic": "Motorsport"
  },
  {
    "id": "/m/07bs0",
    "topic": "Tennis"
  },
  {
    "id": "/m/07_53",
    "topic": "Volleyball"
  },
  {
    "id": "/m/02jjt",
    "topic": "Entertainment",
    "parent": true
  },
  {
    "id": "/m/09kqc",
    "topic": "Humor"
  },
  {
    "id": "/m/02vxn",
    "topic": "Movies"
  },
  {
    "id": "/m/05qjc",
    "topic": "Performing arts"
  },
  {
    "id": "/m/066wd",
    "topic": "Professional wrestling"
  },
  {
    "id": "/m/0f2f9",
    "topic": "TV shows"
  },
  {
    "id": "/m/019_rr",
    "topic": "Lifestyle",
    "parent": true
  },
  {
    "id": "/m/032tl",
    "topic": "Fashion"
  },
  {
    "id": "/m/027x7n",
    "topic": "Fitness"
  },
  {
    "id": "/m/02wbm",
    "topic": "Food"
  },
  {
    "id": "/m/03glg",
    "topic": "Hobby"
  },
  {
    "id": "/m/068hy",
    "topic": "Pets"
  },
  {
    "id": "/m/041xxh",
    "topic": "Physical attractiveness [Beauty]"
  },
  {
    "id": "/m/07c1v",
    "topic": "Technology"
  },
  {
    "id": "/m/07bxq",
    "topic": "Tourism"
  },
  {
    "id": "/m/07yv9",
    "topic": "Vehicles"
  },
  {
    "id": "/m/098wr",
    "topic": "Society",
    "parent": true
  },
  {
    "id": "/m/09s1f",
    "topic": "Business"
  },
  {
    "id": "/m/0kt51",
    "topic": "Health"
  },
  {
    "id": "/m/01h6rj",
    "topic": "Military"
  },
  {
    "id": "/m/05qt0",
    "topic": "Politics"
  },
  {
    "id": "/m/06bvp",
    "topic": "Religion"
  },
  {
    "id": "/m/01k8wb",
    "topic": "Knowledge"
  }
]

Here is also the Category IDs if anyone needs that as well:

{"1": "Film & Animation",
 "2": "Autos & Vehicles",
 "10": "Music",
 "15": "Pets & Animals",
 "17": "Sports",
 "18": "Short Movies",
 "19": "Travel & Events",
 "20": "Gaming",
 "21": "Videoblogging",
 "22": "People & Blogs",
 "23": "Comedy",
 "24": "Entertainment",
 "25": "News & Politics",
 "26": "Howto & Style",
 "27": "Education",
 "28": "Science & Technology",
 "29": "Nonprofits & Activism",
 "30": "Movies",
 "31": "Anime/Animation",
 "32": "Action/Adventure",
 "33": "Classics",
 "34": "Comedy",
 "35": "Documentary",
 "36": "Drama",
 "37": "Family",
 "38": "Foreign",
 "39": "Horror",
 "40": "Sci-Fi/Fantasy",
 "41": "Thriller",
 "42": "Shorts",
 "43": "Shows",
 "44": "Trailers"}

Then you can load them in with Python like this:

        # Load the JSON data from the file
        with open(topic_ids_path, 'r') as file:
            data = json.load(file)
        # Create a dictionary with IDs as keys and topics as values
        topics_dict = {item['id']: item['topic'] for item in data}

        with open(category_ids_path, 'r') as file:
            categories_dict = json.load(file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment