[][src]Crate aspotify

aspotify is an asynchronous client to the Spotify API. It is similar to rspotify, but is asynchronous and has a very different 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();

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. An enumeration of all ISO-3166-1 country codes

LanguageCode

Re-export from isolanguage-1. An enumeration of all ISO 639-1 language codes.

RedirectedError

An error caused by the client::redirected function.

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 Client::redirected function.