# Spotify Web API > You can use Spotify's Web API to discover music and podcasts, manage your Spotify library, control audio playback, and much more. Browse our available Web API endpoints using the sidebar at left, or via the navigation bar on top of this page on smaller screens. In order to make successful Web API requests your app will need a valid access token. One can be obtained through OAuth 2.0. The base URI for all Web API requests is `https://api.spotify.com/v1`. Need help? See our Web API guides for more information, or visit the Spotify for Developers community forum to ask questions and connect with other developers. Authentication - **OAuth 2 Authorization Code Grant**: - OAuthClientId: OAuth 2 Client ID - OAuthClientSecret: OAuth 2 Client Secret - OAuthRedirectUri: OAuth 2 Redirection endpoint or Callback Uri - OAuthToken: Object for storing information about the OAuth token - OAuthScopes: List of scopes that apply to the OAuth token # Overview Retrieve metadata from Spotify content, control playback or get recommendations Spotify Web API enables the creation of applications that can interact with Spotify's streaming service, such as retrieving content metadata, getting recommendations, creating and managing playlists, or controlling playback. ## Getting Started This is where the magic begins! The following steps will help you to get started with your journey towards creating some awesome music apps using the API: - Log into the [dashboard](https://developer.spotify.com/dashboard) using your Spotify account. - [Create an app](page:concepts/apps) and select "Web API" for the question asking which APIs are you planning to use. Once you have created your app, you will have access to the app credentials. These will be required for API [authorization](page:concepts/authorization) to obtain an [access token](page:concepts/access-token). - Use the [access token](page:concepts/access-token) in your [API requests](page:concepts/api-calls). - You can follow the [Getting started](page:overview/getting-started) tutorial to learn how to make your first Web API call. ## Documentation The documentation is organized as follows: - Concepts that clarify key topics - Tutorials, which serve as an introduction to important topics when using Web API - How-Tos, step-by-step guides that cover practical tasks or use cases - Reference, the API specification ## API Reference The Spotify Web API provides a wide range of functionality for developers, including: - Retrieve data from your favourite artist, album or show. - Search for Spotify content. - Control and interact with the playback, play and resume, Seek to a position or retrieve your queue. - Manage your personal library, by creating a new playlist and adding your favourite tracks to it. - Get recommendations based on the music you listen the most. And much more! You can find a complete list of available endpoints in the [API Reference]($e/Albums/get-an-album). ## Support If you have any questions or run into any issues while using the Spotify Web API, you can find help in the [Spotify Developer Community](https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer). Here, you can connect and get help from other developers. ## Legal By using Spotify Web API, you accept the [Spotify Developer Terms of Service](https://developer.spotify.com/terms). # Getting Started with the Web API This tutorial will help you to make your first Web API call by retriving an artist's metadata. The steps to do so are the following: 1. Create an app, if you haven't done so. 2. Request an access token. 3. Use the access token to request the artist data. 4. Here we go, let's rock & roll! ## Prerequisites - This tutorial assumes you have a Spotify account (free or premium). - We will use cURL to make API calls. You can install it from [here](https://curl.se/download.html) our using the package manager of your choice. ## Set Up Your Account Login to the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard). If necessary, read the latest [Developer Terms of Service](https://developer.spotify.com/terms) to complete your account set up. ## Create an app An app provides the Client ID and Client Secret needed to request an access token by implementing any of the [authorization](page:concepts/authorization) flows. To create an app, go to [your Dashboard](https://developer.spotify.com/dashboard), click on the Create an app button and enter the following information: - App Name: My App - App Description: This is my first Spotify app - Redirect URI: You won't need this parameter in this example, so let's use http://localhost:3000. Finally, check the Developer Terms of Service checkbox and tap on the Create button. ## Request an access token The access token is a string which contains the credentials and permissions that can be used to access a given resource (e.g artists, albums or tracks) or user's data (e.g your profile or your playlists). In order to request the access token you need to get your Client_ID and Client Secret: 1. Go to the [Dashboard](https://developer.spotify.com/dashboard) 2. Click on the name of the app you have just created (My App) 3. Click on the Settings button The Client ID can be found here. The Client Secret can be found behind the View client secret link. With our credentials in hand, we are ready to request an access token. This tutorial uses the Client Credentials, so we must: - Send a POST request to the token endpoint URI. - Add the Content-Type header set to the application/x-www-form-urlencoded value. - Add a HTTP body containing the Client ID and Client Secret, along with the grant_type parameter set to client_credentials. ```bash curl -X POST "https://accounts.spotify.com/api/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials&client_id=your-client-id&client_secret=your-client-secret" ``` The response will return an access token valid for 1 hour: ```bash { "access_token": "BQDBKJ5eo5jxbtpWjVOj7ryS84khybFpP_lTqzV7uV-T_m0cTfwvdn5BnBSKPxKgEb11", "token_type": "Bearer", "expires_in": 3600 } ``` ## Request artist data For this example, we will use the Get Artist endpoint to request information about an artist. According to the API Reference, the endpoint needs the Spotify ID of the artist. An easy way to get the Spotify ID of an artist is using the Spotify Desktop App: 1. Search the artist 2. Click on the three dots icon from the artist profile 3. Select Share > Copy link to artist. The Spotify ID is the value that comes right after the open.spotify.com/artist URI. Our API call must include the access token we have just generated using the Authorization header as follows: ```bash curl "https://api.spotify.com/v1/artists/4Z8W4fKeB5YxbusRsdQVPb" \ -H "Authorization: Bearer BQDBKJ5eo5jxbtpWjVOj7ryS84khybFpP_lTqzV7uV-T_m0cTfwvdn5BnBSKPxKgEb11" ``` If everything goes well, the API will return the following JSON response: ```bash { "external_urls": { "spotify": "https://open.spotify.com/artist/4Z8W4fKeB5YxbusRsdQVPb" }, "followers": { "href": null, "total": 7625607 }, "genres": [ "alternative rock", "art rock", "melancholia", "oxford indie", "permanent wave", "rock" ], "href": "https://api.spotify.com/v1/artists/4Z8W4fKeB5YxbusRsdQVPb", "id": "4Z8W4fKeB5YxbusRsdQVPb", "images": [ { "height": 640, "url": "https://i.scdn.co/image/ab6761610000e5eba03696716c9ee605006047fd", "width": 640 }, { "height": 320, "url": "https://i.scdn.co/image/ab67616100005174a03696716c9ee605006047fd", "width": 320 }, { "height": 160, "url": "https://i.scdn.co/image/ab6761610000f178a03696716c9ee605006047fd", "width": 160 } ], "name": "Radiohead", "popularity": 79, "type": "artist", "uri": "spotify:artist:4Z8W4fKeB5YxbusRsdQVPb" } ``` Congratulations! You made your first API call to the Spotify Web API. ## Summary The Spotify Web API provides different endpoints depending on the data we want to access. The API calls must include the Authorization header along with a valid access token. This tutorial makes use of the client credentials grant type to retrieve the access token. That works fine in scenarios where you control the API call to Spotify, for example where your backend is connecting to the Web API. It will not work in cases where your app will connect on behalf of a specific user, for example when getting private playlist or profile data. ## What's next? - The tutorial used the Spotify Desktop App to retrieve the Spotify ID of the artist. The ID can also be retrieved using the Search endpoint. An interesting exercise would be to extend the example with a new API call to the /search endpoint. Do you accept the challenge? - The authorization guide provides detailed information about which authorization flow suits you best. Make sure you read it first! - You can continue your journey by reading the API calls guide which describes in detail the Web API request and responses. - Finally, if you are looking for a more practical documentation, you can follow the Display your Spotify Profile Data in a Web App how-to which implements a step-by-step web application using authorization code flow to request the access token. # Access Token The access token is a string which contains the credentials and permissions that can be used to access a given resource (e.g artists, albums or tracks) or user's data (e.g your profile or your playlists). To use the access token you must include the following header in your API calls: | Header Parameter | Value | |---|---| | Authorization | Valid access token following the format: Bearer | Note that the access token is valid for 1 hour (3600 seconds). After that time, the token expires and you need to request a new one. ## Examples The following example uses cURL to retrieve information about a track using the Get a track endpoint: ```bash curl --request GET \ 'https://api.spotify.com/v1/tracks/2TpxZ7JUBn3uw46aR7qd6V' \ --header "Authorization: Bearer NgCXRK...MzYjw" ``` The following code implements the getProfile() function which performs the API call to the Get Current User's Profile endpoint to retrieve the user profile related information: ```javascript async function getProfile(accessToken) { let accessToken = localStorage.getItem('access_token'); const response = await fetch('https://api.spotify.com/v1/me', { headers: { Authorization: 'Bearer ' + accessToken } }); const data = await response.json(); } ``` # API calls The Spotify Web API is a restful API with different endpoints which return JSON metadata about music artists, albums, and tracks, directly from the Spotify Data Catalogue. ## Base URL The base address of Web API is `https://api.spotify.com`. ## Authorization All requests to Spotify Web API require authorization. Make sure you have read the [authorization](page:concepts/authorization) guide to understand the basics. To access private data through the Web API, such as user profiles and playlists, an application must get the user’s permission to access the data. ## Requests Data resources are accessed via standard HTTP requests in UTF-8 format to an API endpoint. The Web API uses the following HTTP verbs: | Method | Action | | ------ | ------------------------------------------------ | | GET | Retrieves resources | | POST | Creates resources | | PUT | Changes and/or replaces resources or collections | | DELETE | Deletes resources | ## Responses Web API normally returns JSON in the response body. Some endpoints (e.g [Change Playlist Details]($e/Playlists/change-playlist-details)) don't return JSON but the HTTP status code ### Response Status Codes Web API uses the following response status codes, as defined in the [RFC 2616](https://www.ietf.org/rfc/rfc2616.txt) and [RFC 6585](https://www.ietf.org/rfc/rfc6585.txt): | Status Code | Description | | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 200 | OK - The request has succeeded. The client can read the result of the request in the body and the headers of the response. | | 201 | Created - The request has been fulfilled and resulted in a new resource being created. | | 202 | Accepted - The request has been accepted for processing, but the processing has not been completed. | | 204 | No Content - The request has succeeded but returns no message body. | | 304 | Not Modified. [See Conditional requests](page:concepts/api-calls#conditional-requests). | | 400 | Bad Request - The request could not be understood by the server due to malformed syntax. The message body will contain more information. | | 401 | Unauthorized - The request requires user authentication or, if the request included authorization credentials, authorization has been refused for those credentials. | | 403 | Forbidden - The server understood the request, but is refusing to fulfill it. | | 404 | Not Found - The requested resource could not be found. This error can be due to a temporary or permanent condition. | | 429 | Too Many Requests - Rate limiting has been applied. | | 500 | Internal Server Error. You should never receive this error because our clever coders catch them all ... but if you are unlucky enough to get one, please report it to us through a comment at the bottom of this page. | | 502 | Bad Gateway - The server was acting as a gateway or proxy and received an invalid response from the upstream server. | | 503 | Service Unavailable - The server is currently unable to handle the request due to a temporary condition which will be alleviated after some delay. You can choose to resend the request again. | #### Response Error Web API uses two different formats to describe an error: - Authentication Error Object - Regular Error Object ### Authentication Error Object Whenever the application makes requests related to authentication or authorization to Web API, such as retrieving an access token or refreshing an access token, the error response follows [RFC 6749](https://tools.ietf.org/html/rfc6749) on the OAuth 2.0 Authorization Framework. | Key | Value Type | Value Description | | ----------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | error | string | A high level description of the error as specified in [RFC 6749 Section 5.2.](https://tools.ietf.org/html/rfc6749#section-5.2) | | error_description | string | A more detailed description of the error as specified in [RFC 6749 Section 4.1.2.1.](https://tools.ietf.org/html/rfc6749#section-4.1.2.1) | Here is an example of a failing request to refresh an access token. ```bash $ curl -H "Authorization: Basic Yjc...cK" -d grant_type=refresh_token -d refresh_token=AQD...f0 "https://accounts.spotify.com/api/token" { "error": "invalid_client", "error_description": "Invalid client secret" } ``` ### Regular Error Object Apart from the response code, unsuccessful responses return a JSON object containing the following information: | Key | Value Type | Value Description | | ------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | status | integer | The HTTP status code that is also returned in the response header. For further information, see [Response Status Codes](page:concepts/api-calls#response-status-codes). | | message | string | A short description of the cause of the error. | Here, for example is the error that occurs when trying to fetch information for a non-existent track: ```bash $ curl -i "https://api.spotify.com/v1/tracks/2KrxsD86ARO5beq7Q0Drfqa" HTTP/1.1 400 Bad Request { "error": { "status": 400, "message": "invalid id" } } ``` ## Conditional Requests Most API responses contain appropriate cache-control headers set to assist in client-side caching: - If you have cached a response, do not request it again until the response has expired. - If the response contains an ETag, set the If-None-Match request header to the ETag value. - If the response has not changed, the Spotify service responds quickly with **304 Not Modified** status, meaning that your cached version is still good and your application should use it. ## Timestamps Timestamps are returned in [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) format as [Coordinated Universal Time (UTC)](https://en.wikipedia.org/wiki/UTC_offset) with a zero offset: YYYY-MM-DDTHH:MM:SSZ. If the time is imprecise (for example, the date/time of an album release), an additional field indicates the precision; see for example, release_date in an [Album Object]($m/AlbumObject). ## Pagination Some endpoints support a way of paging the dataset, taking an offset and limit as query parameters: ```bash $ curl https://api.spotify.com/v1/artists/1vCWHaC5f2uS3yhpwWbIA6/albums?album_type=SINGLE&offset=20&limit=10 ``` In this example, in a list of 50 (total) singles by the specified artist : From the twentieth (offset) single, retrieve the next 10 (limit) singles. # Apps The app provides, among others, the Client ID and Client Secret needed to implement any of the authorization flows. To do so, go to your [Dashboard](https://developer.spotify.com/dashboard) and click on the Create an App button to open the following dialog box: ![Create App](static/images/concepts/apps/createappdialog.png) Enter an *App Name* and *App Description* of your choice (they will be displayed to the user on the grant screen), put a tick in the *Developer Terms of Service checkbox* and finally click on *CREATE*. Your application is now registered, and you'll be redirected to the app overview page. ![App Overview](static/images/concepts/apps/app_overview.png) The app overview page provides access to different elements: - App metrics, such as daily and monthly active users or number of users per country. Note that the metrics are initially empty. - App Status. By default, your app will be in Development Mode with limits on the number of users who can install it, and the number of API requests it can make. Note that you can request an extension of this quota if needed by clicking on the Request Extension link. - App settings. - Client ID, the unique identifier of your app. - Client Secret, the key you will use to authorize your Web API or SDK calls. > Always store the client secret key securely; never reveal it publicly! If you suspect that the secret key has been compromised, regenerate it immediately by clicking the ROTATE button on the app overview page. It is time to configure our app. Click on Edit Settings to view and update your app settings. The following dialog will show up: ![Dashboard Settings](static/images/concepts/apps/dashboardeditsettings.png) - Add a web domain or URL to the Website field. This will help users to obtain more information about your application. - In Redirect URIs enter one or more addresses that you want to allowlist with Spotify. This URI enables the Spotify authentication service to automatically invoke your app every time the user logs in (e.g. [http://localhost:8080](http://localhost:8080)) Note that on iOS apps, the redirect URI must follow these rules: - All the characters are lowercase. - The prefix must be unique to your application (It cannot be a general prefix like http). - The prefix must only be used by your application for authenticating Spotify. If you already have a URL scheme handled by your application for other uses, do not reuse it. - Include a path after the first pair of forward slashes. For example: If your app name is My Awesome App, a good candidate for the redirect URI could be my-awesome-app-login://callback. - If you are developing an Android or iOS app, fill out the Android Package or Bundle IDs respectively. Once you have finished updating the app settings, click on SAVE. Finally, you can delete your app by clicking on the DELETE red button. # Authorization Authorization refers to the process of granting a user or application access permissions to Spotify data and features (e.g your application needs permission from a user to access their playlists). Spotify implements the [OAuth 2.0](https://datatracker.ietf.org/doc/html/rfc6749) authorization framework: ![Auth Intro](static/images/concepts/authorization/auth_intro.png) Where: - End User corresponds to the Spotify user. The End User grants access to the protected resources (e.g. playlists, personal information, etc.) - My App is the client that requests access to the protected resources (e.g. a mobile or web app). - Server which hosts the protected resources and provides authentication and authorization via OAuth 2.0. The access to the protected resources is determined by one or several scopes. Scopes enable your application to access specific functionality (e.g. read a playlist, modify your library or just streaming) on behalf of a user. The set of scopes you set during the authorization, determines the access permissions that the user is asked to grant. You can find detailed information about scopes in the [scopes documentation](page:concepts/scopes). The authorization process requires valid client credentials: a client ID and a client secret. You can follow the [Apps guide](page:concepts/apps) to learn how to generate them. Once the authorization is granted, the authorization server issues an access token, which is used to make API calls on behalf the user or application. # Scopes Scopes provide Spotify users using third-party apps the confidence that only the information they choose to share will be shared, and nothing more. ## Pre-requisites Scopes are needed when implementing some of the [authorization](page:concepts/authorization) grant types. Make sure you have read the Authorization guide to understand the basics. ## List of Scopes - Images - [ugc-image-upload](page:concepts/scopes#ugc-image-upload) - Spotify Connect - [user-read-playback-state](page:concepts/scopes#user-read-playback-state) - [user-modify-playback-state](page:concepts/scopes#user-modify-playback-state) - [user-read-currently-playing](page:concepts/scopes#user-read-currently-playing) - Playback - [app-remote-control](page:concepts/scopes#app-remote-control) - [streaming](page:concepts/scopes#streaming) - Playlists - [playlist-read-private](page:concepts/scopes#playlist-read-private) - [playlist-read-collaborative](page:concepts/scopes#playlist-read-collaborative) - [playlist-modify-private](page:concepts/scopes#playlist-modify-private) - [playlist-modify-public](page:concepts/scopes#playlist-modify-public) - Follow - [user-follow-modify](page:concepts/scopes#user-follow-modify) - [user-follow-read](page:concepts/scopes#user-follow-read) - Listening History - [user-read-playback-position](page:concepts/scopes#user-read-playback-position) - [user-top-read](page:concepts/scopes#user-top-read) - [user-read-recently-played](page:concepts/scopes#user-read-recently-played) - Library - [user-library-modify](page:concepts/scopes#user-library-modify) - [user-library-read](page:concepts/scopes#user-library-read) - Users - [user-read-email](page:concepts/scopes#user-read-email) - [user-read-private](page:concepts/scopes#user-read-private) - Open Access - [user-soa-link](page:concepts/scopes#user-soa-link) - [user-soa-unlink](page:concepts/scopes#user-soa-unlink) - [soa-manage-entitlements](page:concepts/scopes#soa-manage-entitlements) - [soa-manage-partner](page:concepts/scopes#soa-manage-partner) - [soa-create-partner](page:concepts/scopes#soa-create-partner) ## ugc-image-upload | Description | Write access to user-provided images. | | Visible to users | Upload images to Spotify on your behalf. | ## user-read-playback-state | Description | Read access to a user’s player state. | | Visible to users | Read your currently playing content and Spotify Connect devices information. | ## user-modify-playback-state | Description | Write access to a user’s playback state | | Visible to users | Control playback on your Spotify clients and Spotify Connect devices. | ## user-read-currently-playing | Description | Read access to a user’s currently playing content. | | Visible to users | Read your currently playing content. | ## app-remote-control | Description |Remote control playback of Spotify. This scope is currently available to Spotify iOS and Android SDKs. | | Visible to users | Communicate with the Spotify app on your device. | ## streaming | Description | Control playback of a Spotify track. This scope is currently available to the Web Playback SDK. The user must have a Spotify Premium account. | | Visible to users | Play content and control playback on your other devices. | ## playlist-read-private | Description | Read access to user's private playlists. | | Visible to users | Access your private playlists. | ## playlist-read-collaborative | Description | Include collaborative playlists when requesting a user's playlists. | | Visible to users | Access your collaborative playlists. | ## playlist-modify-private | Description | Write access to a user's private playlists. | | Visible to users | Manage your private playlists. ## playlist-modify-public | Description | Write access to a user's public playlists.| | Visible to users | Manage your public playlists.| ## user-follow-modify | Description | Write/delete access to the list of artists and other users that the user follows. | | Visible to users | Manage who you are following. | ## user-follow-read | Description | Read access to the list of artists and other users that the user follows. | | Visible to users | Access your followers and who you are following. | ## user-read-playback-position | Description | Read access to a user’s playback position in a content. | | Visible to users | Read your position in content you have played. | ## user-top-read | Description | Read access to a user's top artists and tracks. | | Visible to users | Read your top artists and content. | ## user-read-recently-played | Description | Read access to a user’s recently played tracks. | | Visible to users | Access your recently played items. | ## user-library-modify | Description | Write/delete access to a user's "Your Music" library. | | Visible to users | Manage your saved content. | ## user-library-read | Description | Read access to a user's library. | | Visible to users | Access your saved content. | ## user-read-email | Description | Read access to user’s email address. | | Visible to users | Get your real email address. | ## user-read-private | Description | Read access to user’s subscription details (type of user account). | | Visible to users | Access your subscription details. | ## user-soa-link | Description | Link a partner user account to a Spotify user account | ## user-soa-unlink | Description | Unlink a partner user account from a Spotify account | ## soa-manage-entitlements | Description | Modify entitlements for linked users | ## soa-manage-partner | Description | Update partner information | ## soa-create-partner | Description | Create new partners, platform partners only | # Spotify URIs and IDs In requests to the Web API and responses from it, you will frequently encounter the following parameters: ## Spotify URI The resource identifier of, for example, an artist, album or track. This can be entered in the search box in a Spotify Desktop Client, to navigate to that resource. To find a Spotify URI, right-click (on Windows) or Ctrl-Click (on a Mac) on the artist, album or track name. Example: `spotify:track:6rqhFgbbKwnb9MLmUQDhG6` ## Spotify ID The base-62 identifier found at the end of the Spotify URI (see above) for an artist, track, album, playlist, etc. Unlike a Spotify URI, a Spotify ID does not clearly identify the type of resource; that information is provided elsewhere in the call. Example: `6rqhFgbbKwnb9MLmUQDhG6` ## Spotify category ID The unique string identifying the Spotify category. Example: `party` ## Spotify user ID The unique string identifying the Spotify user that you can find at the end of the Spotify URI for the user. The ID of the current user can be obtained via the [Get Current User's Profile endpoint]($e/Users/get-current-users-profile). Example: `wizzler` ## Spotify URL When visited, if the user has the Spotify client installed, it will launch the Client and navigate to the requested resource. Which client is determined by the user's device and account settings at [play.spotify.com](page:play.spotify.com). Example: `http://open.spotify.com/track/6rqhFgbbKwnb9MLmUQDhG6` # Authorization Code Flow The authorization code flow is suitable for long-running applications (e.g. web and mobile apps) where the user grants permission only once. If you’re using the authorization code flow in a mobile app, or any other type of application where the client secret can't be safely stored, then you should use the PKCE extension. Keep reading to learn how to correctly implement it. The following diagram shows how the authorization code flow works: ![Authorization Code Flow](static/images/tutorials/authorization-code/auth-code-flow.png) ## Pre-requisites This guide assumes that: - You have read the [authorization guide](page:concepts/authorization). - You have created an app following the [apps guide](page:concepts/apps). ### Example You can find an example app implementing Authorization Code flow on GitHub in the [web-api-examples](https://github.com/spotify/web-api-examples/tree/master/authorization/authorization_code) repository. ## Request User Authorization The first step is to request authorization from the user so that our app can access to the Spotify resources on the user's behalf. To do this, our application must build and send a GET request to the /authorize endpoint with the following parameters: | Query Parameter | Relevance | Value | | client_id | Required | The Client ID generated after registering your application. | | response_type | Required | Set to code. | | redirect_uri | Required | The URI to redirect to after the user grants or denies permission. This URI needs to have been entered in the Redirect URI allowlist that you specified when you registered your application (See the [app guide](page:concepts/apps)). The value of redirect_uri here must exactly match one of the values you entered when you registered your application, including upper or lowercase, terminating slashes, and such. | | state | Optional, but strongly recommended| This provides protection against attacks such as cross-site request forgery. See [RFC-6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1). | | scope | Optional | A space-separated list of [scopes](page:concepts/scopes).If no scopes are specified, authorization will be granted only to access publicly available information: that is, only information normally visible in the Spotify desktop, web, and mobile players. | | show_dialog | Optional | Whether or not to force the user to approve the app again if they’ve already done so. If false (default), a user who has already approved the application may be automatically redirected to the URI specified by redirect_uri. If true, the user will not be automatically redirected and will have to approve the app again. | The following JavaScript code example implements the /login method using [Express](page:Express) framework to initiates the authorization request: ```javascript var client_id = "CLIENT_ID"; var redirect_uri = "http://localhost:8888/callback"; var app = express(); app.get("/login", function (req, res) { var state = generateRandomString(16); var scope = "user-read-private user-read-email"; res.redirect( "https://accounts.spotify.com/authorize?" + querystring.stringify({ response_type: "code", client_id: client_id, scope: scope, redirect_uri: redirect_uri, state: state, }) ); }); ``` Once the request is processed, the user will see the authorization dialog asking to authorize access within the user-read-private and user-read-email scopes. The Spotify OAuth 2.0 service presents details of the [scopes](page:concepts/scopes) for which access is being sought. If the user is not logged in, they are prompted to do so using their Spotify credentials. When the user is logged in, they are asked to authorize access to the data sets or features defined in the scopes. Finally, the user is redirected back to your specified `redirect_uri`. After the user accepts, or denies your request, the Spotify OAuth 2.0 service redirects the user back to your `redirect_uri`. In this example, the redirect address is `https://localhost:8888/callback` ### Response for Request User Authorization If the user accepts your request, then the user is redirected back to the application using the redirect_uri passed on the authorized request described above. The callback contains two query parameters: | Query Parameter | Value | | --------------- | ---------------------------------------------------------------- | | code | An authorization code that can be exchanged for an access token. | | state | The value of the state parameter supplied in the request. | For example: ```bash https://my-domain.com/callback?code=NApCCg..BkWtQ&state=34fFs29kd09 ``` If the user does not accept your request or if an error has occurred, the response query string contains the following parameters: | Query Parameter | Value | | --------------- | ------------------------------------------------------------- | | error | The reason authorization failed, for example: "access_denied" | | state | The value of the state parameter supplied in the request. | For example: ```bash https://my-domain.com/callback?error=access_denied&state=34fFs29kd09 ``` In both cases, your app should compare the state parameter that it received in the redirection URI with the state parameter it originally provided to Spotify in the authorization URI. If there is a mismatch then your app should reject the request and stop the authentication flow. ## Request an Access Token If the user accepted your request, then your app is ready to exchange the authorization code for an access token. It can do this by sending a POST request to the /api/token endpoint. The body of this POST request must contain the following parameters encoded in application/x-www-form-urlencoded: | Body Parameters | Relevance | Value | | --------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | grant_type | Required | This field must contain the value "authorization_code". | | code | Required | The authorization code returned from the previous request. | | redirect_uri | Required | This parameter is used for validation only (there is no actual redirection). The value of this parameter must exactly match the value of redirect_uri supplied when requesting the authorization code. | The request must include the following HTTP headers: | Header Parameter | Relevance | Value | | ---------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Authorization | Required | Base 64 encoded string that contains the client ID and client secret key. The field must have the format: Authorization: Basic | | Content-Type | Required | Set to application/x-www-form-urlencoded. | This step is usually implemented within the callback described on the request of the previous steps: ```javascript app.get("/callback", function (req, res) { var code = req.query.code || null; var state = req.query.state || null; if (state === null) { res.redirect( "/#" + querystring.stringify({ error: "state_mismatch", }) ); } else { var authOptions = { url: "https://accounts.spotify.com/api/token", form: { code: code, redirect_uri: redirect_uri, grant_type: "authorization_code", }, headers: { "content-type": "application/x-www-form-urlencoded", Authorization: "Basic " + new Buffer.from(client_id + ":" + client_secret).toString("base64"), }, json: true, }; } }); ``` ### Response for Request an Access Token On success, the response will have a 200 OK status and the following JSON data in the response body: | key | Type | Description | | ------------- | ------ | -------------------------------------------------------------------------------------------------- | | access_token | string | An access token that can be provided in subsequent calls, for example to Spotify Web API services. | | token_type | string | How the access token may be used: always "Bearer". | | scope | string | A space-separated list of scopes which have been granted for this access_token | | expires_in | int | The time period (in seconds) for which the access token is valid. | | refresh_token | string | See [refreshing tokens](page:concepts/scopes). | ## What's next? - Congratulations! Your fresh access token is ready to be used! How can we make API calls with it? take a look at to the access token guide to learn how to make an API call using your new fresh [access token](page:concepts/access-token). - If your access token has expired, you can learn how to issue a new one without requiring users to reauthorize your application by reading the [refresh token guide](page:tutorials/refreshing-tokens). # Refreshing Tokens A refresh token is a security credential that allows client applications to obtain new access tokens without requiring users to reauthorize the application. [Access tokens](page:concepts/access-token) are intentionally configured to have a limited lifespan (1 hour), at the end of which, new tokens can be obtained by providing the original refresh token acquired during the authorization token request response: ```json { "access_token": "NgCXRK...MzYjw", "token_type": "Bearer", "scope": "user-read-private user-read-email", "expires_in": 3600, "refresh_token": "NgAagA...Um_SHo" } ``` ## Request To refresh an access token, we must send a POST request with the following parameters: | Body Parameter | Relevance | Value | | -------------- | ------------------------------------ | ------------------------------------------------------------------- | | grant_type | Required | Set it to refresh_token. | | refresh_token | Required | The refresh token returned from the authorization token request. | | client_id | Only required for the PKCE extension | The client ID for your app, available from the developer dashboard. | And the following headers: | Header Parameter | Relevance | Value | | ------------------ | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Content-Type | Required | Always set to application/x-www-form-urlencoded. | | Authorization Only | required for the Authorization Code | Base 64 encoded string that contains the client ID and client secret key. The field must have the format: `Authorization: Basic ` ### Example The following code snippets represent two examples: - A client side (browser) JavaScript function to refresh tokens issued following the Authorization Code with PKCE extension flow. - A server side (nodeJS with express) Javascript method to refresh tokens issued under the Authorization Code flow. #### Javascript ```javascript const getRefreshToken = async () => { // refresh token that has been previously stored const refreshToken = localStorage.getItem('refresh_token'); const url = "https://accounts.spotify.com/api/token"; const payload = { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ grant_type: 'refresh_token', refresh_token: refreshToken, client_id: clientId }), } const body = await fetch(url, payload); const response await body.json(); localStorage.setItem('access_token', response.accessToken); localStorage.setItem('refresh_token', response.refreshToken); } ``` #### NodeJS ```javascript app.get("/refresh_token", function (req, res) { var refresh_token = req.query.refresh_token; var authOptions = { url: "https://accounts.spotify.com/api/token", headers: { "content-type": "application/x-www-form-urlencoded", Authorization: "Basic " + new Buffer.from(client_id + ":" + client_secret).toString("base64"), }, form: { grant_type: "refresh_token", refresh_token: refresh_token, }, json: true, }; request.post(authOptions, function (error, response, body) { if (!error && response.statusCode === 200) { var access_token = body.access_token, refresh_token = body.refresh_token; res.send({ access_token: access_token, refresh_token: refresh_token, }); } }); }); ``` ### Response If everything goes well, you'll receive a 200 OK response which is very similar to the response when issuing an access token: ```json { "access_token": "BQBLuPRYBQ...BP8stIv5xr-Iwaf4l8eg", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "AQAQfyEFmJJuCvAFh...cG_m-2KTgNDaDMQqjrOa3", "scope": "user-read-email user-read-private" } ``` The refresh token contained in the response, could be used to issue new refresh tokens. # Setting Up SDKs ## Introduction You can use Spotify's Web API to discover music and podcasts, manage your Spotify library, control audio playback, and much more. Browse our available Web API endpoints using the sidebar at left, or via the navigation bar on top of this page on smaller screens. In order to make successful Web API requests your app will need a valid access token. One can be obtained through OAuth 2.0. The base URI for all Web API requests is `https://api.spotify.com/v1`. Need help? See our Web API guides for more information, or visit the Spotify for Developers community forum to ask questions and connect with other developers. ## Install the Package If you are building with .NET CLI tools then you can also use the following command: ```bash dotnet add package SpotifyApiSDK --version 1.0.0 ``` You can also view the package at: https://www.nuget.org/packages/SpotifyApiSDK/1.0.0 ## Initialize the API Client The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | | Environment | `Environment` | The API environment.
**Default: `Environment.Production`** | | Timeout | `TimeSpan` | Http client timeout.
*Default*: `TimeSpan.FromSeconds(100)` | | HttpClientConfiguration | `Action` | Action delegate that configures the HTTP client by using the HttpClientConfiguration.Builder for customizing API call settings.
*Default*: `new HttpClient()` | | AuthorizationCodeAuth | [`AuthorizationCodeAuth`]($h/__auth_AuthorizationCodeAuth) | The Credentials Setter for OAuth 2 Authorization Code Grant | The API client can be initialized as follows: ```csharp SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.AppRemoteControl, OAuthScopeEnum.PlaylistReadPrivate, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); ``` ## Authorization This API uses the following authentication schemes. * [`oauth_2_0 (OAuth 2 Authorization Code Grant)`]($h/__auth_AuthorizationCodeAuth) ### oauth_2_0 (OAuth 2 Authorization Code Grant) Documentation for accessing and setting credentials for oauth_2_0. #### Auth Credentials | Name | Type | Description | Setter | Getter | | --- | --- | --- | --- | --- | | OAuthClientId | `string` | OAuth 2 Client ID | `OAuthClientId` | `OAuthClientId` | | OAuthClientSecret | `string` | OAuth 2 Client Secret | `OAuthClientSecret` | `OAuthClientSecret` | | OAuthRedirectUri | `string` | OAuth 2 Redirection endpoint or Callback Uri | `OAuthRedirectUri` | `OAuthRedirectUri` | | OAuthToken | `Models.OAuthToken` | Object for storing information about the OAuth token | `OAuthToken` | `OAuthToken` | | OAuthScopes | `List` | List of scopes that apply to the OAuth token | `OAuthScopes` | `OAuthScopes` | **Note:** Auth credentials can be set using `AuthorizationCodeAuth` in the client builder and accessed through `AuthorizationCodeAuth` method in the client instance. #### 1\. Client Initialization You must initialize the client with *OAuth 2.0 Authorization Code Grant* credentials as shown in the following code snippet. ```csharp SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.AppRemoteControl, OAuthScopeEnum.PlaylistReadPrivate, }) .Build()) .Build(); ``` Your application must obtain user authorization before it can execute an endpoint call in case this SDK chooses to use *OAuth 2.0 Authorization Code Grant*. This authorization includes the following steps #### 2\. Obtain user consent To obtain user's consent, you must redirect the user to the authorization page.The `BuildAuthorizationUrl()` method creates the URL to the authorization page. You must have initialized the client with scopes for which you need permission to access. ```csharp string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); ``` #### 3\. Handle the OAuth server response Once the user responds to the consent request, the OAuth 2.0 server responds to your application's access request by redirecting the user to the redirect URI specified set in `Configuration`. If the user approves the request, the authorization code will be sent as the `code` query string: ``` https://example.com/oauth/callback?code=XXXXXXXXXXXXXXXXXXXXXXXXX ``` If the user does not approve the request, the response contains an `error` query string: ``` https://example.com/oauth/callback?error=access_denied ``` #### 4\. Authorize the client using the code After the server receives the code, it can exchange this for an *access token*. The access token is an object containing information for authorizing client requests and refreshing the token itself. ```csharp var authManager = client.AuthorizationCodeAuth; try { OAuthToken token = authManager.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (ApiException e) { // TODO Handle exception } ``` #### Scopes Scopes enable your application to only request access to the resources it needs while enabling users to control the amount of access they grant to your application. Available scopes are defined in the [`OAuthScopeEnum`]($m/OAuth%20Scope) enumeration. | Scope Name | Description | | --- | --- | | `APP-REMOTE-CONTROL` | Communicate with the Spotify app on your device. | | `PLAYLIST-READ-PRIVATE` | Access your private playlists. | | `PLAYLIST-READ-COLLABORATIVE` | Access your collaborative playlists. | | `PLAYLIST-MODIFY-PUBLIC` | Manage your public playlists. | | `PLAYLIST-MODIFY-PRIVATE` | Manage your private playlists. | | `USER-LIBRARY-READ` | Access your saved content. | | `USER-LIBRARY-MODIFY` | Manage your saved content. | | `USER-READ-PRIVATE` | Access your subscription details. | | `USER-READ-EMAIL` | Get your real email address. | | `USER-FOLLOW-READ` | Access your followers and who you are following. | | `USER-FOLLOW-MODIFY` | Manage your saved content. | | `USER-TOP-READ` | Read your top artists and content. | | `USER-READ-PLAYBACK-POSITION` | Read your position in content you have played. | | `USER-READ-PLAYBACK-STATE` | Read your currently playing content and Spotify Connect devices information. | | `USER-READ-RECENTLY-PLAYED` | Access your recently played items. | | `USER-READ-CURRENTLY-PLAYING` | Read your currently playing content. | | `USER-MODIFY-PLAYBACK-STATE` | Control playback on your Spotify clients and Spotify Connect devices. | | `UGC-IMAGE-UPLOAD` | Upload images to Spotify on your behalf. | | `STREAMING` | Play content and control playback on your other devices. | #### Refreshing the token An access token may expire after sometime. To extend its lifetime, you must refresh the token. ```csharp if (authManager.IsTokenExpired()) { try { OAuthToken token = authManager.RefreshToken(); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (ApiException e) { // TODO Handle exception } } ``` If a token expires, an exception will be thrown before the next endpoint call requiring authentication. #### Storing an access token for reuse It is recommended that you store the access token for reuse. ```csharp // store token SaveTokenToDatabase(client.AuthorizationCodeAuth.OAuthToken); ``` #### Creating a client from a stored token To authorize a client using a stored access token, just set the access token in Configuration along with the other configuration parameters before creating the client: ```csharp // load token later OAuthToken token = LoadTokenFromDatabase(); // re-instantiate the client with OAuth token SpotifyWebAPIClient client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); ``` #### Complete example ```csharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Models; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Authentication; using System.Collections.Generic; namespace OAuthTestApplication { class Program { static void Main(string[] args) { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.AppRemoteControl, OAuthScopeEnum.PlaylistReadPrivate, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); try { OAuthToken token = LoadTokenFromDatabase(); // Set the token if it is not set before if (token == null) { var authManager = client.AuthorizationCodeAuth; string authUrl = await authManager.BuildAuthorizationUrl(); string authorizationCode = GetAuthorizationCode(authUrl); token = authManager.FetchToken(authorizationCode); } SaveTokenToDatabase(token); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (OAuthProviderException e) { // TODO Handle exception } } private static string GetAuthorizationCode(string authUrl) { // TODO Open the given auth URL, give access and return authorization code from redirect URL return string.Empty; } private static void SaveTokenToDatabase(OAuthToken token) { //Save token here } private static OAuthToken LoadTokenFromDatabase() { OAuthToken token = null; //token = Get token here return token; } } } // the client is now authorized and you can use controllers to make endpoint calls ``` # API Endpoints ## Albums ### get-an-album Get Spotify catalog information for a single album. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AlbumsController albumsController = client.AlbumsController; string id = "4aawyAB9vmqN3uQ7FjRGTy"; string market = "ES"; try { ApiResponse result = await albumsController.GetAnAlbumAsync( id, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): An album ### get-multiple-albums Get Spotify catalog information for multiple albums identified by their Spotify IDs. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AlbumsController albumsController = client.AlbumsController; string ids = "382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc"; string market = "ES"; try { ApiResponse result = await albumsController.GetMultipleAlbumsAsync( ids, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of albums ### get-an-albums-tracks Get Spotify catalog information about an album’s tracks. Optional parameters can be used to limit the number of tracks returned. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AlbumsController albumsController = client.AlbumsController; string id = "4aawyAB9vmqN3uQ7FjRGTy"; string market = "ES"; int? limit = 10; int? offset = 5; try { ApiResponse result = await albumsController.GetAnAlbumsTracksAsync( id, market, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - market (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of tracks ### get-users-saved-albums Get a list of the albums saved in the current Spotify user's 'Your Music' library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AlbumsController albumsController = client.AlbumsController; int? limit = 10; int? offset = 5; string market = "ES"; try { ApiResponse result = await albumsController.GetUsersSavedAlbumsAsync( limit, offset, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - limit (`int?`) - offset (`int?`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of albums ### save-albums-user Save one or more albums to the current user's 'Your Music' library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AlbumsController albumsController = client.AlbumsController; string ids = "382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc"; try { await albumsController.SaveAlbumsUserAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - body (`MeAlbumsRequest`) #### Response Type - Task #### Response Properties - response (`Task`): The album is saved ### remove-albums-user Remove one or more albums from the current user's 'Your Music' library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AlbumsController albumsController = client.AlbumsController; string ids = "382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc"; try { await albumsController.RemoveAlbumsUserAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - body (`MeAlbumsRequest`) #### Response Type - Task #### Response Properties - response (`Task`): Album(s) have been removed from the library ### check-users-saved-albums Check if one or more albums is already saved in the current Spotify user's 'Your Music' library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AlbumsController albumsController = client.AlbumsController; string ids = "382ObEPsp2rxGrnsizN5TX,1A2GTWGtFfWp7KSQTwWOyo,2noRn2Aes5aoNVsU6iWThc"; try { ApiResponse> result = await albumsController.CheckUsersSavedAlbumsAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) #### Response Type - Task>> #### Response Properties - response (`Task>>`): Array of booleans ### get-new-releases Get a list of new album releases featured in Spotify (shown, for example, on a Spotify player’s “Browse” tab). #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AlbumsController albumsController = client.AlbumsController; int? limit = 10; int? offset = 5; try { ApiResponse result = await albumsController.GetNewReleasesAsync( limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): A paged set of albums ## Artists ### get-an-artist Get Spotify catalog information for a single artist identified by their unique Spotify ID. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ArtistsController artistsController = client.ArtistsController; string id = "0TnOYISbd1XYRBk9myaseg"; try { ApiResponse result = await artistsController.GetAnArtistAsync(id); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): An artist ### get-multiple-artists Get Spotify catalog information for several artists based on their Spotify IDs. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ArtistsController artistsController = client.ArtistsController; string ids = "2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6"; try { ApiResponse result = await artistsController.GetMultipleArtistsAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of artists ### get-an-artists-albums Get Spotify catalog information about an artist's albums. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ArtistsController artistsController = client.ArtistsController; string id = "0TnOYISbd1XYRBk9myaseg"; string includeGroups = "single,appears_on"; string market = "ES"; int? limit = 10; int? offset = 5; try { ApiResponse result = await artistsController.GetAnArtistsAlbumsAsync( id, includeGroups, market, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - includeGroups (`string`) - market (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of albums ### get-an-artists-top-tracks Get Spotify catalog information about an artist's top tracks by country. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ArtistsController artistsController = client.ArtistsController; string id = "0TnOYISbd1XYRBk9myaseg"; string market = "ES"; try { ApiResponse result = await artistsController.GetAnArtistsTopTracksAsync( id, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of tracks ### get-an-artists-related-artists Get Spotify catalog information about artists similar to a given artist. Similarity is based on analysis of the Spotify community's listening history. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ArtistsController artistsController = client.ArtistsController; string id = "0TnOYISbd1XYRBk9myaseg"; try { ApiResponse result = await artistsController.GetAnArtistsRelatedArtistsAsync(id); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of artists ## Audiobooks ### get-an-audiobook Get Spotify catalog information for a single audiobook. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AudiobooksController audiobooksController = client.AudiobooksController; string id = "7iHfbu1YPACw6oZPAFJtqe"; string market = "ES"; try { ApiResponse result = await audiobooksController.GetAnAudiobookAsync( id, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): An Audiobook ### get-multiple-audiobooks Get Spotify catalog information for several audiobooks identified by their Spotify IDs. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AudiobooksController audiobooksController = client.AudiobooksController; string ids = "18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqe"; string market = "ES"; try { ApiResponse result = await audiobooksController.GetMultipleAudiobooksAsync( ids, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of audiobooks. If one of the requested audiobooks is unavailable then you'll find a `null` item in the `audiobooks` array where the audiobook object would otherwise be. ### get-audiobook-chapters Get Spotify catalog information about an audiobook's chapters. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AudiobooksController audiobooksController = client.AudiobooksController; string id = "7iHfbu1YPACw6oZPAFJtqe"; string market = "ES"; int? limit = 10; int? offset = 5; try { ApiResponse result = await audiobooksController.GetAudiobookChaptersAsync( id, market, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - market (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of chapters ### get-users-saved-audiobooks Get a list of the audiobooks saved in the current Spotify user's 'Your Music' library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AudiobooksController audiobooksController = client.AudiobooksController; int? limit = 10; int? offset = 5; try { ApiResponse result = await audiobooksController.GetUsersSavedAudiobooksAsync( limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of saved audiobooks ### save-audiobooks-user Save one or more audiobooks to the current Spotify user's library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AudiobooksController audiobooksController = client.AudiobooksController; string ids = "18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqe"; try { await audiobooksController.SaveAudiobooksUserAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Audiobook(s) are saved to the library ### remove-audiobooks-user Remove one or more audiobooks from the Spotify user's library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AudiobooksController audiobooksController = client.AudiobooksController; string ids = "18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqe"; try { await audiobooksController.RemoveAudiobooksUserAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Audiobook(s) have been removed from the library ### check-users-saved-audiobooks Check if one or more audiobooks are already saved in the current Spotify user's library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } AudiobooksController audiobooksController = client.AudiobooksController; string ids = "18yVqkdbdRvS24c0Ilj2ci,1HGw3J3NxZO1TP1BTtVhpZ,7iHfbu1YPACw6oZPAFJtqe"; try { ApiResponse> result = await audiobooksController.CheckUsersSavedAudiobooksAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) #### Response Type - Task>> #### Response Properties - response (`Task>>`): Array of booleans ## Categories ### get-categories Get a list of categories used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab). #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } CategoriesController categoriesController = client.CategoriesController; string locale = "sv_SE"; int? limit = 10; int? offset = 5; try { ApiResponse result = await categoriesController.GetCategoriesAsync( locale, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - locale (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): A paged set of categories ### get-a-category Get a single category used to tag items in Spotify (on, for example, the Spotify player’s “Browse” tab). #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } CategoriesController categoriesController = client.CategoriesController; string categoryId = "dinner"; string locale = "sv_SE"; try { ApiResponse result = await categoriesController.GetACategoryAsync( categoryId, locale ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - categoryId (`string`) - locale (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A category ## Chapters ### get-a-chapter Get Spotify catalog information for a single audiobook chapter. Chapters are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ChaptersController chaptersController = client.ChaptersController; string id = "0D5wENdkdwbqlrHoaJ9g29"; string market = "ES"; try { ApiResponse result = await chaptersController.GetAChapterAsync( id, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A Chapter ### get-several-chapters Get Spotify catalog information for several audiobook chapters identified by their Spotify IDs. Chapters are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ChaptersController chaptersController = client.ChaptersController; string ids = "0IsXVP0JmcB2adSE338GkK,3ZXb8FKZGU0EHALYX6uCzU,0D5wENdkdwbqlrHoaJ9g29"; string market = "ES"; try { ApiResponse result = await chaptersController.GetSeveralChaptersAsync( ids, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of chapters ## Episodes ### get-an-episode Get Spotify catalog information for a single episode identified by its unique Spotify ID. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserReadPlaybackPosition, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } EpisodesController episodesController = client.EpisodesController; string id = "512ojhOuo1ktJprKbVcKyQ"; string market = "ES"; try { ApiResponse result = await episodesController.GetAnEpisodeAsync( id, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): An episode ### get-multiple-episodes Get Spotify catalog information for several episodes based on their Spotify IDs. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserReadPlaybackPosition, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } EpisodesController episodesController = client.EpisodesController; string ids = "77o6BIVlYM3msb4MMIL1jH,0Q86acNRm6V9GYx55SXKwf"; string market = "ES"; try { ApiResponse result = await episodesController.GetMultipleEpisodesAsync( ids, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of episodes ### get-users-saved-episodes Get a list of the episodes saved in the current Spotify user's library.
This API endpoint is in __beta__ and could change without warning. Please share any feedback that you have, or issues that you discover, in our [developer community forum](https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer). #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryRead, OAuthScopeEnum.UserReadPlaybackPosition, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } EpisodesController episodesController = client.EpisodesController; string market = "ES"; int? limit = 10; int? offset = 5; try { ApiResponse result = await episodesController.GetUsersSavedEpisodesAsync( market, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - market (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of episodes ### save-episodes-user Save one or more episodes to the current user's library.
This API endpoint is in __beta__ and could change without warning. Please share any feedback that you have, or issues that you discover, in our [developer community forum](https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer). #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } EpisodesController episodesController = client.EpisodesController; string ids = "77o6BIVlYM3msb4MMIL1jH,0Q86acNRm6V9GYx55SXKwf"; try { await episodesController.SaveEpisodesUserAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - body (`MeEpisodesRequest`) #### Response Type - Task #### Response Properties - response (`Task`): Episode saved ### remove-episodes-user Remove one or more episodes from the current user's library.
This API endpoint is in __beta__ and could change without warning. Please share any feedback that you have, or issues that you discover, in our [developer community forum](https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer). #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } EpisodesController episodesController = client.EpisodesController; string ids = "7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B"; try { await episodesController.RemoveEpisodesUserAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - body (`MeEpisodesRequest1`) #### Response Type - Task #### Response Properties - response (`Task`): Episode removed ### check-users-saved-episodes Check if one or more episodes is already saved in the current Spotify user's 'Your Episodes' library.
This API endpoint is in __beta__ and could change without warning. Please share any feedback that you have, or issues that you discover, in our [developer community forum](https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer).. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } EpisodesController episodesController = client.EpisodesController; string ids = "77o6BIVlYM3msb4MMIL1jH,0Q86acNRm6V9GYx55SXKwf"; try { ApiResponse> result = await episodesController.CheckUsersSavedEpisodesAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) #### Response Type - Task>> #### Response Properties - response (`Task>>`): Array of booleans ## Genres ### get-recommendation-genres Retrieve a list of available genres seed parameter values for [recommendations](/documentation/web-api/reference/get-recommendations). #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } GenresController genresController = client.GenresController; try { ApiResponse result = await genresController.GetRecommendationGenresAsync(); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Response Type - Task> #### Response Properties - response (`Task>`): A set of genres ## Markets ### get-available-markets Get the list of markets where Spotify is available. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } MarketsController marketsController = client.MarketsController; try { ApiResponse result = await marketsController.GetAvailableMarketsAsync(); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Response Type - Task> #### Response Properties - response (`Task>`): A markets object with an array of country codes ## Player ### get-information-about-the-users-current-playback Get information about the user’s current playback state, including track or episode, progress, and active device. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserReadPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; string market = "ES"; try { ApiResponse result = await playerController.GetInformationAboutTheUsersCurrentPlaybackAsync(market); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - market (`string`) - additionalTypes (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): Information about playback ### transfer-a-users-playback Transfer playback to a new device and optionally begin playback. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserModifyPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; MePlayerRequest body = new MePlayerRequest { DeviceIds = new List { "74ASZWbe4lXaubB36ztrGX", }, }; try { await playerController.TransferAUsersPlaybackAsync(body); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - body (`MePlayerRequest`) #### Response Type - Task #### Response Properties - response (`Task`): Playback transferred ### get-a-users-available-devices Get information about a user’s available Spotify Connect devices. Some device models are not supported and will not be listed in the API response. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserReadPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; try { ApiResponse result = await playerController.GetAUsersAvailableDevicesAsync(); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Response Type - Task> #### Response Properties - response (`Task>`): A set of devices ### get-the-users-currently-playing-track Get the object currently being played on the user's Spotify account. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserReadCurrentlyPlaying, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; string market = "ES"; try { ApiResponse result = await playerController.GetTheUsersCurrentlyPlayingTrackAsync(market); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - market (`string`) - additionalTypes (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): Information about the currently playing track ### start-a-users-playback Start a new context or resume current playback on the user's active device. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using SpotifyWebAPI.Standard.Utilities; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserModifyPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; string deviceId = "0d1841b0976bae2a3a310dd74c0f3df354899bc8"; MePlayerPlayRequest body = new MePlayerPlayRequest { ContextUri = "spotify:album:5ht7ItJgpBH7W6vJ5BqpPr", Offset = ApiHelper.JsonDeserialize("{\"position\":5}"), PositionMs = 0, }; try { await playerController.StartAUsersPlaybackAsync( deviceId, body ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - deviceId (`string`) - body (`MePlayerPlayRequest`) #### Response Type - Task #### Response Properties - response (`Task`): Playback started ### pause-a-users-playback Pause playback on the user's account. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserModifyPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; string deviceId = "0d1841b0976bae2a3a310dd74c0f3df354899bc8"; try { await playerController.PauseAUsersPlaybackAsync(deviceId); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - deviceId (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Playback paused ### skip-users-playback-to-next-track Skips to next track in the user’s queue. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserModifyPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; string deviceId = "0d1841b0976bae2a3a310dd74c0f3df354899bc8"; try { await playerController.SkipUsersPlaybackToNextTrackAsync(deviceId); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - deviceId (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Command sent ### skip-users-playback-to-previous-track Skips to previous track in the user’s queue. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserModifyPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; string deviceId = "0d1841b0976bae2a3a310dd74c0f3df354899bc8"; try { await playerController.SkipUsersPlaybackToPreviousTrackAsync(deviceId); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - deviceId (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Command sent ### seek-to-position-in-currently-playing-track Seeks to the given position in the user’s currently playing track. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserModifyPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; int positionMs = 25000; string deviceId = "0d1841b0976bae2a3a310dd74c0f3df354899bc8"; try { await playerController.SeekToPositionInCurrentlyPlayingTrackAsync( positionMs, deviceId ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - positionMs (`int`) - deviceId (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Command sent ### set-repeat-mode-on-users-playback Set the repeat mode for the user's playback. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserModifyPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; string state = "context"; string deviceId = "0d1841b0976bae2a3a310dd74c0f3df354899bc8"; try { await playerController.SetRepeatModeOnUsersPlaybackAsync( state, deviceId ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - state (`string`) - deviceId (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Command sent ### set-volume-for-users-playback Set the volume for the user’s current playback device. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserModifyPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; int volumePercent = 50; string deviceId = "0d1841b0976bae2a3a310dd74c0f3df354899bc8"; try { await playerController.SetVolumeForUsersPlaybackAsync( volumePercent, deviceId ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - volumePercent (`int`) - deviceId (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Command sent ### toggle-shuffle-for-users-playback Toggle shuffle on or off for user’s playback. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserModifyPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; bool state = true; string deviceId = "0d1841b0976bae2a3a310dd74c0f3df354899bc8"; try { await playerController.ToggleShuffleForUsersPlaybackAsync( state, deviceId ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - state (`bool`) - deviceId (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Command sent ### get-recently-played Get tracks from the current user's recently played tracks. _**Note**: Currently doesn't support podcast episodes._ #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserReadRecentlyPlayed, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; int? limit = 10; long? after = 1484811043508L; try { ApiResponse result = await playerController.GetRecentlyPlayedAsync( limit, after ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - limit (`int?`) - after (`long?`) - before (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): A paged set of tracks ### get-queue Get the list of objects that make up the user's queue. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserReadCurrentlyPlaying, OAuthScopeEnum.UserReadPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; try { ApiResponse result = await playerController.GetQueueAsync(); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Response Type - Task> #### Response Properties - response (`Task>`): Information about the queue ### add-to-queue Add an item to the end of the user's current playback queue. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserModifyPlaybackState, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlayerController playerController = client.PlayerController; string uri = "spotify:track:4iV5W9uYEdYUVa79Axb7Rh"; string deviceId = "0d1841b0976bae2a3a310dd74c0f3df354899bc8"; try { await playerController.AddToQueueAsync( uri, deviceId ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - uri (`string`) - deviceId (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Command received ## Playlists ### get-playlist Get a playlist owned by a Spotify user. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; string market = "ES"; string fields = "items(added_by.id,track(name,href,album(name,href)))"; try { ApiResponse result = await playlistsController.GetPlaylistAsync( playlistId, market, fields ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) - market (`string`) - fields (`string`) - additionalTypes (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A playlist ### change-playlist-details Change a playlist's name and public/private state. (The user must, of course, own the playlist.) #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistModifyPrivate, OAuthScopeEnum.PlaylistModifyPublic, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; PlaylistsRequest body = new PlaylistsRequest { Name = "Updated Playlist Name", MPublic = false, Description = "Updated playlist description", }; try { await playlistsController.ChangePlaylistDetailsAsync( playlistId, body ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) - body (`PlaylistsRequest`) #### Response Type - Task #### Response Properties - response (`Task`): Playlist updated ### get-playlists-tracks Get full details of the items of a playlist owned by a Spotify user. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistReadPrivate, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; string market = "ES"; string fields = "items(added_by.id,track(name,href,album(name,href)))"; int? limit = 10; int? offset = 5; try { ApiResponse result = await playlistsController.GetPlaylistsTracksAsync( playlistId, market, fields, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) - market (`string`) - fields (`string`) - limit (`int?`) - offset (`int?`) - additionalTypes (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of tracks ### add-tracks-to-playlist Add one or more items to a user's playlist. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistModifyPrivate, OAuthScopeEnum.PlaylistModifyPublic, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; int? position = 0; string uris = "spotify:track:4iV5W9uYEdYUVa79Axb7Rh,spotify:track:1301WleyT98MSxVHPZCA6M"; try { ApiResponse result = await playlistsController.AddTracksToPlaylistAsync( playlistId, position, uris ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) - position (`int?`) - uris (`string`) - body (`PlaylistsTracksRequest`) #### Response Type - Task> #### Response Properties - response (`Task>`): A snapshot ID for the playlist ### reorder-or-replace-playlists-tracks Either reorder or replace items in a playlist depending on the request's parameters. To reorder items, include `range_start`, `insert_before`, `range_length` and `snapshot_id` in the request's body. To replace items, include `uris` as either a query parameter or in the request's body. Replacing items in a playlist will overwrite its existing items. This operation can be used for replacing or clearing items in a playlist.
**Note**: Replace and reorder are mutually exclusive operations which share the same endpoint, but have different parameters. These operations can't be applied together in a single request. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistModifyPrivate, OAuthScopeEnum.PlaylistModifyPublic, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; PlaylistsTracksRequest1 body = new PlaylistsTracksRequest1 { RangeStart = 1, InsertBefore = 3, RangeLength = 2, }; try { ApiResponse result = await playlistsController.ReorderOrReplacePlaylistsTracksAsync( playlistId, null, body ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) - uris (`string`) - body (`PlaylistsTracksRequest1`) #### Response Type - Task> #### Response Properties - response (`Task>`): A snapshot ID for the playlist ### remove-tracks-playlist Remove one or more items from a user's playlist. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistModifyPrivate, OAuthScopeEnum.PlaylistModifyPublic, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; PlaylistsTracksRequest2 body = new PlaylistsTracksRequest2 { Tracks = new List { new Track1 { }, }, }; try { ApiResponse result = await playlistsController.RemoveTracksPlaylistAsync( playlistId, body ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) - body (`PlaylistsTracksRequest2`) #### Response Type - Task> #### Response Properties - response (`Task>`): A snapshot ID for the playlist ### get-a-list-of-current-users-playlists Get a list of the playlists owned or followed by the current Spotify user. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistReadPrivate, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; int? limit = 10; int? offset = 5; try { ApiResponse result = await playlistsController.GetAListOfCurrentUsersPlaylistsAsync( limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): A paged set of playlists ### get-list-users-playlists Get a list of the playlists owned or followed by a Spotify user. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistReadCollaborative, OAuthScopeEnum.PlaylistReadPrivate, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string userId = "smedjan"; int? limit = 10; int? offset = 5; try { ApiResponse result = await playlistsController.GetListUsersPlaylistsAsync( userId, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - userId (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): A paged set of playlists ### create-playlist Create a playlist for a Spotify user. (The playlist will be empty until you [add tracks](/documentation/web-api/reference/add-tracks-to-playlist).) Each user is generally limited to a maximum of 11000 playlists. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistModifyPrivate, OAuthScopeEnum.PlaylistModifyPublic, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string userId = "smedjan"; UsersPlaylistsRequest body = new UsersPlaylistsRequest { Name = "New Playlist", MPublic = false, Description = "New playlist description", }; try { ApiResponse result = await playlistsController.CreatePlaylistAsync( userId, body ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - userId (`string`) - body (`UsersPlaylistsRequest`) #### Response Type - Task> #### Response Properties - response (`Task>`): A playlist ### get-featured-playlists Get a list of Spotify featured playlists (shown, for example, on a Spotify player's 'Browse' tab). #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string locale = "sv_SE"; int? limit = 10; int? offset = 5; try { ApiResponse result = await playlistsController.GetFeaturedPlaylistsAsync( locale, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - locale (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): A paged set of playlists ### get-a-categories-playlists Get a list of Spotify playlists tagged with a particular category. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string categoryId = "dinner"; int? limit = 10; int? offset = 5; try { ApiResponse result = await playlistsController.GetACategoriesPlaylistsAsync( categoryId, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - categoryId (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): A paged set of playlists ### get-playlist-cover Get the current image associated with a specific playlist. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; try { ApiResponse> result = await playlistsController.GetPlaylistCoverAsync(playlistId); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) #### Response Type - Task>> #### Response Properties - response (`Task>>`): A set of images ### upload-custom-playlist-cover Replace the image used to represent a specific playlist. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using SpotifyWebAPI.Standard.Utilities; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistModifyPrivate, OAuthScopeEnum.PlaylistModifyPublic, OAuthScopeEnum.UgcImageUpload, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } PlaylistsController playlistsController = client.PlaylistsController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; object body = ApiHelper.JsonDeserialize("{\"key1\":\"val1\",\"key2\":\"val2\"}"); try { await playlistsController.UploadCustomPlaylistCoverAsync( playlistId, body ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) - body (`object`) #### Response Type - Task #### Response Properties - response (`Task`): Image uploaded ## Search ### search Get Spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string. Audiobooks are only available within the US, UK, Canada, Ireland, New Zealand and Australia markets. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } SearchController searchController = client.SearchController; string q = "remaster%20track:Doxy%20artist:Miles%20Davis"; List type = new List { ItemTypeEnum.Audiobook, ItemTypeEnum.Album, ItemTypeEnum.Artist, }; string market = "ES"; int? limit = 10; int? offset = 5; try { ApiResponse result = await searchController.SearchAsync( q, type, market, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - q (`string`) - type (`List`) - market (`string`) - limit (`int?`) - offset (`int?`) - includeExternal (`IncludeExternalEnum?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Search response ## Shows ### get-a-show Get Spotify catalog information for a single show identified by its unique Spotify ID. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserReadPlaybackPosition, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ShowsController showsController = client.ShowsController; string id = "38bS44xjbVVZ3No3ByF1dJ"; string market = "ES"; try { ApiResponse result = await showsController.GetAShowAsync( id, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A show ### get-multiple-shows Get Spotify catalog information for several shows based on their Spotify IDs. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ShowsController showsController = client.ShowsController; string ids = "5CfCWKI5pZ28U0uOzXkDHe,5as3aKmN2k11yfDDDSrvaZ"; string market = "ES"; try { ApiResponse result = await showsController.GetMultipleShowsAsync( ids, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of shows ### get-a-shows-episodes Get Spotify catalog information about an show’s episodes. Optional parameters can be used to limit the number of episodes returned. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserReadPlaybackPosition, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ShowsController showsController = client.ShowsController; string id = "38bS44xjbVVZ3No3ByF1dJ"; string market = "ES"; int? limit = 10; int? offset = 5; try { ApiResponse result = await showsController.GetAShowsEpisodesAsync( id, market, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - market (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of episodes ### get-users-saved-shows Get a list of shows saved in the current Spotify user's library. Optional parameters can be used to limit the number of shows returned. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ShowsController showsController = client.ShowsController; int? limit = 10; int? offset = 5; try { ApiResponse result = await showsController.GetUsersSavedShowsAsync( limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of shows ### save-shows-user Save one or more shows to current Spotify user's library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ShowsController showsController = client.ShowsController; string ids = "5CfCWKI5pZ28U0uOzXkDHe,5as3aKmN2k11yfDDDSrvaZ"; try { await showsController.SaveShowsUserAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - body (`MeShowsRequest`) #### Response Type - Task #### Response Properties - response (`Task`): Show saved ### remove-shows-user Delete one or more shows from current Spotify user's library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ShowsController showsController = client.ShowsController; string ids = "5CfCWKI5pZ28U0uOzXkDHe,5as3aKmN2k11yfDDDSrvaZ"; string market = "ES"; try { await showsController.RemoveShowsUserAsync( ids, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - market (`string`) - body (`MeShowsRequest`) #### Response Type - Task #### Response Properties - response (`Task`): Show removed ### check-users-saved-shows Check if one or more shows is already saved in the current Spotify user's library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } ShowsController showsController = client.ShowsController; string ids = "5CfCWKI5pZ28U0uOzXkDHe,5as3aKmN2k11yfDDDSrvaZ"; try { ApiResponse> result = await showsController.CheckUsersSavedShowsAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) #### Response Type - Task>> #### Response Properties - response (`Task>>`): Array of booleans ## Tracks ### get-track Get Spotify catalog information for a single track identified by its unique Spotify ID. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } TracksController tracksController = client.TracksController; string id = "11dFghVXANMlKmJXsNCbNl"; string market = "ES"; try { ApiResponse result = await tracksController.GetTrackAsync( id, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A track ### get-several-tracks Get Spotify catalog information for multiple tracks based on their Spotify IDs. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } TracksController tracksController = client.TracksController; string ids = "7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B"; string market = "ES"; try { ApiResponse result = await tracksController.GetSeveralTracksAsync( ids, market ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - market (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of tracks ### get-users-saved-tracks Get a list of the songs saved in the current Spotify user's 'Your Music' library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } TracksController tracksController = client.TracksController; string market = "ES"; int? limit = 10; int? offset = 5; try { ApiResponse result = await tracksController.GetUsersSavedTracksAsync( market, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - market (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of tracks ### save-tracks-user Save one or more tracks to the current user's 'Your Music' library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } TracksController tracksController = client.TracksController; string ids = "7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B"; try { await tracksController.SaveTracksUserAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - body (`MeTracksRequest`) #### Response Type - Task #### Response Properties - response (`Task`): Track saved ### remove-tracks-user Remove one or more tracks from the current user's 'Your Music' library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } TracksController tracksController = client.TracksController; string ids = "7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B"; try { await tracksController.RemoveTracksUserAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) - body (`MeTracksRequest1`) #### Response Type - Task #### Response Properties - response (`Task`): Track removed ### check-users-saved-tracks Check if one or more tracks is already saved in the current Spotify user's 'Your Music' library. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserLibraryRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } TracksController tracksController = client.TracksController; string ids = "7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B"; try { ApiResponse> result = await tracksController.CheckUsersSavedTracksAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) #### Response Type - Task>> #### Response Properties - response (`Task>>`): Array of booleans ### get-several-audio-features Get audio features for multiple tracks based on their Spotify IDs. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } TracksController tracksController = client.TracksController; string ids = "7ouMYWpwJ422jRcDASZB7P,4VqPOruhp5EdPBeR92t6lQ,2takcwOaAZWiXQijPHIx7B"; try { ApiResponse result = await tracksController.GetSeveralAudioFeaturesAsync(ids); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - ids (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of audio features ### get-audio-features Get audio feature information for a single track identified by its unique Spotify ID. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } TracksController tracksController = client.TracksController; string id = "11dFghVXANMlKmJXsNCbNl"; try { ApiResponse result = await tracksController.GetAudioFeaturesAsync(id); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): Audio features for one track ### get-audio-analysis Get a low-level audio analysis for a track in the Spotify catalog. The audio analysis describes the track’s structure and musical content, including rhythm, pitch, and timbre. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } TracksController tracksController = client.TracksController; string id = "11dFghVXANMlKmJXsNCbNl"; try { ApiResponse result = await tracksController.GetAudioAnalysisAsync(id); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - id (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): Audio analysis for one track ### get-recommendations Recommendations are generated based on the available information for a given seed entity and matched against similar artists and tracks. If there is sufficient information about the provided seeds, a list of tracks will be returned together with pool size details. For artists and tracks that are very new or obscure there might not be enough data to generate a list of tracks. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } TracksController tracksController = client.TracksController; int? limit = 10; string market = "ES"; string seedArtists = "4NHQUGzhtTLFvgF5SZesLK"; string seedGenres = "classical,country"; string seedTracks = "0c6xIDDpzE81m2q797ordA"; try { ApiResponse result = await tracksController.GetRecommendationsAsync( limit, market, seedArtists, seedGenres, seedTracks ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - limit (`int?`) - market (`string`) - seedArtists (`string`) - seedGenres (`string`) - seedTracks (`string`) - minAcousticness (`double?`) - maxAcousticness (`double?`) - targetAcousticness (`double?`) - minDanceability (`double?`) - maxDanceability (`double?`) - targetDanceability (`double?`) - minDurationMs (`int?`) - maxDurationMs (`int?`) - targetDurationMs (`int?`) - minEnergy (`double?`) - maxEnergy (`double?`) - targetEnergy (`double?`) - minInstrumentalness (`double?`) - maxInstrumentalness (`double?`) - targetInstrumentalness (`double?`) - minKey (`int?`) - maxKey (`int?`) - targetKey (`int?`) - minLiveness (`double?`) - maxLiveness (`double?`) - targetLiveness (`double?`) - minLoudness (`double?`) - maxLoudness (`double?`) - targetLoudness (`double?`) - minMode (`int?`) - maxMode (`int?`) - targetMode (`int?`) - minPopularity (`int?`) - maxPopularity (`int?`) - targetPopularity (`int?`) - minSpeechiness (`double?`) - maxSpeechiness (`double?`) - targetSpeechiness (`double?`) - minTempo (`double?`) - maxTempo (`double?`) - targetTempo (`double?`) - minTimeSignature (`int?`) - maxTimeSignature (`int?`) - targetTimeSignature (`int?`) - minValence (`double?`) - maxValence (`double?`) - targetValence (`double?`) #### Response Type - Task> #### Response Properties - response (`Task>`): A set of recommendations ## Users ### get-current-users-profile Get detailed profile information about the current user (including the current user's username). #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserReadEmail, OAuthScopeEnum.UserReadPrivate, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; try { ApiResponse result = await usersController.GetCurrentUsersProfileAsync(); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Response Type - Task> #### Response Properties - response (`Task>`): A user ### get-users-profile Get public profile information about a Spotify user. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; string userId = "smedjan"; try { ApiResponse result = await usersController.GetUsersProfileAsync(userId); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - userId (`string`) #### Response Type - Task> #### Response Properties - response (`Task>`): A user ### follow-playlist Add the current user as a follower of a playlist. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistModifyPrivate, OAuthScopeEnum.PlaylistModifyPublic, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; PlaylistsFollowersRequest body = new PlaylistsFollowersRequest { MPublic = false, }; try { await usersController.FollowPlaylistAsync( playlistId, body ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) - body (`PlaylistsFollowersRequest`) #### Response Type - Task #### Response Properties - response (`Task`): Playlist followed ### unfollow-playlist Remove the current user as a follower of a playlist. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.PlaylistModifyPrivate, OAuthScopeEnum.PlaylistModifyPublic, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; try { await usersController.UnfollowPlaylistAsync(playlistId); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) #### Response Type - Task #### Response Properties - response (`Task`): Playlist unfollowed ### get-followed Get the current user's followed artists. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserFollowRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; ItemType1Enum type = ItemType1Enum.Artist; string after = "0I2XqVXqHScXjHhk6AYYRe"; int? limit = 10; try { ApiResponse result = await usersController.GetFollowedAsync( type, after, limit ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - type (`ItemType1Enum`) - after (`string`) - limit (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): A paged set of artists ### follow-artists-users Add the current user as a follower of one or more artists or other Spotify users. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserFollowModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; ItemType2Enum type = ItemType2Enum.Artist; string ids = "2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6"; try { await usersController.FollowArtistsUsersAsync( type, ids ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - type (`ItemType2Enum`) - ids (`string`) - body (`MeFollowingRequest`) #### Response Type - Task #### Response Properties - response (`Task`): Artist or user followed ### unfollow-artists-users Remove the current user as a follower of one or more artists or other Spotify users. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserFollowModify, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; ItemType3Enum type = ItemType3Enum.Artist; string ids = "2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6"; try { await usersController.UnfollowArtistsUsersAsync( type, ids ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - type (`ItemType3Enum`) - ids (`string`) - body (`MeFollowingRequest1`) #### Response Type - Task #### Response Properties - response (`Task`): Artist or user unfollowed ### check-current-user-follows Check to see if the current user is following one or more artists or other Spotify users. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserFollowRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; ItemType3Enum type = ItemType3Enum.Artist; string ids = "2CIMQHirSU0MQqyYHq0eOx,57dN52uHvrHOxijzpIgu3E,1vCWHaC5f2uS3yhpwWbIA6"; try { ApiResponse> result = await usersController.CheckCurrentUserFollowsAsync( type, ids ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - type (`ItemType3Enum`) - ids (`string`) #### Response Type - Task>> #### Response Properties - response (`Task>>`): Array of booleans ### check-if-user-follows-playlist Check to see if one or more Spotify users are following a specified playlist. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; string playlistId = "3cEYpjA9oz9GiPac4AsH4n"; string ids = "jmperezperez,thelinmichael,wizzler"; try { ApiResponse> result = await usersController.CheckIfUserFollowsPlaylistAsync( playlistId, ids ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - playlistId (`string`) - ids (`string`) #### Response Type - Task>> #### Response Properties - response (`Task>>`): Array of booleans ### get-users-top-artists Get the current user's top artists based on calculated affinity. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserTopRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; string timeRange = "medium_term"; int? limit = 10; int? offset = 5; try { ApiResponse result = await usersController.GetUsersTopArtistsAsync( timeRange, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - timeRange (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of artists ### get-users-top-tracks Get the current user's top tracks based on calculated affinity. #### Code Sample ```CSharp using SpotifyWebAPI.Standard; using SpotifyWebAPI.Standard.Authentication; using SpotifyWebAPI.Standard.Controllers; using SpotifyWebAPI.Standard.Exceptions; using SpotifyWebAPI.Standard.Http.Response; using SpotifyWebAPI.Standard.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace TestConsoleProject { public class Program { public static async Task Main() { SpotifyWebAPIClient client = new SpotifyWebAPIClient.Builder() .AuthorizationCodeAuth( new AuthorizationCodeAuthModel.Builder( "OAuthClientId", "OAuthClientSecret", "OAuthRedirectUri" ) .OAuthScopes( new List { OAuthScopeEnum.UserTopRead, }) .Build()) .Environment(SpotifyWebAPI.Standard.Environment.Production) .Build(); // Setup the OAuthToken for AuthorizationCodeAuth try { string authUrl = await client.AuthorizationCodeAuth.BuildAuthorizationUrl(); // Redirect user to this authUrl and get a code after the user consent string authorizationCode = "TODO: Replace Code"; OAuthToken token = client.AuthorizationCodeAuth.FetchToken(authorizationCode); // re-instantiate the client with OAuth token client = client.ToBuilder() .AuthorizationCodeAuth( client.AuthorizationCodeAuthModel.ToBuilder() .OAuthToken(token) .Build()) .Build(); } catch (Exception e) { // TODO: Handle exception here Console.WriteLine(e.Message); } UsersController usersController = client.UsersController; string timeRange = "medium_term"; int? limit = 10; int? offset = 5; try { ApiResponse result = await usersController.GetUsersTopTracksAsync( timeRange, limit, offset ); } catch (ApiException e) { // TODO: Handle exception here Console.WriteLine(e.Message); } } } } ``` #### Request Parameters - timeRange (`string`) - limit (`int?`) - offset (`int?`) #### Response Type - Task> #### Response Properties - response (`Task>`): Pages of tracks # Models ## LinkedTrackObject ### Properties - ExternalUrls (`ExternalUrlObject`): Known external URLs for this track. - Href (`string`): A link to the Web API endpoint providing full details of the track. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the track. - Type (`string`): The object type: "track". - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the track. ## TrackRestrictionObject ### Properties - Reason (`string`): The reason for the restriction. Supported values: - `market` - The content item is not available in the given market. - `product` - The content item is not available for the user's subscription type. - `explicit` - The content item is explicit and the user's account is set to not play explicit content. Additional reasons may be added in the future. **Note**: If you use this field, make sure that your application safely handles unknown values. ## AlbumRestrictionObject ### Properties - Reason (`ReasonEnum?`): The reason for the restriction. Albums may be restricted if the content is not available in a given market, to the user's subscription type, or when the user's account is set to not play explicit content. Additional reasons may be added in the future. ## EpisodeRestrictionObject ### Properties - Reason (`string`): The reason for the restriction. Supported values: - `market` - The content item is not available in the given market. - `product` - The content item is not available for the user's subscription type. - `explicit` - The content item is explicit and the user's account is set to not play explicit content. Additional reasons may be added in the future. **Note**: If you use this field, make sure that your application safely handles unknown values. ## ChapterRestrictionObject ### Properties - Reason (`string`): The reason for the restriction. Supported values: - `market` - The content item is not available in the given market. - `product` - The content item is not available for the user's subscription type. - `explicit` - The content item is explicit and the user's account is set to not play explicit content. - `payment_required` - Payment is required to play the content item. Additional reasons may be added in the future. **Note**: If you use this field, make sure that your application safely handles unknown values. ## ArtistObject ### Properties - ExternalUrls (`ExternalUrlObject`): Known external URLs for this artist. - Followers (`FollowersObject`): Information about the followers of the artist. - Genres (`List`): A list of the genres the artist is associated with. If not yet classified, the array is empty. - Href (`string`): A link to the Web API endpoint providing full details of the artist. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the artist. - Images (`List`): Images of the artist in various sizes, widest first. - Name (`string`): The name of the artist. - Popularity (`int?`): The popularity of the artist. The value will be between 0 and 100, with 100 being the most popular. The artist's popularity is calculated from the popularity of all the artist's tracks. - Type (`TypeEnum?`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the artist. ## SimplifiedArtistObject ### Properties - ExternalUrls (`ExternalUrlObject`): Known external URLs for this artist. - Href (`string`): A link to the Web API endpoint providing full details of the artist. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the artist. - Name (`string`): The name of the artist. - Type (`TypeEnum?`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the artist. ## PlayHistoryObject ### Properties - Track (`TrackObject`): The track the user listened to. - PlayedAt (`DateTime?`): The date and time the track was played. - Context (`ContextObject`): The context the track was played from. ## PlaylistTrackObject ### Properties - AddedAt (`DateTime?`): The date and time the track or episode was added. _**Note**: some very old playlists may return `null` in this field._ - AddedBy (`PlaylistUserObject`): The Spotify user who added the track or episode. _**Note**: some very old playlists may return `null` in this field._ - IsLocal (`bool?`): Whether this track or episode is a [local file](/documentation/web-api/concepts/playlists/#local-files) or not. - Track (`PlaylistTrackObjectTrack`): Information about the track or episode. ## QueueObject ### Properties - CurrentlyPlaying (`QueueObjectCurrentlyPlaying`): The currently playing track or episode. Can be `null`. - Queue (`List`): The tracks or episodes in the queue. Can be empty. ## CurrentlyPlayingContextObject ### Properties - Device (`DeviceObject`): The device that is currently active. - RepeatState (`string`): off, track, context - ShuffleState (`bool?`): If shuffle is on or off. - Context (`ContextObject`): A Context Object. Can be `null`. - Timestamp (`long?`): Unix Millisecond Timestamp when data was fetched. - ProgressMs (`int?`): Progress into the currently playing track or episode. Can be `null`. - IsPlaying (`bool?`): If something is currently playing, return `true`. - Item (`CurrentlyPlayingContextObjectItem`): The currently playing track or episode. Can be `null`. - CurrentlyPlayingType (`string`): The object type of the currently playing item. Can be one of `track`, `episode`, `ad` or `unknown`. - Actions (`DisallowsObject`): Allows to update the user interface based on which playback actions are available within the current context. ## DisallowsObject ### Properties - InterruptingPlayback (`bool?`): Interrupting playback. Optional field. - Pausing (`bool?`): Pausing. Optional field. - Resuming (`bool?`): Resuming. Optional field. - Seeking (`bool?`): Seeking playback location. Optional field. - SkippingNext (`bool?`): Skipping to the next context. Optional field. - SkippingPrev (`bool?`): Skipping to the previous context. Optional field. - TogglingRepeatContext (`bool?`): Toggling repeat context flag. Optional field. - TogglingShuffle (`bool?`): Toggling shuffle flag. Optional field. - TogglingRepeatTrack (`bool?`): Toggling repeat track flag. Optional field. - TransferringPlayback (`bool?`): Transfering playback between devices. Optional field. ## ErrorObject ### Properties - Status (`int`): The HTTP status code (also returned in the response header; see [Response Status Codes](/documentation/web-api/concepts/api-calls#response-status-codes) for more information). - Message (`string`): A short description of the cause of the error. ## PrivateUserObject ### Properties - Country (`string`): The country of the user, as set in the user's account profile. An [ISO 3166-1 alpha-2 country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). _This field is only available when the current user has granted access to the [user-read-private](/documentation/web-api/concepts/scopes/#list-of-scopes) scope._ - DisplayName (`string`): The name displayed on the user's profile. `null` if not available. - Email (`string`): The user's email address, as entered by the user when creating their account. _**Important!** This email address is unverified; there is no proof that it actually belongs to the user._ _This field is only available when the current user has granted access to the [user-read-email](/documentation/web-api/concepts/scopes/#list-of-scopes) scope._ - ExplicitContent (`ExplicitContentSettingsObject`): The user's explicit content settings. _This field is only available when the current user has granted access to the [user-read-private](/documentation/web-api/concepts/scopes/#list-of-scopes) scope._ - ExternalUrls (`ExternalUrlObject`): Known external URLs for this user. - Followers (`FollowersObject`): Information about the followers of the user. - Href (`string`): A link to the Web API endpoint for this user. - Id (`string`): The [Spotify user ID](/documentation/web-api/concepts/spotify-uris-ids) for the user. - Images (`List`): The user's profile image. - Product (`string`): The user's Spotify subscription level: "premium", "free", etc. (The subscription level "open" can be considered the same as "free".) _This field is only available when the current user has granted access to the [user-read-private](/documentation/web-api/concepts/scopes/#list-of-scopes) scope._ - Type (`string`): The object type: "user" - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the user. ## PublicUserObject ### Properties - DisplayName (`string`): The name displayed on the user's profile. `null` if not available. - ExternalUrls (`ExternalUrlObject`): Known public external URLs for this user. - Followers (`FollowersObject`): Information about the followers of this user. - Href (`string`): A link to the Web API endpoint for this user. - Id (`string`): The [Spotify user ID](/documentation/web-api/concepts/spotify-uris-ids) for this user. - Images (`List`): The user's profile image. - Type (`Type4Enum?`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for this user. ## AudioAnalysisObject ### Properties - Meta (`Meta`) - Track (`Track`) - Bars (`List`): The time intervals of the bars throughout the track. A bar (or measure) is a segment of time defined as a given number of beats. - Beats (`List`): The time intervals of beats throughout the track. A beat is the basic time unit of a piece of music; for example, each tick of a metronome. Beats are typically multiples of tatums. - Sections (`List`): Sections are defined by large variations in rhythm or timbre, e.g. chorus, verse, bridge, guitar solo, etc. Each section contains its own descriptions of tempo, key, mode, time_signature, and loudness. - Segments (`List`): Each segment contains a roughly conisistent sound throughout its duration. - Tatums (`List`): A tatum represents the lowest regular pulse train that a listener intuitively infers from the timing of perceived musical events (segments). ## TimeIntervalObject ### Properties - Start (`double?`): The starting point (in seconds) of the time interval. - Duration (`double?`): The duration (in seconds) of the time interval. - Confidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the interval. ## SectionObject ### Properties - Start (`double?`): The starting point (in seconds) of the section. - Duration (`double?`): The duration (in seconds) of the section. - Confidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the section's "designation". - Loudness (`double?`): The overall loudness of the section in decibels (dB). Loudness values are useful for comparing relative loudness of sections within tracks. - Tempo (`double?`): The overall estimated tempo of the section in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration. - TempoConfidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the tempo. Some tracks contain tempo changes or sounds which don't contain tempo (like pure speech) which would correspond to a low value in this field. - Key (`int?`): The estimated overall key of the section. The values in this field ranging from 0 to 11 mapping to pitches using standard Pitch Class notation (E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on). If no key was detected, the value is -1. - KeyConfidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the key. Songs with many key changes may correspond to low values in this field. - Mode (`ModeEnum?`): Indicates the modality (major or minor) of a section, the type of scale from which its melodic content is derived. This field will contain a 0 for "minor", a 1 for "major", or a -1 for no result. Note that the major key (e.g. C major) could more likely be confused with the minor key at 3 semitones lower (e.g. A minor) as both keys carry the same pitches. - ModeConfidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the `mode`. - TimeSignature (`int?`): An estimated time signature. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure). The time signature ranges from 3 to 7 indicating time signatures of "3/4", to "7/4". - TimeSignatureConfidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the `time_signature`. Sections with time signature changes may correspond to low values in this field. ## SegmentObject ### Properties - Start (`double?`): The starting point (in seconds) of the segment. - Duration (`double?`): The duration (in seconds) of the segment. - Confidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the segmentation. Segments of the song which are difficult to logically segment (e.g: noise) may correspond to low values in this field. - LoudnessStart (`double?`): The onset loudness of the segment in decibels (dB). Combined with `loudness_max` and `loudness_max_time`, these components can be used to describe the "attack" of the segment. - LoudnessMax (`double?`): The peak loudness of the segment in decibels (dB). Combined with `loudness_start` and `loudness_max_time`, these components can be used to describe the "attack" of the segment. - LoudnessMaxTime (`double?`): The segment-relative offset of the segment peak loudness in seconds. Combined with `loudness_start` and `loudness_max`, these components can be used to desctibe the "attack" of the segment. - LoudnessEnd (`double?`): The offset loudness of the segment in decibels (dB). This value should be equivalent to the loudness_start of the following segment. - Pitches (`List`): Pitch content is given by a “chroma” vector, corresponding to the 12 pitch classes C, C#, D to B, with values ranging from 0 to 1 that describe the relative dominance of every pitch in the chromatic scale. For example a C Major chord would likely be represented by large values of C, E and G (i.e. classes 0, 4, and 7). Vectors are normalized to 1 by their strongest dimension, therefore noisy sounds are likely represented by values that are all close to 1, while pure tones are described by one value at 1 (the pitch) and others near 0. As can be seen below, the 12 vector indices are a combination of low-power spectrum values at their respective pitch frequencies. ![pitch vector](https://developer.spotify.com/assets/audio/Pitch_vector.png) - Timbre (`List`): Timbre is the quality of a musical note or sound that distinguishes different types of musical instruments, or voices. It is a complex notion also referred to as sound color, texture, or tone quality, and is derived from the shape of a segment’s spectro-temporal surface, independently of pitch and loudness. The timbre feature is a vector that includes 12 unbounded values roughly centered around 0. Those values are high level abstractions of the spectral surface, ordered by degree of importance. For completeness however, the first dimension represents the average loudness of the segment; second emphasizes brightness; third is more closely correlated to the flatness of a sound; fourth to sounds with a stronger attack; etc. See an image below representing the 12 basis functions (i.e. template segments). ![timbre basis functions](https://developer.spotify.com/assets/audio/Timbre_basis_functions.png) The actual timbre of the segment is best described as a linear combination of these 12 basis functions weighted by the coefficient values: timbre = c1 x b1 + c2 x b2 + ... + c12 x b12, where c1 to c12 represent the 12 coefficients and b1 to b12 the 12 basis functions as displayed below. Timbre vectors are best used in comparison with each other. ## AudioFeaturesObject ### Properties - Acousticness (`double?`): A confidence measure from 0.0 to 1.0 of whether the track is acoustic. 1.0 represents high confidence the track is acoustic. - AnalysisUrl (`string`): A URL to access the full audio analysis of this track. An access token is required to access this data. - Danceability (`double?`): Danceability describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable. - DurationMs (`int?`): The duration of the track in milliseconds. - Energy (`double?`): Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute include dynamic range, perceived loudness, timbre, onset rate, and general entropy. - Id (`string`): The Spotify ID for the track. - Instrumentalness (`double?`): Predicts whether a track contains no vocals. "Ooh" and "aah" sounds are treated as instrumental in this context. Rap or spoken word tracks are clearly "vocal". The closer the instrumentalness value is to 1.0, the greater likelihood the track contains no vocal content. Values above 0.5 are intended to represent instrumental tracks, but confidence is higher as the value approaches 1.0. - Key (`int?`): The key the track is in. Integers map to pitches using standard [Pitch Class notation](https://en.wikipedia.org/wiki/Pitch_class). E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on. If no key was detected, the value is -1. - Liveness (`double?`): Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live. A value above 0.8 provides strong likelihood that the track is live. - Loudness (`double?`): The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of tracks. Loudness is the quality of a sound that is the primary psychological correlate of physical strength (amplitude). Values typically range between -60 and 0 db. - Mode (`int?`): Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0. - Speechiness (`double?`): Speechiness detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value. Values above 0.66 describe tracks that are probably made entirely of spoken words. Values between 0.33 and 0.66 describe tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like tracks. - Tempo (`double?`): The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration. - TimeSignature (`int?`): An estimated time signature. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure). The time signature ranges from 3 to 7 indicating time signatures of "3/4", to "7/4". - TrackHref (`string`): A link to the Web API endpoint providing full details of the track. - Type (`Type8Enum?`): The object type. - Uri (`string`): The Spotify URI for the track. - Valence (`double?`): A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while tracks with low valence sound more negative (e.g. sad, depressed, angry). ## SimplifiedTrackObject ### Properties - Artists (`List`): The artists who performed the track. Each artist object includes a link in `href` to more detailed information about the artist. - AvailableMarkets (`List`): A list of the countries in which the track can be played, identified by their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. - DiscNumber (`int?`): The disc number (usually `1` unless the album consists of more than one disc). - DurationMs (`int?`): The track length in milliseconds. - Explicit (`bool?`): Whether or not the track has explicit lyrics ( `true` = yes it does; `false` = no it does not OR unknown). - ExternalUrls (`ExternalUrlObject`): External URLs for this track. - Href (`string`): A link to the Web API endpoint providing full details of the track. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the track. - IsPlayable (`bool?`): Part of the response when [Track Relinking](/documentation/web-api/concepts/track-relinking/) is applied. If `true`, the track is playable in the given market. Otherwise `false`. - LinkedFrom (`LinkedTrackObject`): Part of the response when [Track Relinking](/documentation/web-api/concepts/track-relinking/) is applied and is only part of the response if the track linking, in fact, exists. The requested track has been replaced with a different track. The track in the `linked_from` object contains information about the originally requested track. - Restrictions (`TrackRestrictionObject`): Included in the response when a content restriction is applied. - Name (`string`): The name of the track. - PreviewUrl (`string`): A URL to a 30 second preview (MP3 format) of the track. - TrackNumber (`int?`): The number of the track. If an album has several discs, the track number is the number on the specified disc. - Type (`string`): The object type: "track". - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the track. - IsLocal (`bool?`): Whether or not the track is from a local file. ## DeviceObject ### Properties - Id (`string`): The device ID. This ID is unique and persistent to some extent. However, this is not guaranteed and any cached `device_id` should periodically be cleared out and refetched as necessary. - IsActive (`bool?`): If this device is the currently active device. - IsPrivateSession (`bool?`): If this device is currently in a private session. - IsRestricted (`bool?`): Whether controlling this device is restricted. At present if this is "true" then no Web API commands will be accepted by this device. - Name (`string`): A human-readable name for the device. Some devices have a name that the user can configure (e.g. \"Loudest speaker\") and some devices have a generic name associated with the manufacturer or device model. - Type (`string`): Device type, such as "computer", "smartphone" or "speaker". - VolumePercent (`int?`): The current volume in percent. - SupportsVolume (`bool?`): If this device can be used to set the volume. ## CursorObject ### Properties - After (`string`): The cursor to use as key to find the next page of items. - Before (`string`): The cursor to use as key to find the previous page of items. ## CursorPagingObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request. - Limit (`int?`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Cursors (`CursorObject`): The cursors used to find the next set of items. - Total (`int?`): The total number of items available to return. ## CursorPagingPlayHistoryObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request. - Limit (`int?`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Cursors (`CursorObject`): The cursors used to find the next set of items. - Total (`int?`): The total number of items available to return. - Items (`List`) ## CursorPagingSimplifiedArtistObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request. - Limit (`int?`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Cursors (`CursorObject`): The cursors used to find the next set of items. - Total (`int?`): The total number of items available to return. - Items (`List`) ## PagingObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. ## PagingPlaylistObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingFeaturedPlaylistObject ### Properties - Message (`string`): The localized message of a playlist. - Playlists (`PagingPlaylistObject`) ## PagingArtistDiscographyAlbumObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingSimplifiedAlbumObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingSavedAlbumObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingSimplifiedTrackObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingSavedTrackObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingTrackObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingPlaylistTrackObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingSimplifiedShowObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingSavedShowObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingSimplifiedEpisodeObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingSavedEpisodeObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingSimplifiedAudiobookObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingArtistObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## PagingSimplifiedChapterObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## RecommendationsObject ### Properties - Seeds (`List`): An array of recommendation seed objects. - Tracks (`List`): An array of track objects ordered according to the parameters supplied. ## RecommendationSeedObject ### Properties - AfterFilteringSize (`int?`): The number of tracks available after min\_\* and max\_\* filters have been applied. - AfterRelinkingSize (`int?`): The number of tracks available after relinking for regional availability. - Href (`string`): A link to the full track or artist data for this seed. For tracks this will be a link to a Track Object. For artists a link to an Artist Object. For genre seeds, this value will be `null`. - Id (`string`): The id used to select this seed. This will be the same as the string used in the `seed_artists`, `seed_tracks` or `seed_genres` parameter. - InitialPoolSize (`int?`): The number of recommended tracks available for this seed. - Type (`string`): The entity type of this seed. One of `artist`, `track` or `genre`. ## SavedAlbumObject ### Properties - AddedAt (`DateTime?`): The date and time the album was saved Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ. If the time is imprecise (for example, the date/time of an album release), an additional field indicates the precision; see for example, release_date in an album object. - Album (`AlbumObject`): Information about the album. ## SavedTrackObject ### Properties - AddedAt (`DateTime?`): The date and time the track was saved. Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ. If the time is imprecise (for example, the date/time of an album release), an additional field indicates the precision; see for example, release_date in an album object. - Track (`TrackObject`): Information about the track. ## SavedEpisodeObject ### Properties - AddedAt (`DateTime?`): The date and time the episode was saved. Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ. - Episode (`EpisodeObject`): Information about the episode. ## SavedShowObject ### Properties - AddedAt (`DateTime?`): The date and time the show was saved. Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ. If the time is imprecise (for example, the date/time of an album release), an additional field indicates the precision; see for example, release_date in an album object. - Show (`ShowBase`): Information about the show. ## PlaylistObject ### Properties - Collaborative (`bool?`): `true` if the owner allows other users to modify the playlist. - Description (`string`): The playlist description. _Only returned for modified, verified playlists, otherwise_ `null`. - ExternalUrls (`ExternalUrlObject`): Known external URLs for this playlist. - Followers (`FollowersObject`): Information about the followers of the playlist. - Href (`string`): A link to the Web API endpoint providing full details of the playlist. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the playlist. - Images (`List`): Images for the playlist. The array may be empty or contain up to three images. The images are returned by size in descending order. See [Working with Playlists](/documentation/web-api/concepts/playlists). _**Note**: If returned, the source URL for the image (`url`) is temporary and will expire in less than a day._ - Name (`string`): The name of the playlist. - Owner (`PlaylistOwnerObject`): The user who owns the playlist - Public (`bool?`): The playlist's public/private status: `true` the playlist is public, `false` the playlist is private, `null` the playlist status is not relevant. For more about public/private status, see [Working with Playlists](/documentation/web-api/concepts/playlists) - SnapshotId (`string`): The version identifier for the current playlist. Can be supplied in other requests to target a specific playlist version - Tracks (`PagingPlaylistTrackObject`): The tracks of the playlist. - Type (`string`): The object type: "playlist" - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the playlist. ## SimplifiedPlaylistObject ### Properties - Collaborative (`bool?`): `true` if the owner allows other users to modify the playlist. - Description (`string`): The playlist description. _Only returned for modified, verified playlists, otherwise_ `null`. - ExternalUrls (`ExternalUrlObject`): Known external URLs for this playlist. - Href (`string`): A link to the Web API endpoint providing full details of the playlist. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the playlist. - Images (`List`): Images for the playlist. The array may be empty or contain up to three images. The images are returned by size in descending order. See [Working with Playlists](/documentation/web-api/concepts/playlists). _**Note**: If returned, the source URL for the image (`url`) is temporary and will expire in less than a day._ - Name (`string`): The name of the playlist. - Owner (`PlaylistOwnerObject`): The user who owns the playlist - Public (`bool?`): The playlist's public/private status: `true` the playlist is public, `false` the playlist is private, `null` the playlist status is not relevant. For more about public/private status, see [Working with Playlists](/documentation/web-api/concepts/playlists) - SnapshotId (`string`): The version identifier for the current playlist. Can be supplied in other requests to target a specific playlist version - Tracks (`PlaylistTracksRefObject`): A collection containing a link ( `href` ) to the Web API endpoint where full details of the playlist's tracks can be retrieved, along with the `total` number of tracks in the playlist. Note, a track object may be `null`. This can happen if a track is no longer available. - Type (`string`): The object type: "playlist" - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the playlist. ## PlaylistTracksRefObject ### Properties - Href (`string`): A link to the Web API endpoint where full details of the playlist's tracks can be retrieved. - Total (`int?`): Number of tracks in the playlist. ## PlaylistUserObject ### Properties - ExternalUrls (`ExternalUrlObject`): Known public external URLs for this user. - Followers (`FollowersObject`): Information about the followers of this user. - Href (`string`): A link to the Web API endpoint for this user. - Id (`string`): The [Spotify user ID](/documentation/web-api/concepts/spotify-uris-ids) for this user. - Type (`Type4Enum?`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for this user. ## PlaylistOwnerObject ### Properties - ExternalUrls (`ExternalUrlObject`): Known public external URLs for this user. - Followers (`FollowersObject`): Information about the followers of this user. - Href (`string`): A link to the Web API endpoint for this user. - Id (`string`): The [Spotify user ID](/documentation/web-api/concepts/spotify-uris-ids) for this user. - Type (`Type4Enum?`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for this user. - DisplayName (`string`): The name displayed on the user's profile. `null` if not available. ## CategoryObject ### Properties - Href (`string`): A link to the Web API endpoint returning full details of the category. - Icons (`List`): The category icon, in various sizes. - Id (`string`): The [Spotify category ID](/documentation/web-api/concepts/spotify-uris-ids) of the category. - Name (`string`): The name of the category. ## TrackObject ### Properties - Album (`SimplifiedAlbumObject`): The album on which the track appears. The album object includes a link in `href` to full information about the album. - Artists (`List`): The artists who performed the track. Each artist object includes a link in `href` to more detailed information about the artist. - AvailableMarkets (`List`): A list of the countries in which the track can be played, identified by their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. - DiscNumber (`int?`): The disc number (usually `1` unless the album consists of more than one disc). - DurationMs (`int?`): The track length in milliseconds. - Explicit (`bool?`): Whether or not the track has explicit lyrics ( `true` = yes it does; `false` = no it does not OR unknown). - ExternalIds (`ExternalIdObject`): Known external IDs for the track. - ExternalUrls (`ExternalUrlObject`): Known external URLs for this track. - Href (`string`): A link to the Web API endpoint providing full details of the track. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the track. - IsPlayable (`bool?`): Part of the response when [Track Relinking](/documentation/web-api/concepts/track-relinking) is applied. If `true`, the track is playable in the given market. Otherwise `false`. - LinkedFrom (`LinkedTrackObject`): Part of the response when [Track Relinking](/documentation/web-api/concepts/track-relinking) is applied, and the requested track has been replaced with different track. The track in the `linked_from` object contains information about the originally requested track. - Restrictions (`TrackRestrictionObject`): Included in the response when a content restriction is applied. - Name (`string`): The name of the track. - Popularity (`int?`): The popularity of the track. The value will be between 0 and 100, with 100 being the most popular.
The popularity of a track is a value between 0 and 100, with 100 being the most popular. The popularity is calculated by algorithm and is based, in the most part, on the total number of plays the track has had and how recent those plays are.
Generally speaking, songs that are being played a lot now will have a higher popularity than songs that were played a lot in the past. Duplicate tracks (e.g. the same track from a single and an album) are rated independently. Artist and album popularity is derived mathematically from track popularity. _**Note**: the popularity value may lag actual popularity by a few days: the value is not updated in real time._ - PreviewUrl (`string`): A link to a 30 second preview (MP3 format) of the track. Can be `null` - TrackNumber (`int?`): The number of the track. If an album has several discs, the track number is the number on the specified disc. - Type (`Type3Enum?`): The object type: "track". - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the track. - IsLocal (`bool?`): Whether or not the track is from a local file. ## EpisodeObject ### Properties - AudioPreviewUrl (`string`): A URL to a 30 second preview (MP3 format) of the episode. `null` if not available. - Description (`string`): A description of the episode. HTML tags are stripped away from this field, use `html_description` field in case HTML tags are needed. - HtmlDescription (`string`): A description of the episode. This field may contain HTML tags. - DurationMs (`int`): The episode length in milliseconds. - Explicit (`bool`): Whether or not the episode has explicit content (true = yes it does; false = no it does not OR unknown). - ExternalUrls (`ExternalUrlObject`): External URLs for this episode. - Href (`string`): A link to the Web API endpoint providing full details of the episode. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the episode. - Images (`List`): The cover art for the episode in various sizes, widest first. - IsExternallyHosted (`bool`): True if the episode is hosted outside of Spotify's CDN. - IsPlayable (`bool`): True if the episode is playable in the given market. Otherwise false. - Language (`string`): The language used in the episode, identified by a [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code. This field is deprecated and might be removed in the future. Please use the `languages` field instead. - Languages (`List`): A list of the languages used in the episode, identified by their [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639) code. - Name (`string`): The name of the episode. - ReleaseDate (`string`): The date the episode was first released, for example `"1981-12-15"`. Depending on the precision, it might be shown as `"1981"` or `"1981-12"`. - ReleaseDatePrecision (`ReleaseDatePrecisionEnum`): The precision with which `release_date` value is known. - ResumePoint (`ResumePointObject`): The user's most recent position in the episode. Set if the supplied access token is a user token and has the scope 'user-read-playback-position'. - Type (`Type5Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the episode. - Restrictions (`EpisodeRestrictionObject`): Included in the response when a content restriction is applied. - Show (`ShowBase`): The show on which the episode belongs. ## EpisodeBase ### Properties - AudioPreviewUrl (`string`): A URL to a 30 second preview (MP3 format) of the episode. `null` if not available. - Description (`string`): A description of the episode. HTML tags are stripped away from this field, use `html_description` field in case HTML tags are needed. - HtmlDescription (`string`): A description of the episode. This field may contain HTML tags. - DurationMs (`int`): The episode length in milliseconds. - Explicit (`bool`): Whether or not the episode has explicit content (true = yes it does; false = no it does not OR unknown). - ExternalUrls (`ExternalUrlObject`): External URLs for this episode. - Href (`string`): A link to the Web API endpoint providing full details of the episode. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the episode. - Images (`List`): The cover art for the episode in various sizes, widest first. - IsExternallyHosted (`bool`): True if the episode is hosted outside of Spotify's CDN. - IsPlayable (`bool`): True if the episode is playable in the given market. Otherwise false. - Language (`string`): The language used in the episode, identified by a [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code. This field is deprecated and might be removed in the future. Please use the `languages` field instead. - Languages (`List`): A list of the languages used in the episode, identified by their [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639) code. - Name (`string`): The name of the episode. - ReleaseDate (`string`): The date the episode was first released, for example `"1981-12-15"`. Depending on the precision, it might be shown as `"1981"` or `"1981-12"`. - ReleaseDatePrecision (`ReleaseDatePrecisionEnum`): The precision with which `release_date` value is known. - ResumePoint (`ResumePointObject`): The user's most recent position in the episode. Set if the supplied access token is a user token and has the scope 'user-read-playback-position'. - Type (`Type5Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the episode. - Restrictions (`EpisodeRestrictionObject`): Included in the response when a content restriction is applied. ## ResumePointObject ### Properties - FullyPlayed (`bool?`): Whether or not the episode has been fully played by the user. - ResumePositionMs (`int?`): The user's most recent position in the episode in milliseconds. ## ShowBase ### Properties - AvailableMarkets (`List`): A list of the countries in which the show can be played, identified by their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. - Copyrights (`List`): The copyright statements of the show. - Description (`string`): A description of the show. HTML tags are stripped away from this field, use `html_description` field in case HTML tags are needed. - HtmlDescription (`string`): A description of the show. This field may contain HTML tags. - Explicit (`bool`): Whether or not the show has explicit content (true = yes it does; false = no it does not OR unknown). - ExternalUrls (`ExternalUrlObject`): External URLs for this show. - Href (`string`): A link to the Web API endpoint providing full details of the show. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the show. - Images (`List`): The cover art for the show in various sizes, widest first. - IsExternallyHosted (`bool`): True if all of the shows episodes are hosted outside of Spotify's CDN. This field might be `null` in some cases. - Languages (`List`): A list of the languages used in the show, identified by their [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code. - MediaType (`string`): The media type of the show. - Name (`string`): The name of the episode. - Publisher (`string`): The publisher of the show. - Type (`Type6Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the show. - TotalEpisodes (`int`): The total number of episodes in the show. ## ShowObject ### Properties - AvailableMarkets (`List`): A list of the countries in which the show can be played, identified by their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. - Copyrights (`List`): The copyright statements of the show. - Description (`string`): A description of the show. HTML tags are stripped away from this field, use `html_description` field in case HTML tags are needed. - HtmlDescription (`string`): A description of the show. This field may contain HTML tags. - Explicit (`bool`): Whether or not the show has explicit content (true = yes it does; false = no it does not OR unknown). - ExternalUrls (`ExternalUrlObject`): External URLs for this show. - Href (`string`): A link to the Web API endpoint providing full details of the show. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the show. - Images (`List`): The cover art for the show in various sizes, widest first. - IsExternallyHosted (`bool`): True if all of the shows episodes are hosted outside of Spotify's CDN. This field might be `null` in some cases. - Languages (`List`): A list of the languages used in the show, identified by their [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code. - MediaType (`string`): The media type of the show. - Name (`string`): The name of the episode. - Publisher (`string`): The publisher of the show. - Type (`Type6Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the show. - TotalEpisodes (`int`): The total number of episodes in the show. - Episodes (`PagingSimplifiedEpisodeObject`): The episodes of the show. ## AudiobookBase ### Properties - Authors (`List`): The author(s) for the audiobook. - AvailableMarkets (`List`): A list of the countries in which the audiobook can be played, identified by their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. - Copyrights (`List`): The copyright statements of the audiobook. - Description (`string`): A description of the audiobook. HTML tags are stripped away from this field, use `html_description` field in case HTML tags are needed. - HtmlDescription (`string`): A description of the audiobook. This field may contain HTML tags. - Edition (`string`): The edition of the audiobook. - Explicit (`bool`): Whether or not the audiobook has explicit content (true = yes it does; false = no it does not OR unknown). - ExternalUrls (`ExternalUrlObject`): External URLs for this audiobook. - Href (`string`): A link to the Web API endpoint providing full details of the audiobook. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the audiobook. - Images (`List`): The cover art for the audiobook in various sizes, widest first. - Languages (`List`): A list of the languages used in the audiobook, identified by their [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code. - MediaType (`string`): The media type of the audiobook. - Name (`string`): The name of the audiobook. - Narrators (`List`): The narrator(s) for the audiobook. - Publisher (`string`): The publisher of the audiobook. - Type (`Type9Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the audiobook. - TotalChapters (`int`): The number of chapters in this audiobook. ## AudiobookObject ### Properties - Authors (`List`): The author(s) for the audiobook. - AvailableMarkets (`List`): A list of the countries in which the audiobook can be played, identified by their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. - Copyrights (`List`): The copyright statements of the audiobook. - Description (`string`): A description of the audiobook. HTML tags are stripped away from this field, use `html_description` field in case HTML tags are needed. - HtmlDescription (`string`): A description of the audiobook. This field may contain HTML tags. - Edition (`string`): The edition of the audiobook. - Explicit (`bool`): Whether or not the audiobook has explicit content (true = yes it does; false = no it does not OR unknown). - ExternalUrls (`ExternalUrlObject`): External URLs for this audiobook. - Href (`string`): A link to the Web API endpoint providing full details of the audiobook. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the audiobook. - Images (`List`): The cover art for the audiobook in various sizes, widest first. - Languages (`List`): A list of the languages used in the audiobook, identified by their [ISO 639](https://en.wikipedia.org/wiki/ISO_639) code. - MediaType (`string`): The media type of the audiobook. - Name (`string`): The name of the audiobook. - Narrators (`List`): The narrator(s) for the audiobook. - Publisher (`string`): The publisher of the audiobook. - Type (`Type9Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the audiobook. - TotalChapters (`int`): The number of chapters in this audiobook. - Chapters (`PagingSimplifiedChapterObject`): The chapters of the audiobook. ## AlbumBase ### Properties - AlbumType (`AlbumTypeEnum`): The type of the album. - TotalTracks (`int`): The number of tracks in the album. - AvailableMarkets (`List`): The markets in which the album is available: [ISO 3166-1 alpha-2 country codes](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). _**NOTE**: an album is considered available in a market when at least 1 of its tracks is available in that market._ - ExternalUrls (`ExternalUrlObject`): Known external URLs for this album. - Href (`string`): A link to the Web API endpoint providing full details of the album. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the album. - Images (`List`): The cover art for the album in various sizes, widest first. - Name (`string`): The name of the album. In case of an album takedown, the value may be an empty string. - ReleaseDate (`string`): The date the album was first released. - ReleaseDatePrecision (`ReleaseDatePrecisionEnum`): The precision with which `release_date` value is known. - Restrictions (`AlbumRestrictionObject`): Included in the response when a content restriction is applied. - Type (`Type2Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the album. ## SimplifiedAlbumObject ### Properties - AlbumType (`AlbumTypeEnum`): The type of the album. - TotalTracks (`int`): The number of tracks in the album. - AvailableMarkets (`List`): The markets in which the album is available: [ISO 3166-1 alpha-2 country codes](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). _**NOTE**: an album is considered available in a market when at least 1 of its tracks is available in that market._ - ExternalUrls (`ExternalUrlObject`): Known external URLs for this album. - Href (`string`): A link to the Web API endpoint providing full details of the album. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the album. - Images (`List`): The cover art for the album in various sizes, widest first. - Name (`string`): The name of the album. In case of an album takedown, the value may be an empty string. - ReleaseDate (`string`): The date the album was first released. - ReleaseDatePrecision (`ReleaseDatePrecisionEnum`): The precision with which `release_date` value is known. - Restrictions (`AlbumRestrictionObject`): Included in the response when a content restriction is applied. - Type (`Type2Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the album. - Artists (`List`): The artists of the album. Each artist object includes a link in `href` to more detailed information about the artist. ## ArtistDiscographyAlbumObject ### Properties - AlbumType (`AlbumTypeEnum`): The type of the album. - TotalTracks (`int`): The number of tracks in the album. - AvailableMarkets (`List`): The markets in which the album is available: [ISO 3166-1 alpha-2 country codes](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). _**NOTE**: an album is considered available in a market when at least 1 of its tracks is available in that market._ - ExternalUrls (`ExternalUrlObject`): Known external URLs for this album. - Href (`string`): A link to the Web API endpoint providing full details of the album. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the album. - Images (`List`): The cover art for the album in various sizes, widest first. - Name (`string`): The name of the album. In case of an album takedown, the value may be an empty string. - ReleaseDate (`string`): The date the album was first released. - ReleaseDatePrecision (`ReleaseDatePrecisionEnum`): The precision with which `release_date` value is known. - Restrictions (`AlbumRestrictionObject`): Included in the response when a content restriction is applied. - Type (`Type2Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the album. - Artists (`List`): The artists of the album. Each artist object includes a link in `href` to more detailed information about the artist. - AlbumGroup (`AlbumGroupEnum`): This field describes the relationship between the artist and the album. ## ChapterObject ### Properties - AudioPreviewUrl (`string`): A URL to a 30 second preview (MP3 format) of the chapter. `null` if not available. - AvailableMarkets (`List`): A list of the countries in which the chapter can be played, identified by their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. - ChapterNumber (`int`): The number of the chapter - Description (`string`): A description of the chapter. HTML tags are stripped away from this field, use `html_description` field in case HTML tags are needed. - HtmlDescription (`string`): A description of the chapter. This field may contain HTML tags. - DurationMs (`int`): The chapter length in milliseconds. - Explicit (`bool`): Whether or not the chapter has explicit content (true = yes it does; false = no it does not OR unknown). - ExternalUrls (`ExternalUrlObject`): External URLs for this chapter. - Href (`string`): A link to the Web API endpoint providing full details of the chapter. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the chapter. - Images (`List`): The cover art for the chapter in various sizes, widest first. - IsPlayable (`bool`): True if the chapter is playable in the given market. Otherwise false. - Languages (`List`): A list of the languages used in the chapter, identified by their [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639) code. - Name (`string`): The name of the chapter. - ReleaseDate (`string`): The date the chapter was first released, for example `"1981-12-15"`. Depending on the precision, it might be shown as `"1981"` or `"1981-12"`. - ReleaseDatePrecision (`ReleaseDatePrecisionEnum`): The precision with which `release_date` value is known. - ResumePoint (`ResumePointObject`): The user's most recent position in the chapter. Set if the supplied access token is a user token and has the scope 'user-read-playback-position'. - Type (`Type5Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the chapter. - Restrictions (`ChapterRestrictionObject`): Included in the response when a content restriction is applied. - Audiobook (`AudiobookBase`): The audiobook for which the chapter belongs. ## ChapterBase ### Properties - AudioPreviewUrl (`string`): A URL to a 30 second preview (MP3 format) of the chapter. `null` if not available. - AvailableMarkets (`List`): A list of the countries in which the chapter can be played, identified by their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. - ChapterNumber (`int`): The number of the chapter - Description (`string`): A description of the chapter. HTML tags are stripped away from this field, use `html_description` field in case HTML tags are needed. - HtmlDescription (`string`): A description of the chapter. This field may contain HTML tags. - DurationMs (`int`): The chapter length in milliseconds. - Explicit (`bool`): Whether or not the chapter has explicit content (true = yes it does; false = no it does not OR unknown). - ExternalUrls (`ExternalUrlObject`): External URLs for this chapter. - Href (`string`): A link to the Web API endpoint providing full details of the chapter. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the chapter. - Images (`List`): The cover art for the chapter in various sizes, widest first. - IsPlayable (`bool`): True if the chapter is playable in the given market. Otherwise false. - Languages (`List`): A list of the languages used in the chapter, identified by their [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639) code. - Name (`string`): The name of the chapter. - ReleaseDate (`string`): The date the chapter was first released, for example `"1981-12-15"`. Depending on the precision, it might be shown as `"1981"` or `"1981-12"`. - ReleaseDatePrecision (`ReleaseDatePrecisionEnum`): The precision with which `release_date` value is known. - ResumePoint (`ResumePointObject`): The user's most recent position in the chapter. Set if the supplied access token is a user token and has the scope 'user-read-playback-position'. - Type (`Type5Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the chapter. - Restrictions (`ChapterRestrictionObject`): Included in the response when a content restriction is applied. ## AlbumObject ### Properties - AlbumType (`AlbumTypeEnum`): The type of the album. - TotalTracks (`int`): The number of tracks in the album. - AvailableMarkets (`List`): The markets in which the album is available: [ISO 3166-1 alpha-2 country codes](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). _**NOTE**: an album is considered available in a market when at least 1 of its tracks is available in that market._ - ExternalUrls (`ExternalUrlObject`): Known external URLs for this album. - Href (`string`): A link to the Web API endpoint providing full details of the album. - Id (`string`): The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) for the album. - Images (`List`): The cover art for the album in various sizes, widest first. - Name (`string`): The name of the album. In case of an album takedown, the value may be an empty string. - ReleaseDate (`string`): The date the album was first released. - ReleaseDatePrecision (`ReleaseDatePrecisionEnum`): The precision with which `release_date` value is known. - Restrictions (`AlbumRestrictionObject`): Included in the response when a content restriction is applied. - Type (`Type2Enum`): The object type. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the album. - Artists (`List`): The artists of the album. Each artist object includes a link in `href` to more detailed information about the artist. - Tracks (`PagingSimplifiedTrackObject`): The tracks of the album. - Copyrights (`List`): The copyright statements of the album. - ExternalIds (`ExternalIdObject`): Known external IDs for the album. - Genres (`List`): A list of the genres the album is associated with. If not yet classified, the array is empty. - Label (`string`): The label associated with the album. - Popularity (`int`): The popularity of the album. The value will be between 0 and 100, with 100 being the most popular. ## ContextObject ### Properties - Type (`string`): The object type, e.g. "artist", "playlist", "album", "show". - Href (`string`): A link to the Web API endpoint providing full details of the track. - ExternalUrls (`ExternalUrlObject`): External URLs for this context. - Uri (`string`): The [Spotify URI](/documentation/web-api/concepts/spotify-uris-ids) for the context. ## CopyrightObject ### Properties - Text (`string`): The copyright text for this content. - Type (`string`): The type of copyright: `C` = the copyright, `P` = the sound recording (performance) copyright. ## AuthorObject ### Properties - Name (`string`): The name of the author. ## NarratorObject ### Properties - Name (`string`): The name of the Narrator. ## ExternalIdObject ### Properties - Isrc (`string`): [International Standard Recording Code](http://en.wikipedia.org/wiki/International_Standard_Recording_Code) - Ean (`string`): [International Article Number](http://en.wikipedia.org/wiki/International_Article_Number_%28EAN%29) - Upc (`string`): [Universal Product Code](http://en.wikipedia.org/wiki/Universal_Product_Code) ## ExternalUrlObject ### Properties - Spotify (`string`): The [Spotify URL](/documentation/web-api/concepts/spotify-uris-ids) for the object. ## FollowersObject ### Properties - Href (`string`): This will always be set to null, as the Web API does not support it at the moment. - Total (`int?`): The total number of followers. ## ImageObject ### Properties - Url (`string`): The source URL of the image. - Height (`int?`): The image height in pixels. - Width (`int?`): The image width in pixels. ## ExplicitContentSettingsObject ### Properties - FilterEnabled (`bool?`): When `true`, indicates that explicit content should not be played. - FilterLocked (`bool?`): When `true`, indicates that the explicit content setting is locked and can't be changed by the user. ## CurrentlyPlayingObject ### Properties - Context (`ContextObject`): A Context Object. Can be `null`. - Timestamp (`long?`): Unix Millisecond Timestamp when data was fetched - ProgressMs (`int?`): Progress into the currently playing track or episode. Can be `null`. - IsPlaying (`bool?`): If something is currently playing, return `true`. - Item (`CurrentlyPlayingObjectItem`): The currently playing track or episode. Can be `null`. - CurrentlyPlayingType (`string`): The object type of the currently playing item. Can be one of `track`, `episode`, `ad` or `unknown`. - Actions (`DisallowsObject`): Allows to update the user interface based on which playback actions are available within the current context. ## SavedAudiobookObject ### Properties - AddedAt (`DateTime?`): The date and time the audiobook was saved Timestamps are returned in ISO 8601 format as Coordinated Universal Time (UTC) with a zero offset: YYYY-MM-DDTHH:MM:SSZ. If the time is imprecise (for example, the date/time of an album release), an additional field indicates the precision; see for example, release_date in an album object. - Audiobook (`AudiobookObject`): Information about the audiobook. ## PagingSavedAudiobookObject ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## AlbumGroupEnum This field describes the relationship between the artist and the album. ### Properties - album - single - compilation - appears_on ## AlbumTypeEnum The type of the album. ### Properties - album - single - compilation ## Categories ### Properties - Href (`string`): A link to the Web API endpoint returning the full result of the request - Limit (`int`): The maximum number of items in the response (as set in the query or by default). - Next (`string`): URL to the next page of items. ( `null` if none) - Offset (`int`): The offset of the items returned (as set in the query or by default) - Previous (`string`): URL to the previous page of items. ( `null` if none) - Total (`int`): The total number of items available to return. - Items (`List`) ## CursorPagedArtists ### Properties - Artists (`CursorPagingSimplifiedArtistObject`) ## IncludeExternalEnum If `include_external=audio` is specified it signals that the client can play externally hosted audio content, and marks the content as playable in the response. By default externally hosted audio content is marked as unplayable in the response. ### Properties - audio ## ItemTypeEnum ### Properties - album - artist - playlist - track - show - episode - audiobook ## ItemType1Enum The ID type: currently only `artist` is supported. ### Properties - artist ## ItemType2Enum The ID type. ### Properties - artist - user ## ItemType3Enum The ID type: either `artist` or `user`. ### Properties - artist - user ## ManyAlbums ### Properties - Albums (`List`) ## ManyArtists ### Properties - Artists (`List`) ## ManyAudiobooks ### Properties - Audiobooks (`List`) ## ManyAudioFeatures ### Properties - AudioFeatures (`List`) ## ManyChapters ### Properties - Chapters (`List`) ## ManyDevices ### Properties - Devices (`List`) ## ManyEpisodes ### Properties - Episodes (`List`) ## ManyGenres ### Properties - Genres (`List`) ## ManySimplifiedShows ### Properties - Shows (`List`) ## ManyTracks ### Properties - Tracks (`List`) ## Markets ### Properties - Markets (`List`) ## MeAlbumsRequest ### Properties - Ids (`List`): A JSON array of the [Spotify IDs](/documentation/web-api/concepts/spotify-uris-ids). For example: `["4iV5W9uYEdYUVa79Axb7Rh", "1301WleyT98MSxVHPZCA6M"]`
A maximum of 50 items can be specified in one request. _**Note**: if the `ids` parameter is present in the query string, any IDs listed here in the body will be ignored._ ## MeEpisodesRequest ### Properties - Ids (`List`): A JSON array of the [Spotify IDs](/documentation/web-api/concepts/spotify-uris-ids).
A maximum of 50 items can be specified in one request. _**Note**: if the `ids` parameter is present in the query string, any IDs listed here in the body will be ignored._ ## MeEpisodesRequest1 ### Properties - Ids (`List`): A JSON array of the [Spotify IDs](/documentation/web-api/concepts/spotify-uris-ids).
A maximum of 50 items can be specified in one request. _**Note**: if the `ids` parameter is present in the query string, any IDs listed here in the body will be ignored._ ## MeFollowingRequest ### Properties - Ids (`List`): A JSON array of the artist or user [Spotify IDs](/documentation/web-api/concepts/spotify-uris-ids). For example: `{ids:["74ASZWbe4lXaubB36ztrGX", "08td7MxkoHQkXnWAYD8d6Q"]}`. A maximum of 50 IDs can be sent in one request. _**Note**: if the `ids` parameter is present in the query string, any IDs listed here in the body will be ignored._ ## MeFollowingRequest1 ### Properties - Ids (`List`): A JSON array of the artist or user [Spotify IDs](/documentation/web-api/concepts/spotify-uris-ids). For example: `{ids:["74ASZWbe4lXaubB36ztrGX", "08td7MxkoHQkXnWAYD8d6Q"]}`. A maximum of 50 IDs can be sent in one request. _**Note**: if the `ids` parameter is present in the query string, any IDs listed here in the body will be ignored._ ## MePlayerPlayRequest ### Properties - ContextUri (`string`): Optional. Spotify URI of the context to play. Valid contexts are albums, artists & playlists. `{context_uri:"spotify:album:1Je1IMUlBXcx1Fz0WE7oPT"}` - Uris (`List`): Optional. A JSON array of the Spotify track URIs to play. For example: `{"uris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]}` - Offset (`object`): Optional. Indicates from where in the context playback should start. Only available when context_uri corresponds to an album or playlist object "position" is zero based and can’t be negative. Example: `"offset": {"position": 5}` "uri" is a string representing the uri of the item to start at. Example: `"offset": {"uri": "spotify:track:1301WleyT98MSxVHPZCA6M"}` - PositionMs (`int?`): Indicates from what position to start playback. Must be a positive number. Passing in a position that is greater than the length of the track will cause the player to start playing the next song. ## MePlayerRequest ### Properties - DeviceIds (`List`): A JSON array containing the ID of the device on which playback should be started/transferred.
For example:`{device_ids:["74ASZWbe4lXaubB36ztrGX"]}`
_**Note**: Although an array is accepted, only a single device_id is currently supported. Supplying more than one will return `400 Bad Request`_ - Play (`bool?`): **true**: ensure playback happens on new device.
**false** or not provided: keep the current playback state. ## MeShowsRequest ### Properties - Ids (`List`): A JSON array of the [Spotify IDs](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids). A maximum of 50 items can be specified in one request. *Note: if the `ids` parameter is present in the query string, any IDs listed here in the body will be ignored.* ## MeTracksRequest ### Properties - Ids (`List`): A JSON array of the [Spotify IDs](/documentation/web-api/concepts/spotify-uris-ids). For example: `["4iV5W9uYEdYUVa79Axb7Rh", "1301WleyT98MSxVHPZCA6M"]`
A maximum of 50 items can be specified in one request. _**Note**: if the `ids` parameter is present in the query string, any IDs listed here in the body will be ignored._ ## MeTracksRequest1 ### Properties - Ids (`List`): A JSON array of the [Spotify IDs](/documentation/web-api/concepts/spotify-uris-ids). For example: `["4iV5W9uYEdYUVa79Axb7Rh", "1301WleyT98MSxVHPZCA6M"]`
A maximum of 50 items can be specified in one request. _**Note**: if the `ids` parameter is present in the query string, any IDs listed here in the body will be ignored._ ## Meta ### Properties - AnalyzerVersion (`string`): The version of the Analyzer used to analyze this track. - Platform (`string`): The platform used to read the track's audio data. - DetailedStatus (`string`): A detailed status code for this track. If analysis data is missing, this code may explain why. - StatusCode (`int?`): The return code of the analyzer process. 0 if successful, 1 if any errors occurred. - Timestamp (`long?`): The Unix timestamp (in seconds) at which this track was analyzed. - AnalysisTime (`double?`): The amount of time taken to analyze this track. - InputProcess (`string`): The method used to read the track's audio data. ## ModeEnum Indicates the modality (major or minor) of a section, the type of scale from which its melodic content is derived. This field will contain a 0 for "minor", a 1 for "major", or a -1 for no result. Note that the major key (e.g. C major) could more likely be confused with the minor key at 3 semitones lower (e.g. A minor) as both keys carry the same pitches. ### Properties - Enum_Minus1 - Enum_0 - Enum_1 ## PagedAlbums ### Properties - Albums (`PagingSimplifiedAlbumObject`) ## PagedCategories ### Properties - Categories (`Categories`) ## PlaylistsFollowersRequest ### Properties - Public (`bool?`): Defaults to `true`. If `true` the playlist will be included in user's public playlists, if `false` it will remain private. ## PlaylistsRequest ### Properties - Name (`string`): The new name for the playlist, for example `"My New Playlist Title"` - Public (`bool?`): If `true` the playlist will be public, if `false` it will be private. - Collaborative (`bool?`): If `true`, the playlist will become collaborative and other users will be able to modify the playlist in their Spotify client.
_**Note**: You can only set `collaborative` to `true` on non-public playlists._ - Description (`string`): Value for playlist description as displayed in Spotify Clients and in the Web API. ## PlaylistsTracksRequest ### Properties - Uris (`List`): A JSON array of the [Spotify URIs](/documentation/web-api/concepts/spotify-uris-ids) to add. For example: `{"uris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh","spotify:track:1301WleyT98MSxVHPZCA6M", "spotify:episode:512ojhOuo1ktJprKbVcKyQ"]}`
A maximum of 100 items can be added in one request. _**Note**: if the `uris` parameter is present in the query string, any URIs listed here in the body will be ignored._ - Position (`int?`): The position to insert the items, a zero-based index. For example, to insert the items in the first position: `position=0` ; to insert the items in the third position: `position=2`. If omitted, the items will be appended to the playlist. Items are added in the order they appear in the uris array. For example: `{"uris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh","spotify:track:1301WleyT98MSxVHPZCA6M"], "position": 3}` ## PlaylistsTracksRequest1 ### Properties - Uris (`List`) - RangeStart (`int?`): The position of the first item to be reordered. - InsertBefore (`int?`): The position where the items should be inserted.
To reorder the items to the end of the playlist, simply set _insert_before_ to the position after the last item.
Examples:
To reorder the first item to the last position in a playlist with 10 items, set _range_start_ to 0, and _insert_before_ to 10.
To reorder the last item in a playlist with 10 items to the start of the playlist, set _range_start_ to 9, and _insert_before_ to 0. - RangeLength (`int?`): The amount of items to be reordered. Defaults to 1 if not set.
The range of items to be reordered begins from the _range_start_ position, and includes the _range_length_ subsequent items.
Example:
To move the items at index 9-10 to the start of the playlist, _range_start_ is set to 9, and _range_length_ is set to 2. - SnapshotId (`string`): The playlist's snapshot ID against which you want to make the changes. ## PlaylistsTracksRequest2 ### Properties - Tracks (`List`): An array of objects containing [Spotify URIs](/documentation/web-api/concepts/spotify-uris-ids) of the tracks or episodes to remove. For example: `{ "tracks": [{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" },{ "uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }] }`. A maximum of 100 objects can be sent at once. - SnapshotId (`string`): The playlist's snapshot ID against which you want to make the changes. The API will validate that the specified items exist and in the specified positions and make the changes, even if more recent changes have been made to the playlist. ## PlaylistSnapshotId ### Properties - SnapshotId (`string`) ## ReasonEnum The reason for the restriction. Albums may be restricted if the content is not available in a given market, to the user's subscription type, or when the user's account is set to not play explicit content. Additional reasons may be added in the future. ### Properties - market - product - explicit ## ReleaseDatePrecisionEnum The precision with which `release_date` value is known. ### Properties - year - month - day ## SearchItems ### Properties - Tracks (`PagingTrackObject`) - Artists (`PagingArtistObject`) - Albums (`PagingSimplifiedAlbumObject`) - Playlists (`PagingPlaylistObject`) - Shows (`PagingSimplifiedShowObject`) - Episodes (`PagingSimplifiedEpisodeObject`) - Audiobooks (`PagingSimplifiedAudiobookObject`) ## Track ### Properties - NumSamples (`int?`): The exact number of audio samples analyzed from this track. See also `analysis_sample_rate`. - Duration (`double?`): Length of the track in seconds. - SampleMd5 (`string`): This field will always contain the empty string. - OffsetSeconds (`int?`): An offset to the start of the region of the track that was analyzed. (As the entire track is analyzed, this should always be 0.) - WindowSeconds (`int?`): The length of the region of the track was analyzed, if a subset of the track was analyzed. (As the entire track is analyzed, this should always be 0.) - AnalysisSampleRate (`int?`): The sample rate used to decode and analyze this track. May differ from the actual sample rate of this track available on Spotify. - AnalysisChannels (`int?`): The number of channels used for analysis. If 1, all channels are summed together to mono before analysis. - EndOfFadeIn (`double?`): The time, in seconds, at which the track's fade-in period ends. If the track has no fade-in, this will be 0.0. - StartOfFadeOut (`double?`): The time, in seconds, at which the track's fade-out period starts. If the track has no fade-out, this should match the track's length. - Loudness (`double?`): The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of tracks. Loudness is the quality of a sound that is the primary psychological correlate of physical strength (amplitude). Values typically range between -60 and 0 db. - Tempo (`double?`): The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration. - TempoConfidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the `tempo`. - TimeSignature (`int?`): An estimated time signature. The time signature (meter) is a notational convention to specify how many beats are in each bar (or measure). The time signature ranges from 3 to 7 indicating time signatures of "3/4", to "7/4". - TimeSignatureConfidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the `time_signature`. - Key (`int?`): The key the track is in. Integers map to pitches using standard [Pitch Class notation](https://en.wikipedia.org/wiki/Pitch_class). E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on. If no key was detected, the value is -1. - KeyConfidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the `key`. - Mode (`int?`): Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0. - ModeConfidence (`double?`): The confidence, from 0.0 to 1.0, of the reliability of the `mode`. - Codestring (`string`): An [Echo Nest Musical Fingerprint (ENMFP)](https://academiccommons.columbia.edu/doi/10.7916/D8Q248M4) codestring for this track. - CodeVersion (`double?`): A version number for the Echo Nest Musical Fingerprint format used in the codestring field. - Echoprintstring (`string`): An [EchoPrint](https://github.com/spotify/echoprint-codegen) codestring for this track. - EchoprintVersion (`double?`): A version number for the EchoPrint format used in the echoprintstring field. - Synchstring (`string`): A [Synchstring](https://github.com/echonest/synchdata) for this track. - SynchVersion (`double?`): A version number for the Synchstring used in the synchstring field. - Rhythmstring (`string`): A Rhythmstring for this track. The format of this string is similar to the Synchstring. - RhythmVersion (`double?`): A version number for the Rhythmstring used in the rhythmstring field. ## Track1 ### Properties - Uri (`string`): Spotify URI ## TypeEnum The object type. ### Properties - artist ## Type2Enum The object type. ### Properties - album ## Type3Enum The object type: "track". ### Properties - track ## Type4Enum The object type. ### Properties - user ## Type5Enum The object type. ### Properties - episode ## Type6Enum The object type. ### Properties - show ## Type8Enum The object type. ### Properties - audio_features ## Type9Enum The object type. ### Properties - audiobook ## UsersPlaylistsRequest ### Properties - Name (`string`): The name for the new playlist, for example `"Your Coolest Playlist"`. This name does not need to be unique; a user may have several playlists with the same name. - Public (`bool?`): Defaults to `true`. If `true` the playlist will be public, if `false` it will be private. To be able to create private playlists, the user must have granted the `playlist-modify-private` [scope](/documentation/web-api/concepts/scopes/#list-of-scopes) - Collaborative (`bool?`): Defaults to `false`. If `true` the playlist will be collaborative. _**Note**: to create a collaborative playlist you must also set `public` to `false`. To create collaborative playlists you must have granted `playlist-modify-private` and `playlist-modify-public` [scopes](/documentation/web-api/concepts/scopes/#list-of-scopes)._ - Description (`string`): value for playlist description as displayed in Spotify Clients and in the Web API. ## OAuthToken OAuth 2 Authorization endpoint response ### Properties - AccessToken (`string`): Access token - TokenType (`string`): Type of access token - ExpiresIn (`long?`): Time in seconds before the access token expires - Scope (`string`): List of scopes granted This is a space-delimited list of strings. - Expiry (`long?`): Time of token expiry as unix timestamp (UTC) - RefreshToken (`string`): Refresh token Used to get a new access token when it expires. ## OAuthProviderErrorEnum OAuth 2 Authorization error codes ### Properties - invalid_request - invalid_client - invalid_grant - unauthorized_client - unsupported_grant_type - invalid_scope ## OAuthScopeEnum OAuth 2 scopes supported by the API ### Properties - app-remote-control - playlist-read-private - playlist-read-collaborative - playlist-modify-public - playlist-modify-private - user-library-read - user-library-modify - user-read-private - user-read-email - user-follow-read - user-follow-modify - user-top-read - user-read-playback-position - user-read-playback-state - user-read-recently-played - user-read-currently-playing - user-modify-playback-state - ugc-image-upload - streaming ## PlaylistTrackObjectTrack This is a container for OneOf cases. ### Cases #### `TrackObject` Initialization Code: ```CSharp PlaylistTrackObjectTrack value = PlaylistTrackObjectTrack.FromTrackObject( new TrackObject { } ); ``` #### `EpisodeObject` Initialization Code: ```CSharp PlaylistTrackObjectTrack value = PlaylistTrackObjectTrack.FromEpisodeObject( new EpisodeObject { AudioPreviewUrl = "https://p.scdn.co/mp3-preview/2f37da1d4221f40b9d1a98cd191f4d6f1646ad17", Description = "A Spotify podcast sharing fresh insights on important topics of the moment—in a way only Spotify can. You’ll hear from experts in the music, podcast and tech industries as we discover and uncover stories about our work and the world around us.\n", HtmlDescription = "

A Spotify podcast sharing fresh insights on important topics of the moment—in a way only Spotify can. You’ll hear from experts in the music, podcast and tech industries as we discover and uncover stories about our work and the world around us.

\n", DurationMs = 1686230, MExplicit = false, ExternalUrls = new ExternalUrlObject { }, Href = "https://api.spotify.com/v1/episodes/5Xt5DXGzch68nYYamXrNxZ", Id = "5Xt5DXGzch68nYYamXrNxZ", Images = new List { new ImageObject { Url = "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n", Height = 300, Width = 300, }, }, IsExternallyHosted = false, IsPlayable = false, Languages = new List { "fr", "en", }, Name = "Starting Your Own Podcast: Tips, Tricks, and Advice From Anchor Creators\n", ReleaseDate = "1981-12-15", ReleaseDatePrecision = ReleaseDatePrecisionEnum.Day, Type = Type5Enum.Episode, Uri = "spotify:episode:0zLhl3WsOCQHbe1BPTiHgr", Show = new ShowBase { AvailableMarkets = new List { "available_markets0", "available_markets1", "available_markets2", }, Copyrights = new List { new CopyrightObject { }, }, Description = "description4", HtmlDescription = "html_description4", MExplicit = false, ExternalUrls = new ExternalUrlObject { }, Href = "href8", Id = "id6", Images = new List { new ImageObject { Url = "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n", Height = 300, Width = 300, }, }, IsExternallyHosted = false, Languages = new List { "languages7", "languages6", "languages5", }, MediaType = "media_type6", Name = "name6", Publisher = "publisher6", Type = Type6Enum.Show, Uri = "uri0", TotalEpisodes = 198, }, Language = "en", } ); ``` ### Utilization Code ```CSharp value.Match( trackObject: @case => { Console.WriteLine(@case); return null; }, episodeObject: @case => { Console.WriteLine(@case); return null; }) ``` ## QueueObjectCurrentlyPlaying This is a container for OneOf cases. ### Cases #### `TrackObject` Initialization Code: ```CSharp QueueObjectCurrentlyPlaying value = QueueObjectCurrentlyPlaying.FromTrackObject( new TrackObject { } ); ``` #### `EpisodeObject` Initialization Code: ```CSharp QueueObjectCurrentlyPlaying value = QueueObjectCurrentlyPlaying.FromEpisodeObject( new EpisodeObject { AudioPreviewUrl = "https://p.scdn.co/mp3-preview/2f37da1d4221f40b9d1a98cd191f4d6f1646ad17", Description = "A Spotify podcast sharing fresh insights on important topics of the moment—in a way only Spotify can. You’ll hear from experts in the music, podcast and tech industries as we discover and uncover stories about our work and the world around us.\n", HtmlDescription = "

A Spotify podcast sharing fresh insights on important topics of the moment—in a way only Spotify can. You’ll hear from experts in the music, podcast and tech industries as we discover and uncover stories about our work and the world around us.

\n", DurationMs = 1686230, MExplicit = false, ExternalUrls = new ExternalUrlObject { }, Href = "https://api.spotify.com/v1/episodes/5Xt5DXGzch68nYYamXrNxZ", Id = "5Xt5DXGzch68nYYamXrNxZ", Images = new List { new ImageObject { Url = "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n", Height = 300, Width = 300, }, }, IsExternallyHosted = false, IsPlayable = false, Languages = new List { "fr", "en", }, Name = "Starting Your Own Podcast: Tips, Tricks, and Advice From Anchor Creators\n", ReleaseDate = "1981-12-15", ReleaseDatePrecision = ReleaseDatePrecisionEnum.Day, Type = Type5Enum.Episode, Uri = "spotify:episode:0zLhl3WsOCQHbe1BPTiHgr", Show = new ShowBase { AvailableMarkets = new List { "available_markets0", "available_markets1", "available_markets2", }, Copyrights = new List { new CopyrightObject { }, }, Description = "description4", HtmlDescription = "html_description4", MExplicit = false, ExternalUrls = new ExternalUrlObject { }, Href = "href8", Id = "id6", Images = new List { new ImageObject { Url = "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n", Height = 300, Width = 300, }, }, IsExternallyHosted = false, Languages = new List { "languages7", "languages6", "languages5", }, MediaType = "media_type6", Name = "name6", Publisher = "publisher6", Type = Type6Enum.Show, Uri = "uri0", TotalEpisodes = 198, }, Language = "en", } ); ``` ### Utilization Code ```CSharp value.Match( trackObject: @case => { Console.WriteLine(@case); return null; }, episodeObject: @case => { Console.WriteLine(@case); return null; }) ``` ## QueueObjectQueue This is a container for OneOf cases. ### Cases #### `TrackObject` Initialization Code: ```CSharp QueueObjectQueue value = QueueObjectQueue.FromTrackObject( new TrackObject { } ); ``` #### `EpisodeObject` Initialization Code: ```CSharp QueueObjectQueue value = QueueObjectQueue.FromEpisodeObject( new EpisodeObject { AudioPreviewUrl = "https://p.scdn.co/mp3-preview/2f37da1d4221f40b9d1a98cd191f4d6f1646ad17", Description = "A Spotify podcast sharing fresh insights on important topics of the moment—in a way only Spotify can. You’ll hear from experts in the music, podcast and tech industries as we discover and uncover stories about our work and the world around us.\n", HtmlDescription = "

A Spotify podcast sharing fresh insights on important topics of the moment—in a way only Spotify can. You’ll hear from experts in the music, podcast and tech industries as we discover and uncover stories about our work and the world around us.

\n", DurationMs = 1686230, MExplicit = false, ExternalUrls = new ExternalUrlObject { }, Href = "https://api.spotify.com/v1/episodes/5Xt5DXGzch68nYYamXrNxZ", Id = "5Xt5DXGzch68nYYamXrNxZ", Images = new List { new ImageObject { Url = "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n", Height = 300, Width = 300, }, }, IsExternallyHosted = false, IsPlayable = false, Languages = new List { "fr", "en", }, Name = "Starting Your Own Podcast: Tips, Tricks, and Advice From Anchor Creators\n", ReleaseDate = "1981-12-15", ReleaseDatePrecision = ReleaseDatePrecisionEnum.Day, Type = Type5Enum.Episode, Uri = "spotify:episode:0zLhl3WsOCQHbe1BPTiHgr", Show = new ShowBase { AvailableMarkets = new List { "available_markets0", "available_markets1", "available_markets2", }, Copyrights = new List { new CopyrightObject { }, }, Description = "description4", HtmlDescription = "html_description4", MExplicit = false, ExternalUrls = new ExternalUrlObject { }, Href = "href8", Id = "id6", Images = new List { new ImageObject { Url = "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n", Height = 300, Width = 300, }, }, IsExternallyHosted = false, Languages = new List { "languages7", "languages6", "languages5", }, MediaType = "media_type6", Name = "name6", Publisher = "publisher6", Type = Type6Enum.Show, Uri = "uri0", TotalEpisodes = 198, }, Language = "en", } ); ``` ### Utilization Code ```CSharp value.Match( trackObject: @case => { Console.WriteLine(@case); return null; }, episodeObject: @case => { Console.WriteLine(@case); return null; }) ``` ## CurrentlyPlayingContextObjectItem This is a container for OneOf cases. ### Cases #### `TrackObject` Initialization Code: ```CSharp CurrentlyPlayingContextObjectItem value = CurrentlyPlayingContextObjectItem.FromTrackObject( new TrackObject { } ); ``` #### `EpisodeObject` Initialization Code: ```CSharp CurrentlyPlayingContextObjectItem value = CurrentlyPlayingContextObjectItem.FromEpisodeObject( new EpisodeObject { AudioPreviewUrl = "https://p.scdn.co/mp3-preview/2f37da1d4221f40b9d1a98cd191f4d6f1646ad17", Description = "A Spotify podcast sharing fresh insights on important topics of the moment—in a way only Spotify can. You’ll hear from experts in the music, podcast and tech industries as we discover and uncover stories about our work and the world around us.\n", HtmlDescription = "

A Spotify podcast sharing fresh insights on important topics of the moment—in a way only Spotify can. You’ll hear from experts in the music, podcast and tech industries as we discover and uncover stories about our work and the world around us.

\n", DurationMs = 1686230, MExplicit = false, ExternalUrls = new ExternalUrlObject { }, Href = "https://api.spotify.com/v1/episodes/5Xt5DXGzch68nYYamXrNxZ", Id = "5Xt5DXGzch68nYYamXrNxZ", Images = new List { new ImageObject { Url = "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n", Height = 300, Width = 300, }, }, IsExternallyHosted = false, IsPlayable = false, Languages = new List { "fr", "en", }, Name = "Starting Your Own Podcast: Tips, Tricks, and Advice From Anchor Creators\n", ReleaseDate = "1981-12-15", ReleaseDatePrecision = ReleaseDatePrecisionEnum.Day, Type = Type5Enum.Episode, Uri = "spotify:episode:0zLhl3WsOCQHbe1BPTiHgr", Show = new ShowBase { AvailableMarkets = new List { "available_markets0", "available_markets1", "available_markets2", }, Copyrights = new List { new CopyrightObject { }, }, Description = "description4", HtmlDescription = "html_description4", MExplicit = false, ExternalUrls = new ExternalUrlObject { }, Href = "href8", Id = "id6", Images = new List { new ImageObject { Url = "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n", Height = 300, Width = 300, }, }, IsExternallyHosted = false, Languages = new List { "languages7", "languages6", "languages5", }, MediaType = "media_type6", Name = "name6", Publisher = "publisher6", Type = Type6Enum.Show, Uri = "uri0", TotalEpisodes = 198, }, Language = "en", } ); ``` ### Utilization Code ```CSharp value.Match( trackObject: @case => { Console.WriteLine(@case); return null; }, episodeObject: @case => { Console.WriteLine(@case); return null; }) ``` ## CurrentlyPlayingObjectItem This is a container for OneOf cases. ### Cases #### `TrackObject` Initialization Code: ```CSharp CurrentlyPlayingObjectItem value = CurrentlyPlayingObjectItem.FromTrackObject( new TrackObject { } ); ``` #### `EpisodeObject` Initialization Code: ```CSharp CurrentlyPlayingObjectItem value = CurrentlyPlayingObjectItem.FromEpisodeObject( new EpisodeObject { AudioPreviewUrl = "https://p.scdn.co/mp3-preview/2f37da1d4221f40b9d1a98cd191f4d6f1646ad17", Description = "A Spotify podcast sharing fresh insights on important topics of the moment—in a way only Spotify can. You’ll hear from experts in the music, podcast and tech industries as we discover and uncover stories about our work and the world around us.\n", HtmlDescription = "

A Spotify podcast sharing fresh insights on important topics of the moment—in a way only Spotify can. You’ll hear from experts in the music, podcast and tech industries as we discover and uncover stories about our work and the world around us.

\n", DurationMs = 1686230, MExplicit = false, ExternalUrls = new ExternalUrlObject { }, Href = "https://api.spotify.com/v1/episodes/5Xt5DXGzch68nYYamXrNxZ", Id = "5Xt5DXGzch68nYYamXrNxZ", Images = new List { new ImageObject { Url = "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n", Height = 300, Width = 300, }, }, IsExternallyHosted = false, IsPlayable = false, Languages = new List { "fr", "en", }, Name = "Starting Your Own Podcast: Tips, Tricks, and Advice From Anchor Creators\n", ReleaseDate = "1981-12-15", ReleaseDatePrecision = ReleaseDatePrecisionEnum.Day, Type = Type5Enum.Episode, Uri = "spotify:episode:0zLhl3WsOCQHbe1BPTiHgr", Show = new ShowBase { AvailableMarkets = new List { "available_markets0", "available_markets1", "available_markets2", }, Copyrights = new List { new CopyrightObject { }, }, Description = "description4", HtmlDescription = "html_description4", MExplicit = false, ExternalUrls = new ExternalUrlObject { }, Href = "href8", Id = "id6", Images = new List { new ImageObject { Url = "https://i.scdn.co/image/ab67616d00001e02ff9ca10b55ce82ae553c8228\n", Height = 300, Width = 300, }, }, IsExternallyHosted = false, Languages = new List { "languages7", "languages6", "languages5", }, MediaType = "media_type6", Name = "name6", Publisher = "publisher6", Type = Type6Enum.Show, Uri = "uri0", TotalEpisodes = 198, }, Language = "en", } ); ``` ### Utilization Code ```CSharp value.Match( trackObject: @case => { Console.WriteLine(@case); return null; }, episodeObject: @case => { Console.WriteLine(@case); return null; }) ```