[−][src]Crate aspotify
aspotify is an asynchronous client to the Spotify API.
Examples
use aspotify::{Client, ClientCredentials}; // This from_env function tries to read the CLIENT_ID and CLIENT_SECRET environment variables. // You can use the dotenv crate to read it from a file. let credentials = ClientCredentials::from_env() .expect("CLIENT_ID and CLIENT_SECRET not found."); // Create a Spotify client. let client = Client::new(credentials); // Gets the album "Favourite Worst Nightmare" from Spotify, with no specified market. let album = client.albums().get_album("1XkGORuUX2QGOEIL4EbJKm", None).await.unwrap();
Notes
- Spotify often imposes limits on endpoints, for example you can't get more than 50 tracks at once. This crate removes this limit by making multiple requests when necessary.
Re-exports
pub use endpoints::*; |
pub use model::*; |
Modules
endpoints | Endpoint types. |
model | The Spotify Object Model, in deserializable Rust structures. |
Structs
Client | A client to the Spotify API. |
ClientCredentials | An object that holds your Spotify Client ID and Client Secret. |
Response | The result of a request to a Spotify endpoint. |
Enums
CountryCode | Re-export from isocountry. |
LanguageCode | Re-export from isolanguage-1. |
RedirectedError | An error caused by the |
Scope | A scope that the user can grant access to. |
Functions
authorization_url | Get the URL to redirect the user's browser to so that the URL can be generated for the
|
authorization_url_with_state | Like |