API Connector Documentation
Import Spotify Ads Data to Google Sheets
In this guide, we’ll walk through how to pull Spotify Ads data directly into Google Sheets, using the API Connector add-on for Sheets.
Contents
- Before You Begin
- Part 1: Pull Spotify Ads Data into Sheets
- Part 2: Flatten Fields to Headers
- Part 3: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Pull Spotify Ad Data into Sheets
For this example, we'll fetch some reporting data from the Spotify Ads API into Google Sheets.
- Open up Google Sheets and click Extensions > API Connector > Open > Create request.
- In the request form enter the following:
- Application:
Custom
- Method:
GET
- Request URL:
https://api-partner.spotify.com/ads/v2/ad_accounts
- OAuth:
Spotify Ads
- Application:
- When you select Spotify Ads from the OAuth menu, you'll see a blue Connect button if you haven't already authorized the connection. Click through and hit Agree to enable the connection.
- 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 Spotify Ads account IDs populate your sheet.
To create a report, check out the "reports" section in the documentation. The documentation provides example cURL snippets, which can be imported into API Connector through the cURL Import Tool.
Part 2: Flatten Fields to Headers
By default, Spotify's API sends back data where field headers are in one column and field values are in the next. To convert those field headers into column titles, you can flatten fields to headers, like this:
- path to header: rows.time_series.stats.field_type
- path to value: rows.time_series.stats.field_value
While you're at it, select "Truncate headers" to clean up the titles even further. The end result should look like this:
Part 3: API Documentation
Official API documentation: https://developer.spotify.com/documentation/ads-api
To fully disconnect the application on Spotify's side, click https://www.spotify.com/us/account/apps/ (if that link doesn't work, navigate to Account > Apps > Mixed Analytics > Remove Access)