Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spotify-api-client

In development. Not maintained.

Low-level DIY API client for Spotify.

Refer to Web API | Spotify for Developers.

Features

Get and remove saved tracks from your Spotify.

Usage

  1. Create a spotify app with an arbitrary name. Save:
  • Client id
  • Client secret
  • The chosen redirect uri (e.g. http://127.0.0.1:8888/callback)
  1. Create a .env file in your current working directory with:
SPOTIFY_API_CLIENT_ID=<your_client_id>
SPOTIFY_API_CLIENT_SECRET=<your_client_secret>
SPOTIFY_API_REDIRECT_URI=<your_chosen_redirect_uri>
  1. Install the project:
# Install a tag
uv pip install "git+https://github.com/richardpordan/spotify-api-client@main"
  1. Example usage.

In the same directory where your .env file is or with the environment variables in (1) already loaded:

from spotify_api_client.spotify_client import SpotifyClient


# Setup Client
sp_client = SpotifyClient()

# Initial auth
sp_client.auth.get_initial_tokens()

# Then to refresh the access token as required
sp_client.auth.refresh_access_token()

# Get a sample of saved tracks
sp_client.get_sample_saved_tracks()

About

DIY API Client for Spotify.

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages