> ## Documentation Index
> Fetch the complete documentation index at: https://www.anything.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Spotify

> Access music, playlists, and user data

Spotify API provides access to millions of songs, playlists, and user listening data.

> [!WARNING]
>
> Spotify API requires a Spotify premium account

## Overview

> [card] Create Account
>
> Sign up for a Spotify Developer account

> [card] Get API Key
>
> Generate your Spotify API credentials

> [card] Copy into Anything
>
> Add your API keys to Anything's secrets

## Account Creation

**1. Visit Spotify Developer Portal**

Go to [developer.spotify.com](https://developer.spotify.com/) and click "Dashboard"

![](https://mintcdn.com/create/KG4vmDcLA3klmcBl/images/spotify/homepage.png?fit=max\&auto=format\&n=KG4vmDcLA3klmcBl\&q=85\&s=2ed7c65fddb8a9de2463f3fee086f5f9)

**2. Sign up**

* Log in with your Spotify account

![](https://mintcdn.com/create/KG4vmDcLA3klmcBl/images/spotify/signup.png?fit=max\&auto=format\&n=KG4vmDcLA3klmcBl\&q=85\&s=f62cb7d25f092afd78a6a1d213d8c530)

**3. Create an App**

* Click "Create App" in the dashboard

![](https://mintcdn.com/create/KG4vmDcLA3klmcBl/images/spotify/dashboard.png?fit=max\&auto=format\&n=KG4vmDcLA3klmcBl\&q=85\&s=01a7ee4d718fa2be8ebac7bc47961d66)

**4. Add Details**

* Fill in app name and description
* The redirect uri will be your create project live site url + /api/callback

![](https://mintcdn.com/create/KG4vmDcLA3klmcBl/images/spotify/createapp.png?fit=max\&auto=format\&n=KG4vmDcLA3klmcBl\&q=85\&s=1dd2874186cb1d5c7c90bf8eeceaaa1d)

## Generate API Keys

**1. Access Credentials**

1. Go to your app settings
2. Find your Client ID and Client Secret

![](https://mintcdn.com/create/KG4vmDcLA3klmcBl/images/spotify/apigen.png?fit=max\&auto=format\&n=KG4vmDcLA3klmcBl\&q=85\&s=b711808803ab3165cff954c6ef2f26fc)

> [!WARNING]
>
> Keep your Client Secret secure and never share it

**2. Configure OAuth**

> [!WARNING]
>
> This step is only relevant if you use the Spotify User Info

1. Be sure your project is published
2. Ensure there is a callback path in your page and functions setting

![](https://mintcdn.com/create/KG4vmDcLA3klmcBl/images/spotify/settings.png?fit=max\&auto=format\&n=KG4vmDcLA3klmcBl\&q=85\&s=f5075dfd063450abb72d44f7a3aa0756)

## Add to Anything project

**1. Add the integration**

1. In your Anything project, type `/` in the chat
2. Select "Spotify" from the menu

**2. Add your API keys**

1. Paste your Client ID into the "SPOTIFY\_CLIENT\_ID" field
2. Paste your Client Secret into the "SPOTIFY\_CLIENT\_SECRET" field

> [!TIP]
>
> Need new credentials? Generate them in your Spotify Developer dashboard.

**3. Start using**

You can now use prompts with the integration to access music data.

Example prompts:

* `Get user's playlists using /Spotify`
* `Search for songs with /Spotify`
* `Create a music player using /Spotify`

> [!WARNING]
>
> The API limits how often your app can fetch data. If your app loads the same data often, ask the agent to save it locally so it doesn't re-fetch every time.

Example prompt for optimization:

```
When using /Spotify, save the track data so my app doesn't have to fetch it again
```

> [!TIP]
>
> Your Spotify integration is ready! Use `/Spotify` in chat to access music data.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.