...

/

Demo App

Demo App

Look at how the Spotify API can be integrated in a real-world application.

Let's look at a Django app that uses some of the previously discussed Spotify API endpoints to retrieve the requested data.

Resources used

We'll call the following Spotify endpoints in this application:

  • Featured Playlists
  • Playlist’s Information
  • Search
  • Audio Features
  • New Releases
  • Album’s Information
  • Artist’s Top Tracks

Django app

The widget below contains the code for our application. Click the "Run" button to see the app in action.

from django.db import models

# Create your models here.
Run the demo application

Let's look at the code in views.py where the API is being called:

  • Lines 1–7: We import the required packages.
  • Lines 9–12:
...