| Crates.io | spotapi |
| lib.rs | spotapi |
| version | 0.1.0 |
| created_at | 2026-01-09 14:49:23.857998+00 |
| updated_at | 2026-01-09 14:49:23.857998+00 |
| description | A professional Rust crate for fetching Spotify playlist metadata and tracks without authentication handling. |
| homepage | |
| repository | https://github.com/spotapi/spotapi-rs |
| max_upload_size | |
| id | 2032207 |
| size | 70,039 |
A professional Rust crate that mimics the functionality of the Python SpotAPI package, specifically focused on fetching Spotify playlist metadata and tracks seamlessly handled via guest authentication.
Add this to your Cargo.toml:
[dependencies]
spotapi = "0.1.0"
Here is a simple example of how to fetch all tracks from a playlist:
use spotapi::PublicPlaylist;
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let playlist_url = "https://open.spotify.com/playlist/37i9dQZF1DX6ujZpAN0v9r";
let mut playlist = PublicPlaylist::new(playlist_url);
// Fetch all tracks (handles pagination automatically)
let tracks = playlist.get_tracks().await?;
println!("Fetched {} tracks.", tracks.len());
if let Some(first) = tracks.first() {
println!("First track data: {:?}", first);
}
Ok(())
}
This library is intended for educational purposes. It interacts with Spotify's private API. Use responsibly and in accordance with Spotify's terms of service.