Import iTunes Data to Google Sheets

iTunes is a well-known digital media player created by Apple. The iTunes Search API provides a way to search through its huge online database for information on content hosted by the iTunes Store and Apple Books Store. In this guide, we’ll walk through how to pull media data from the iTunes Search API directly into Google Sheets, using the API Connector add-on for Sheets.

PART 1: CREATE YOUR API REQUEST URL

We’ll follow the iTunes Search API documentation to access music details for a specific artist.

  • API Base URL: https://itunes.apple.com
  • Endpoint: /search
  • Query String: ?term=SEARCH_TERM
    Query String Example: ?term=bag raiders

Putting it together, we get the full API Request URL:

https://itunes.apple.com/search?term=bag raiders

PART 2: PULL ITUNES API DATA INTO SHEETS

We can now enter all our values into API Connector and import iTunes API data into Google Sheets.

  1. Open up Google Sheets and click Add-ons > API Connector > Create New API Request.
  2. In the Create Request interface, enter the Request URL we just created
    itunes-img1
  3. This is a free, public API so we don’t need to enter any headers. Just leave this section blank.
  4. Create a new tab. You can call it whatever you like, but here we’ll call it ‘iTunes’. While still in that tab, click ‘Set’ to use that tab as your data destination.
  5. Name your request. Again we’ll call it ‘iTunes’
  6. Click Run and a moment later you’ll see data about your music search query data in your Google Sheet:
    itunes-img2

PART 3: ITUNES API & SHEETS NOTES AND EXPANSIONS

  1. Experiment with query strings as described in the documentation to see other types of iTunes data. For example, this URL will filter for movies with ‘blade’ in the title:
    https://itunes.apple.com/search?media=movie&term=blade
  2. Note that the iTunes API limits the number of records returned in each request. By default, only 50 records will be returned unless you use the limit parameter, like this: https://itunes.apple.com/search?term=radiohead&limit=200.The limit parameter has a maximum value of 200 per page, so if you still need to retrieve more records, add in the offset parameter to get additional pages:
    page 1: https://itunes.apple.com/search?term=radiohead&limit=200&offset=0
    page 2: https://itunes.apple.com/search?term=radiohead&limit=200&offset=200

    With API Connector, you can either set these up as separate requests or loop through them automatically with pagination handling (paid feature):
    itunes-img3

Leave a Comment