Skip to main content

A SpotifyAPI Client that is straightforward and works easily

Project description

Spotify API Client

Rafa Carrasco

About

I decided to make this as a side project. If you have improvements on it, please feel free to make a pull request. I have only really worked the search endpoint and the artist endpoints. I need to work on the other endpoints as well.

Install using the following

</code></pre>
<h1><a href="#user-content-using-the-client" aria-hidden="true" class="anchor" id="user-content-using-the-client"></a>Using the client</h1>
<pre><code class="language-python">from spotify.spotify import SpotifyClient

Make sure you are registered on https://developer.spotify.com/

Once you register an app you should be able to see the client id and secret

api = SpotifyClient(client_id=YOUR_CLIENT_ID, client_secret=YOUR_CLIENT_SECRET)
# pass in the q, your query
# pass in the type of query: artist, album, playlist, podcast, etc
r = api.search(q="kanye west", limit=3, type='artist')
print(r)
{'artists': {'href': 'https://api.spotify.com/v1/search?query=kanye+west&type=artist&offset=0&limit=3', 'items': [{'external_urls': {'spotify': 'https://open.spotify.com/artist/5K4W6rqBFWDnAN6FQUkS6x'}, 'followers': {'href': None, 'total': 12825017}, 'genres': ['chicago rap', 'rap'], 'href': 'https://api.spotify.com/v1/artists/5K4W6rqBFWDnAN6FQUkS6x', 'id': '5K4W6rqBFWDnAN6FQUkS6x', 'images': [{'height': 640, 'url': 'https://i.scdn.co/image/bd1c6fdf3705cf9b7d0c8ac8e7bbed98e31a1559', 'width': 640}, {'height': 320, 'url': 'https://i.scdn.co/image/b1414e865a16bc0080085ee1901d0bfd19f83fcb', 'width': 320}, {'height': 160, 'url': 'https://i.scdn.co/image/ac5cb571c194ca5a942b8096618217839b901a76', 'width': 160}], 'name': 'Kanye West', 'popularity': 91, 'type': 'artist', 'uri': 'spotify:artist:5K4W6rqBFWDnAN6FQUkS6x'}, {'external_urls': {'spotify': 'https://open.spotify.com/artist/5xMcX1WiPEq5BMw0Xz42Z4'}, 'followers': {'href': None, 'total': 66}, 'genres': [], 'href': 'https://api.spotify.com/v1/artists/5xMcX1WiPEq5BMw0Xz42Z4', 'id': '5xMcX1WiPEq5BMw0Xz42Z4', 'images': [], 'name': 'Kanye West for KanMan Productions, Inc. and Krazy Kat Catalogue, Inc.', 'popularity': 15, 'type': 'artist', 'uri': 'spotify:artist:5xMcX1WiPEq5BMw0Xz42Z4'}, {'external_urls': {'spotify': 'https://open.spotify.com/artist/5wUrFJpvNRKTXfV7lqDo2a'}, 'followers': {'href': None, 'total': 27}, 'genres': [], 'href': 'https://api.spotify.com/v1/artists/5wUrFJpvNRKTXfV7lqDo2a', 'id': '5wUrFJpvNRKTXfV7lqDo2a', 'images': [], 'name': 'Kanye West prod. B.o.B', 'popularity': 4, 'type': 'artist', 'uri': 'spotify:artist:5wUrFJpvNRKTXfV7lqDo2a'}], 'limit': 3, 'next': 'https://api.spotify.com/v1/search?query=kanye+west&type=artist&offset=3&limit=3', 'offset': 0, 'previous': None, 'total': 13}}

Enjoy!

Needed Updates

  • Endpoints Needed

    • Albums
    • Browse
    • Episodes
    • Follow
    • Library
    • Personalization
    • Player
    • Playlists
    • Shows
    • Tracks
    • Users Profile
  • Data collection

    • Getting Formatted User Data

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

spotify-me-0.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

spotify_me-0.0.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file spotify-me-0.0.1.tar.gz.

File metadata

  • Download URL: spotify-me-0.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.0.post20201103 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.6.9

File hashes

Hashes for spotify-me-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5a34101d323cd1960cb4a5ad568652fc8837ff75e5711e8d1e93efdfdc0ea90b
MD5 bf93972b1601b5795ecf7c6b8cdd7a17
BLAKE2b-256 3648d7bab061ca9a04be608b1d5780efd52810cdc91c8c915d4290a0a6a49bbe

See more details on using hashes here.

File details

Details for the file spotify_me-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: spotify_me-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.0.post20201103 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.6.9

File hashes

Hashes for spotify_me-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb290d5b1c1961361a969298c3d630e3b32a0f44cd11528e1af1d9c676e151eb
MD5 fab19f0d5e63e65ca533363b2e628427
BLAKE2b-256 1869020cd2cee2a3eb30b69fa2f094e5b564a5fbf65435a46ff90d14d4eaf6b4

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