Print

Import Spotify Data to Google Sheets

In this guide, we’ll walk through how to pull Spotify music data directly into Google Sheets, using the API Connector add-on for Sheets.

Contents

Before You Begin

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

Part 1: Connect to the Spotify API

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

  1. Open Google Sheets and click Extensions > API Connector > Open > Create request.
  2. Select Spotify from the drop-down list of applications
    spotify-application
  3. Under Authorization, click Connect to Spotify
    spotify-authorization
  4. You will be directed to spotify.com and asked to authorize the connection. Click Agree.spotify-img2
  5. You'll then be returned to your Google Sheet, and can verify that your Spotify connection is active.
    spotify-authorization-connected

Part 2: Pull Data from Spotify to Sheets

Now that we’re connected, let’s pull some data into Sheets.

  1. Under Endpoint, choose /search to search Spotify's catalog of music.
    spotify-endpoints
  2. Fill out the required q and type parameters to indicate your search query and the type of resource to search.
  3. Select a destination sheet, name your request, and click Run.
    spotify-response

Part 3: Create a Custom API Request

Alternatively, you can create a custom request instead of using API Connector’s built-in integration, using any of the endpoints and parameters shown in the API documentation. For example:

  • ApplicationCustom
  • MethodGET
  • Request URLhttps://api.spotify.com/v1/me
  • OAuthSpotify


spotify-results

Part 4: API Documentation

To see more API endpoints and example responses, check out the Spotify Web API reference located at https://developer.spotify.com/documentation/web-api/reference

To view/disconnect API Connector on Spotify's side, navigate to https://www.spotify.com/us/account/apps/.

23 thoughts on “Import Spotify Data to Google Sheets”

  1. Can I get the entire music library this way? I want to compare which songs I have offline the same as ones present in Spotify and delete only them and probably add the rest as a separate playlist.

    Reply
    • As far as I know, Spotify's API doesn't provide stream count numbers. There are quite a few comments/complaints about it on their forum, e.g. here. Based on that thread, it seems some third party tools have found a way to offer this, maybe by scraping Spotify's interface (where it seems like this data is provided). So maybe you can try using an unofficial API for Spotify instead, RapidAPI has quite a few: https://rapidapi.com/search/spotify

      Reply
  2. When trying to pull an artist's top tracks, I am getting an error saying "missing country parameter". However I don't see a place to enter the country id?

    Reply
  3. I'm trying to have the sheet list every album from a specific artist, as well as the year released and the genre. Is there a way I can have it list ONLY this information without any of the other stuff?

    Reply
      • Thank you! Do you know if there'd be any way to make it so that you can type an album ID into a sheets cell, and then have it automatically list the album name, artist, release date, and genre? I'm trying to make a list of albums that I want to/have listened to, and this would make the process super fast for sorting everything I already have as well as adding new albums.

      • You could use the IMPORTAPI custom function for this. For example, first save your request (let's call it Albums) with all your edited fields and othe configurations. Then, enter your album ID in A1, and the following function in B1: =importapi("Albums","https://api.spotify.com/v1/albums?ids="&A1). This will automatically run the Albums request for whatever ID you enter in cell A1, and you can copy the function down the sheet to run it for any ID you enter.

  4. Hey -

    Running into an issue. if a song has multiple artists, each artists gets their own row (using 'grid'). With this, each row does not represent a song, and the data is not lined up.

    Any thoughts on how to fix this?

    Cheers.

    Reply
    • Generally the 'single row' report style should help resolve this type of issue. The main drawback is that it produces extra columns (one for each market), but you can filter those out via the field editor. If that doesn't help, can you please share your endpoint so I can check it on this side?

      Reply
  5. hey,
    is it possible to search the ID from pre-existing cells that have info on the song?

    e.g. If A1 says the song title, and A2 says the artist, can I somehow search that in spotify's database, take the top result's ID, use it in a request, and have that request the audio features?

    thanks!

    Reply
  6. I'm trying to list all the tracks in an album while using the IMPORTAPI function to reference different album IDs. I see the response about this function above, but I am having trouble getting it to work. When I create the request with endpoint /albums/{id}/tracks and leave the id field blank the IMPORTAPI function returns "completed with errors". I can get the request to work if I enter an album id in the id field, but then the IMPORTAPI function only returns tracks for that album regardless of the album id in the cell it is referencing.

    Reply
  7. Great tool! Is it possible to schedule the run, or refresh data from a playlist? It would be great to have real-time info if a playlist changes (e.g. a song is added or removed)

    Reply

Leave a Reply to Ana Cancel reply

Jump To