Skip to main content

Spotify Loader

pip install llama-index-readers-spotify

This loader reads your Spotify account and loads saved albums, tracks, or playlists into Documents.

As a prerequisite, you will need to register with Spotify for Developers and create an app in order to get a client_id and a client_secret. You should then set a redirect_uri for the app (in the web dashboard under app settings). The redirect_uri does not need to be functional. You should then set the client_id, client_secret, and redirect_uri as environmental variables.

export SPOTIPY_CLIENT_ID='xxxxxxxxxxxxxxxxx'
export SPOTIPY_CLIENT_SECRET='xxxxxxxxxxxxxxxxxx'
export SPOTIPY_REDIRECT_URI='http://localhost:8080/redirect'

Usage

Here's an example usage of the SpotifyReader. It will retrieve your saved albums, unless an optional collection argument is passed. Acceptable arguments are "albums", "tracks", and "playlists".

from llama_index.readers.spotify import SpotifyReader

loader = SpotifyReader()
documents = loader.load_data()

Example

This loader is designed to be used as a way to load data into LlamaIndex.

LlamaIndex

from llama_index.core import VectorStoreIndex, download_loader

from llama_index.readers.spotify import SpotifyReader

loader = SpotifyReader()
documents = loader.load_data()
index = VectorStoreIndex.from_documents(documents)
index.query(
    "When are some other artists i might like based on what i listen to ?"
)

Download files

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

Source Distribution

llama_index_readers_spotify-0.6.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

llama_index_readers_spotify-0.6.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_spotify-0.6.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_spotify-0.6.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_readers_spotify-0.6.0.tar.gz
Algorithm Hash digest
SHA256 8429cc9ac5515286517ece42625c41a84f6158c35f5a787734e60888290c9c8d
MD5 7505a49616033798aa6e043ac77cb03e
BLAKE2b-256 e211207fa3ebf48145d3eda11c40c43203f26cfc31dc2be9d8ba2d981b1d2dcf

See more details on using hashes here.

File details

Details for the file llama_index_readers_spotify-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_readers_spotify-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_readers_spotify-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 161a43412af67e7fff4274fb34b0117b98c8c33da02a717d11dfe0a0b1faedb4
MD5 73f32231f4483648956585cb68369fb7
BLAKE2b-256 1ab1391302944286e824c9b99d90aa3f1f734def79e86595906dc48e4b247f23

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page