Closed baltpeter closed 1 year ago
This one's easy: https://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/genres
has a full list.
We are interested in first-level category 36
(App Store). The grab a list of all second-level subcategories (there are also third-level categories but only for "Games", "Magazines & Newspapers", "Stickers") :
const genreJson = await fetch('https://itunes.apple.com/WebObjects/MZStoreServices.woa/ws/genres').then((r) =>
r.json()
);
const appsGenres = genreJson[36];
if (appsGenres.name !== 'App Store') throw new Error('Unexpected API response.');
const subgenres = Object.values(appsGenres.subgenres).reduce((acc, cur) => ({ ...acc, [cur.name]: +cur.id }), {});
subgenres.all = 36;
console.log(subgenres);
That yields:
{
"Business": 6000,
"Weather": 6001,
"Utilities": 6002,
"Travel": 6003,
"Sports": 6004,
"Social Networking": 6005,
"Reference": 6006,
"Productivity": 6007,
"Photo & Video": 6008,
"News": 6009,
"Navigation": 6010,
"Music": 6011,
"Lifestyle": 6012,
"Health & Fitness": 6013,
"Games": 6014,
"Finance": 6015,
"Entertainment": 6016,
"Education": 6017,
"Books": 6018,
"Medical": 6020,
"Magazines & Newspapers": 6021,
"Catalogs": 6022,
"Food & Drink": 6023,
"Shopping": 6024,
"Stickers": 6025,
"Developer Tools": 6026,
"Graphics & Design": 6027,
"all": 36
}
We need a list of all the possible categories (Apple internally calls them "genres") on the App Store.