Get Started with Spotify API
Learn how to obtain the client credentials required to use the Spotify API.
We'll cover the following
To use the Spotify API, we need the "Client ID" and "Client Secret" that the Spotify API provides. We'll also need to add a redirect URL on which we want to land once the user grants us the required permissions. Initially, we need to set up an account and create an app on Spotify. We'll look at how we can do this step-by-step in this lesson.
Create an app
Let's look at how to create an app on Spotify.
Go to the Spotify registration page and create your Spotify account.
Once the account has been created, go to the Developers Dashboard. The Spotify Developer Terms of Service will appear. When we accept these terms, we'll be redirected to the Developers Dashboard.
Click the "Verify" button to receive a verification email at your registered email address.
Open the email and click the "CONFIRM EMAIL" button in it to complete the verification.
Click the "Create app" button. A dialog box requesting the app's name, description, and redirect URI will pop up.
Fill in this information and click the "Save" button. The redirect URI for your application is given below:
{{EDUCATIVE_LIVE_VM_URL}}/callback
Note: If you encounter
Your account is not ready, please wait a few minutes and try again.
error, wait for 8-10 minutes and try again.
We'll be redirected to the app overview page.
The process is visually depicted in the slides below:
Fetch the "Client ID" and "Client Secret"
Creating an app generates a "Client ID" and a "Client Secret" associated with that specific app. We'll need these keys to get an authorization token for making API calls. Once we land on our app overview page, follow the steps below:
Click the "View client secret" button to reveal the "Client Secret" key.
Copy the "Client ID" and "Client Secret" keys.
Click the "Edit" button in the widget below.
Assign the values of "Client ID" and "Client Secret" to
CLIENT_ID
andCLIENT_SECRET
keys respectively.Click the "Save" button to save these keys so they can be used throughout the course.
print("Your Client ID is: {{CLIENT_ID}}");print("Your Client Secret is: {{CLIENT_SECRET}}");
Question: What language does Spotify API use?
Answer: Java and Scala
Java: Spotify's main programming language is Java. They use the Spring Framework for building RESTful APIs and for managing dependencies.
Scala: Spotify also uses Scala for building some of its core services. Scala is a statically-typed programming language that runs on the Java Virtual Machine (JVM).