Skip to main content

A Spotipy-compatible wrapper using SpotAPI

Project description

PyPI - Downloads Downloads

SpotipyFree

A lightweight drop-in replacement for Spotipy without using the spotify api. This project was build because spotify removed access to its API for non-premium users. This project doesn't use ANY Spotify APIs.


Features

  • Drop-in style response compatible with spotipy

  • No Spotify account required

  • Returns playback data structured like the official Spotify API


Current Status

This project is experimental.

Currently implemented:

  • search()
  • track()
  • playlist()
  • playlist_items()
  • artist()
  • artist_albums()
  • album()
  • album_tracks()
  • current_user_recently_played() - must first run startRecentlyPlayedListener
  • current_user_saved_tracks()
  • current_user_saved_tracks_contains()
  • current_user_playlists()
  • current_playback()
  • current_user()
  • me()
  • seek_track()
  • next_track()
  • previous_track()
  • start_playback()
  • pause_playback()

There is also a feature to host the api as a Flask endpoint.

Installation

Bash

pip install spotipyFree


Usage without login

from SpotipyFree import Spotify

sp = Spotify()

search = sp.search("Blinding Light - Weekend")
artist = sp.artist("3Bd1cgCjtCI32PYvDC3ynO")
artistAlbums = sp.artist_albums("3Bd1cgCjtCI32PYvDC3ynO", include_groups="album,single,compilation")
playlist = sp.playlist_items("6lnfkAgnVtNzvj8KScLSkj")
track = sp.track("67Hna13dNDkZvBpTXRIaOJ")
album = sp.album("4m2880jivSbbyEGAKfITCa")
albumTracks = sp.album_tracks("4m2880jivSbbyEGAKfITCa")

Usage with login

sp = Spotify()
sp.login()

status = spotapi.player.PlayerStatus(sp.user_auth)
sp.startRecentlyPlayedListener()
state = status.state.__dict__
saved = sp.current_user_saved_tracks()
me = sp.me()

Usage with web API

Hosting the web api:

python -c "import SpotipyFree.web as web; web.runWebAPI()"

Using the web api

import json
import requests

BASE_URL = "http://127.0.0.1:5000"

url = f"{BASE_URL}/search"
response = requests.post(url, json=["Blinding Light - Weekend"])

print(f"Status: {response.status_code}")
print(response.json())

This project is in no way affiliated with Spotify.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotipyfree-1.9.9.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spotipyfree-1.9.9-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file spotipyfree-1.9.9.tar.gz.

File metadata

  • Download URL: spotipyfree-1.9.9.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for spotipyfree-1.9.9.tar.gz
Algorithm Hash digest
SHA256 bf8ac5c89709b2f6cb645d3052175d3bfff3ac9e2a15f6bbc40a7702dfc7a548
MD5 a901564c3200368a81ab9520c5c28185
BLAKE2b-256 5b69aafc4538847a867c68193b744baefdb9cc11cfff7779d12a090e310afc03

See more details on using hashes here.

File details

Details for the file spotipyfree-1.9.9-py3-none-any.whl.

File metadata

  • Download URL: spotipyfree-1.9.9-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for spotipyfree-1.9.9-py3-none-any.whl
Algorithm Hash digest
SHA256 408d8e31ffbad5742414bf39473fc5783e2bb35f36e2d5063da2ecf8e91f4d94
MD5 80c7d9e5cd899b28a270f758a920f757
BLAKE2b-256 69f30d964207a0dc264fc83e6f823e6a46e30fa6d2334e34ff2cae7913dc1d5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page