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.
Contents
- Before You Begin
- Part 1: Create your API Request URL
- Part 2: Pull iTunes API Data into Sheets
- Part 3: Get More iTunes API Data
- Part 4: Handle Pagination
- Part 5: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Create Your API Request URL
We’ll first access music details for a specific artist.
- API Base URL: https://itunes.apple.com
- Endpoint: /search
- Query String: ?term=SEARCH_TERM
Putting it together, we get the full API Request URL:
https://itunes.apple.com/search?term=radiohead
Part 2: Pull iTunes API Data into Google Sheets
We can now enter those values into API Connector.
- Open up Google Sheets and click Extensions > API Connector > Open.
- In the Create screen, enter the Request URL we just created
- We don’t need OAuth authentication so just leave that set to None.This is a free, public API so we don’t need to enter any headers either.
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see data about your music search query data in your Google Sheet:
Part 3: Get More iTunes API Data
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
Part 4: 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 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. With API Connector, you can either set these up as separate requests or loop through them automatically with pagination handling, like this:
- API URL: enter your request URL
- Pagination: offset-limit
- Offset parameter: offset
- Limit parameter: limit
- Limit value: 200
- Run until: choose when to stop fetching data
Part 5: API Documentation
Official API documentation: https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/