tsirysndr / spotify-rs

Rust library for accessing the Spotify API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spotify-rs

License: BSD Twitter: tsiry_sndr

spotify-rs is a Rust client library for accessing the Spotify API

Install

[dependencies]
spotify-rs = { git = "https://github.com/tsirysndr/spotify-rs" }

Usage

Construct a new Spotify client, then use the various services on the client to access different parts of the Spotify API. For example:

use spotify_rs::Spotify;

#[tokio::main]
async fn main() {
  const ACCESS_TOKEN: &str = "<YOUR ACCESS TOKEN>";
  let client = Spotify::new(ACCESS_TOKEN);
  let album = client.album.get("382ObEPsp2rxGrnsizN5TX").await;
  let results = client.search.get("Muse", "track,artist", 50, 0).await;
  println!("{:#?}\n", album);
  println!("{:#?}\n", results);
}

Author

👤 Tsiry Sandratraina

Show your support

Give a ⭐️ if this project helped you!

About

Rust library for accessing the Spotify API

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Rust 100.0%