Download Apple Music Data
If you’re interested in scraping the Apple Music (or iTunes) catalog for data, you can legally do so using HAR files without violating Apple’s 3,000 page Terms of Service. This is because HAR files allow us to record the web traffic that Apple sends to our browser and we can then perform the scraping on a recording (not governed under the Terms of Service) instead of the actual Apple website.
1. Browse Apple Music
Head to the Apple Music Search & Browse Feature and use any searches, genres, filters, etc… you want to narrow down your results to the data you want to scrape. Now right click in the webpage and hit “Inspect” to open up developer tools and begin recording your web traffic.
Now refresh the page to reload the initial data to your browser (now that you’re recording) and scroll down through the results and hit the next button if needed to keep loading more and more results that we’re now recording the data for.
2. Export & Download
Once you’ve browsed through enough catalog data, find the “Network” tab under developer tools and click the down arrow labeled “Export HAR…” to download a HAR file containing a recording of all the raw JSON Apple sent to your browser. Upload that file to to the HAR File Web Scraper and find the group of requests containing the catalog data. Click “Parse Group” and you’ll be able to download CSV file collections of the search results.