Search API Connector Documentation
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.
- Before You Begin
- Part 1: Pull Data from iTunes to Sheets
- Part 2: Pull iTunes API Data into Sheets
- Part 3: Handle Pagination
- Part 4: API Documentation
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.
- Select iTunes from the drop-down list of applications
- Select an endpoint. These endpoints are all open so you don’t need an API key. For this example we’ll choose the
/searchendpoint, which lets us search the iTunes library by name.
- Under parameters, fill in a search term and (optionally) any other parameters you’d like to filter by.
- Choose a destination sheet, name your request, and hit Run.
Part 2: Create a Custom API Request
Alternatively, you can run custom requests to the iTunes API instead of using API Connector’s built-in integration. To run a custom request, enter the full API URL into the request URL field.
To easily convert from a preset request to a custom API URL, tick the Add request URL box before running your preset request (under Output options). This will print out your complete API URL, which you can then copy/paste into the request URL field.
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 either set these up as separate requests or 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
Part 4: API Documentation
Official API documentation: https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/