Print

Import iTunes Data to Google Sheets

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.

This API doesn't require any authentication, so let's jump right in.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Pull Data from iTunes to Sheets

The easiest way to get started with the iTunes API is through API Connector’s built-in integration.

  1. In Sheets, open API Connector and create a new request (Extensions > API Connector > Open > Create request)
  2. Select iTunes from the drop-down list of applications
    itunes-application
  3. Select an endpoint.  These endpoints are all open so you don’t need an API key. For this example we’ll choose the /search endpoint, which lets us search the iTunes library by name.
    itunes-endpoints
  4. Under parameters, fill in a search term and (optionally) any other parameters you'd like to filter by.
  5. Choose a destination sheet, name your request, and hit Run.
    itunes-parameters

Part 2: Create a Custom API Request

Alternatively, you can run your own custom requests instead of using API Connector’s pre-built integration, using any of the endpoints and parameters shown in the API documentation. Here's an example request setup:

  • ApplicationCustom
  • MethodGET
  • Request URLhttps://itunes.apple.com/search?term=radioheaditunes-results1

Part 3: Handle Pagination

Note that the iTunes API limits the number of records returned in each request. By default, only 50 records will be returned unless you set the limit parameter.

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. With API Connector, you can loop through them automatically with pagination handling, like this:

  • Pagination: offset-limit
  • Offset parameter: offset
  • Limit parameter: limit
  • Limit value: 200
  • Run until: choose when to stop fetching data
    itunes-pagination-offsetlimit

Part 4: API Documentation

Official API documentation: https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/

Tags:

Leave a Comment

Jump To