Socket
Socket
Sign inDemoInstall

spotify-api.py

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    spotify-api.py

A simple wrapper for spotify api written in python!


Maintainers
1

Readme

Spotify-Api.py

Simple wrapper for Spotify api written in python by the @spotify-api Organization!

Support

So, hey facing troubles? We have some ways you to support you!

Quick Docs

Client Class

Client class will be the main class to access other classes!

from spotifyapi import Client

client = Client(
  token='your-token'
)

Now as the Spotify Token Regenerates for every 5 minutes you can get a new token by Client ID and Client Secret!

# You can use set interval if u want

from spotifyapi import Client

client = Client(
  token='NO TOKEN' # Leave it like this
)

my_auth = client.oauth.get(
  client_id='your-id',
  client_secret='your-secret'
)

print(my_auth['access_token']) # Will print token. If you find errors, you can create an issue in Github repo

Track Class

Track class will let you to find, get and configure your search with tracks. You have to load client. Example given above

First define tracks if needed

track = client.track

# or

from spotifyapi.Track import Track
track = Track('some-token')

Functions

NameParamsExample
searchquery: str, limit: inttrack.search('some query', 5)
gettrackID: str, advanced: booltrack.get('some-id')
audio_featurestrackID: strtrack.audio_features('some-id')
audio_analysistrackID: strtrack.audio_analysis('some-id')

Artist Class

Artist class will let you to find, get and configure your search with artists. You have to load client. Example given above

First define artist if needed

artist = client.artist

# or

from spotifyapi.Artist import Artist
artist = Artist('some-token')

Functions

NameParamsExample
searchquery: str, limit: intartist.search('some query', 5)
getartistID: strartist.get('some-id')
albumsartistID: str, limit: intartist.albums('some-id',5)
top_tracksartistID: strartist.top_tracks('some-id')
related_artistsartistID: strartist.related_artists('some id')

Album Class

Album class will let you to find, get and configure your search with albums. You have to load client. Example given above

First define album if needed

artist = client.album

# or

from spotifyapi.Album import Album
artist = Album('some-token')

Functions

NameParamsExample
searchquery: str, limit: intalbum.search('some query', 5)
getalbumID: stralbum.get('some-id', 5)
get_tracksalbumID: str, limit: intalbum.get_tracks('some-id', 5)

User Class

Album class will let you to find, get and configure your search with users. You have to load client. Example given above

First define user if needed

user = client.user

# or

from spotifyapi.User import User
user = User('some-token')

Functions

NameParamsExample
getuserID: struser.get('some-id')

Playlist Class

Playlist class will let you get info and get the tracks inside a playlist. You have to load client. Example given above

First define playlist if needed

playlist = client.playlist

# or

from spotifyapi.Playlist import Playlist
playlist = Playlist('some-token')

Functions

NameParamsExample
getplaylistID: strplaylist.get('some-id')
tracksplaylistID: str, limit: intplaylist.tracks('some-id',5)

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc