# Spotify API Creation

**URL:** <https://community.parabola.io/t/spotify-api-creation/1939>\
**Category:** Ask a question\
**Created:** [July 19, 2021, 3:58pm UTC](https://community.parabola.io/t/spotify-api-creation/1939 "2021-07-19T15:58:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kstacy](https://avatars.discourse-cdn.com/v4/letter/k/b5ac83/32.png) [@kstacy](https://community.parabola.io/u/kstacy)\
**Post date:** [July 19, 2021, 3:58pm UTC](https://community.parabola.io/t/spotify-api-creation/1939/1 "2021-07-19T15:58:59Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/daniel/32/732_2.png) [@daniel](https://community.parabola.io/u/daniel)\
**Post date:** [July 19, 2021, 7:32pm UTC](https://community.parabola.io/t/spotify-api-creation/1939/2 "2021-07-19T19:32:52Z")

</div>

Hi @kstacy,

Spotify’s API documentation requires OAuth 2.0 to connect to Parabola. Check out our [How To](https://parabola.io/integration/api#using-oauth-2-0-in-parabola) documentation that demonstrates how to connect Spotify using this method.

Start by heading to your [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/applications) 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.

 ![Screen Shot 2021-07-19 at 11.09.04 AM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/0/016933ea2125e7586b58adb742a29480ee1aedd4.png)

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**

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/3/35003812a2c1c2f763236031994b10824cc33925.png)

- 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**

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/8/83db00d6db9fadd4d0408d4d2f4adae966383fb6.png)

- 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.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/3/33a1f1e812c8b570d45787be0254bdfd8022bada.png)

- 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](https://www.base64encode.org/). For example, if your header value is `Basic 123:456`, the encoded value is `QmFzaWMgMTIzOjQ1Ng==`.

**3. Refresh Token**

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/0/03795f5c198c42d19846d1d7167c7d65caea6114.png)

- Enter the following base URL: [https://accounts.spotify.com/api/token](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](https://developer.spotify.com/documentation/web-api/reference/#category-search) to pull in data about Metallica.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/8/894906f243a5e645bae2cac98d289894183493ba.png)

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!

---

<div class="post-metadata">

**Author:** ![Roger](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@Roger](https://community.parabola.io/u/Roger)\
**Post date:** [September 16, 2021, 2:30am UTC](https://community.parabola.io/t/spotify-api-creation/1939/3 "2021-09-16T02:30:51Z")

</div>

Hey @daniel, thanks for the guide! However, I’ve closely replicated each step and keep getting an error once I hit Authorize. I’m not sure what I could be doing wrong.

Here’s a couple things I wasn’t sure about:

- Where do I use the Base64 encoded value? Do I replace the `Basic 1234:5678` value with the Base64 encoded value? It’s not clear what I need to do with it.

- The screenshot for 2. Access Token shows `authorization_code` as the value for `grant-type`. However, the guide says to put `refresh_token` as its value.

- The screenshot for 3. Refresh Token shows the Header Key as `Authorization` and the Header Value as the `Basic 1234:5678` value. However, the guide does not say to put anything into these Advanced Options values for step 3.

Hoping to figure this out… thanks again~

---

<div class="post-metadata">

**Author:** ![Adam\_R](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/adam_r/32/2207_2.png) [@Adam\_R](https://community.parabola.io/u/Adam_R)\
**Post date:** [September 16, 2021, 11:02pm UTC](https://community.parabola.io/t/spotify-api-creation/1939/4 "2021-09-16T23:02:54Z")

</div>

Hey @Roger,

Sounds like you’re on the right track! Happy to help finish the swing:

- **Base64 encoded value** : To create this value, first type into the [Base64 Encoder website](https://www.base64encode.org/) `your_client_id:your_client_secret`. When typing this into the the Base64 encoder, you **will not** include the word “Basic.” Once the site returns the `encoded value`, you will head over to the Parabola header and set the value to "Basic `encoded value`". The quotes **are not** included in the header, but the word “Basic” **is** included.

- **Grant\_type** : As seen in Daniel’s screenshots, in `Part 2: Access Token`, you will include `authorization_code` as the `grant_type`. You are correct in saying that `refresh_token` is another valid value for `grant_type`, though we use the value `refresh_token` in `Part 3: Refresh Token`.

- **Authorization in Part 3** : I also no longer see the required `Authorization` header when requesting an access token, so feel free to exclude it! It does seems that we have successfully authorized this connection in the past using this header here, so feel free to include it if you run into any issues.

Let us know if you run into any other issues.

---

<div class="post-metadata">

**Author:** ![Roger](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@Roger](https://community.parabola.io/u/Roger)\
**Post date:** [September 17, 2021, 12:34am UTC](https://community.parabola.io/t/spotify-api-creation/1939/5 "2021-09-17T00:34:25Z")

</div>

Hey @Adam_R! Thanks for the tips. It wasn’t entirely clear that I only needed `your_client_id:your_client_secret` encoded with Base64, not the word “Basic”.

I was still getting an error after following your tips. However, I figured out the problem:

- in the first step, **1. Authorization** , the guide says to enter the base URL as `https://accounts.spotify.com/api/token`. However, the screenshot shows the URL as `https://accounts.spotify.com/authorize`, so I used that instead and everything worked!

I know nothing about API’s, but it occurred to me that a URL with `authorize` in it should probably be used for the **1. Authorization** step 😉

Now for the fun stuff: Spotify playlists.

---

<div class="post-metadata">

**Author:** ![Andre\_Smith](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Andre\_Smith](https://community.parabola.io/u/Andre_Smith)\
**Post date:** [December 15, 2023, 6:06am UTC](https://community.parabola.io/t/spotify-api-creation/1939/7 "2023-12-15T06:06:43Z")

</div>

Absolutely!

Successfully dove into the Spotify API myself. Pro tip: Check out Spotify’s developer portal for comprehensive documentation. Also, make sure to navigate the API docs with patience. By the way, have you considered exploring [Spotify VPNs](https://www.spotifyguru.com/best-vpns-for-spotify/) for an enhanced streaming experience?

Thanks not Mention coz’s no need!

i am all yours…
