Spotify API Creation

Hey everyone,

I’m in the beginning stages of looking into accessing the Spotify API. Has anyone had success accessing it? How did you do it? Any good tips/references guides? Spotify API docs are interesting to navigate.

Thanks!

Hi @kstacy,

Spotify’s API documentation requires OAuth 2.0 to connect to Parabola. Check out our How To documentation that demonstrates how to connect Spotify using this method.

Start by heading to your Spotify Developer Dashboard to create a new application. Enter an app name, description, and accept the terms of service. Once complete, a Client ID and Client Secret will be generated. We’ll need those when authenticating in Parabola.

Next, click the green Edit Settings button and paste the following URL in the Redirect URIs field:

https://parabola.io/api/steps/generic_api/callback

To connect your Spotify application to Parabola, use the “Pull from an API” step. To get started, head to the Authentication tab, select OAuth 2.0, and follow these step settings:

1. Authorization

  • Enter the following base URL: https://accounts.spotify.com/api/token
  • Swap out Your Client ID for the actual Client ID provided by Spotify.
  • Add response_type as a URL parameter and set the value to code.
  • Enter the same Redirect URI listed above as a URL parameter.

2. Access Token

  • Enter the following base URL: https://accounts.spotify.com/api/token
  • Select POST as the method.
  • Add grant_type as a URL parameter and set the value to refresh_token.
  • Enter the same Redirect URI listed above as a URL parameter,

Next, select Advanced Options to add a custom header.

  • Set the Header Key to Authorization.
  • Set the Header Value to the following: Basic your_client_id:your_client_secret.
  • Swap your_client_id with your actual Client ID.
  • Swap your_client_secret with your actual Client Secret. Keep these values separated by a colon.

You will need to Base64 encode the header value. To do this, copy and paste that value into this website. For example, if your header value is Basic 123:456, the encoded value is QmFzaWMgMTIzOjQ1Ng==.

3. Refresh Token

  • Enter the following base URL: https://accounts.spotify.com/api/token
  • Select POST as the method.
  • Add grant_type as a URL parameter and set the value to refresh_token.
  • Add refresh_token as a URL parameter and keep the value blank.

Finally, select Authorize and a pop-up modal will appear validating your authentication request.

You can now make a request to Spotify. The example below uses their Search API to pull in data about Metallica.

There’s a lot to unpack here, so if you have any additional questions or need help querying a specific resource, let us know. Hope this helps!