API Data Provider - Online Help

Connecting to Spotify

Using OAuth Authentication

Spotify uses OAuth 2.0 for authentication. You will need to create an application in the Spotify Developer Dashboard to obtain your client credentials.

Setting Up Your Spotify Application

  1. Visit the Spotify Developer Dashboard.
  2. Log in with your Spotify account and click Create app.
  3. Provide an app name, description, and set a Redirect URI (e.g., http://localhost:33333 for desktop applications).
  4. Copy your Client ID and Client Secret from the app settings.

Connection Properties

After setting the following connection properties, you are ready to connect:

  • AuthScheme: Set this to OAuth.
  • InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to manage the process to obtain the OAuthAccessToken.
  • OAuthClientId: Set this to your Spotify application's Client ID.
  • OAuthClientSecret: Set this to your Spotify application's Client Secret.
  • Scope: Set this to the required OAuth scopes (space-separated). The default includes all read scopes needed for the tables in this profile.
  • CallbackURL: Set this to the Redirect URI configured in your Spotify application (e.g., http://localhost:33333).

Example Connection String

Profile=C:\profiles\Spotify.apip;AuthScheme=OAuth;InitiateOAuth=GETANDREFRESH;OAuthClientId=your_client_id;OAuthClientSecret=your_client_secret;CallbackURL=http://localhost:33333;

Available OAuth Scopes

  • user-read-private: Read access to user's subscription details and explicit content settings.
  • user-read-email: Read access to user's email address.
  • user-library-read: Read access to a user's saved tracks, albums, episodes, shows, and audiobooks.
  • playlist-read-private: Read access to user's private playlists.
  • playlist-read-collaborative: Read access to collaborative playlists the user follows.
  • user-follow-read: Read access to the list of artists the current user follows.
  • user-read-playback-state: Read access to a user's player state (device, current track, progress).
  • user-read-currently-playing: Read access to a user's currently playing content.
  • user-read-playback-history: Read access to a user's recently played tracks.
  • user-top-read: Read access to a user's top artists and tracks.

Available Tables

The Spotify API Profile provides access to 27 tables covering music catalog, user library, playback state, and podcast content:

  • Albums - Retrieve album information from the Spotify Web API including tracks, artists, and release details.
  • AlbumTracks - Retrieve tracks from a Spotify album with pagination support.
  • Artists - Retrieve artist information from the Spotify Web API.
  • ArtistAlbums - Retrieve albums for a specific Spotify artist with pagination support.
  • Tracks - Retrieve track information from the Spotify Web API including album, artists, and audio properties.
  • Playlists - Retrieve Spotify playlist details including tracks count, owner information, and images.
  • MyPlaylists - Retrieve the current user's playlists from Spotify. Requires scope: playlist-read-private.
  • Shows - Retrieve podcast show information from the Spotify Web API including episodes count, publisher, and language details.
  • ShowEpisodes - Retrieve episodes for a specific Spotify podcast show with pagination support.
  • Episodes - Retrieve podcast episode information from the Spotify Web API including show details, release date, and audio properties.
  • Audiobooks - Retrieve audiobook information from the Spotify Web API including authors, narrators, and chapter details. Available in select markets only.
  • AudiobookChapters - Retrieve chapters for a specific Spotify audiobook with pagination support. Available in select markets only.
  • Chapters - Retrieve audiobook chapter information from the Spotify Web API. Available in select markets only.
  • SavedTracks - Retrieve tracks saved in the current user's Spotify library. Requires scope: user-library-read.
  • SavedAlbums - Retrieve albums saved in the current user's Spotify library. Requires scope: user-library-read.
  • SavedEpisodes - Retrieve podcast episodes saved in the current user's Spotify library. Requires scope: user-library-read.
  • SavedShows - Retrieve podcast shows saved in the current user's Spotify library. Requires scope: user-library-read.
  • SavedAudiobooks - Retrieve audiobooks saved in the current user's Spotify library. Requires scope: user-library-read.
  • FollowedArtists - Retrieve artists followed by the current Spotify user. Requires scope: user-follow-read.
  • UserTopArtists - Retrieve the current user's top artists from Spotify. Requires scope: user-top-read.
  • UserTopTracks - Retrieve the current user's top tracks from Spotify. Requires scope: user-top-read.
  • RecentlyPlayed - Retrieve the current user's recently played tracks from Spotify (last 50 tracks). Requires scope: user-read-playback-history.
  • CurrentlyPlaying - Retrieve the currently playing track or episode from Spotify. Requires scope: user-read-currently-playing.
  • PlayerState - Retrieve the current playback state including device, track, and progress information. Requires scope: user-read-playback-state.
  • PlayerQueue - Retrieve the current user's Spotify playback queue including upcoming items. Requires scope: user-read-playback-state.
  • Devices - Retrieve a list of available Spotify playback devices for the current user. Requires scope: user-read-playback-state.
  • Me - Retrieve the current authenticated Spotify user's profile. Requires scope: user-read-private.

Usage Examples

Albums:

SELECT * FROM Albums WHERE Id = '4aawyAB9vmqN3uQ7FjRGTy'

Artists:

SELECT * FROM Artists WHERE Id = '0TnOYISbd1XYRBk9myaseg'

ArtistAlbums:

SELECT * FROM ArtistAlbums WHERE ArtistId = '0TnOYISbd1XYRBk9myaseg'

AlbumTracks:

SELECT * FROM AlbumTracks WHERE AlbumId = '4aawyAB9vmqN3uQ7FjRGTy'

Tracks:

SELECT * FROM Tracks WHERE Id = '0VjIjW4GlUZAMYd2vXMi3b'

Shows:

SELECT * FROM Shows WHERE Id = '38bS44xjbVVZ3No3ByF1dJ'

ShowEpisodes:

SELECT * FROM ShowEpisodes WHERE ShowId = '38bS44xjbVVZ3No3ByF1dJ'

Episodes:

SELECT * FROM Episodes WHERE Id = '512ojhOuo1ktJprKbVcKyQ'

Audiobooks:

SELECT * FROM Audiobooks WHERE Id = '7iHfbu1YPACw6oZPAFJtqe'

AudiobookChapters:

SELECT * FROM AudiobookChapters WHERE AudiobookId = '7iHfbu1YPACw6oZPAFJtqe'

Chapters:

SELECT * FROM Chapters WHERE Id = '0D5wENdkdwbqlrHoaJ9g29'

Playlists:

SELECT * FROM Playlists WHERE Id = '3cEYpjA9oz9GiPac4AsH4n'

MyPlaylists:

SELECT * FROM MyPlaylists

SavedTracks:

SELECT * FROM SavedTracks

SavedAlbums:

SELECT * FROM SavedAlbums

SavedEpisodes:

SELECT * FROM SavedEpisodes

SavedShows:

SELECT * FROM SavedShows

SavedAudiobooks:

SELECT * FROM SavedAudiobooks

FollowedArtists:

SELECT * FROM FollowedArtists

UserTopArtists:

SELECT * FROM UserTopArtists

SELECT * FROM UserTopArtists WHERE TimeRange = 'short_term'

UserTopTracks:

SELECT * FROM UserTopTracks

SELECT * FROM UserTopTracks WHERE TimeRange = 'long_term'

Me:

SELECT * FROM Me

RecentlyPlayed:

SELECT * FROM RecentlyPlayed

CurrentlyPlaying:

SELECT * FROM CurrentlyPlaying

PlayerState:

SELECT * FROM PlayerState

PlayerQueue:

SELECT * FROM PlayerQueue

Devices:

SELECT * FROM Devices

Search:

SELECT * FROM Search WHERE Query = 'Radiohead' AND Type = 'artist'

SELECT * FROM Search WHERE Query = 'Creep' AND Type = 'track'

Connection Properties

The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider.


Property Description
AuthScheme The scheme used for authentication. Accepted entries are None or OAuth.
Allowed values are: BASIC, NONE, NTLM, OAUTH, APIKEY, OAUTH_CLIENT
CallbackURL Identifies the URL users return to after authenticating to API via OAuth (Custom OAuth applications only).
InitiateOAuth Specifies the process for obtaining or refreshing the OAuth access token, which maintains user access while an authenticated, authorized user is working.
Allowed values are: OFF, REFRESH, GETANDREFRESH
OAuthAccessToken Specifies the OAuth access token used to authenticate requests to the data source. This token is issued by the authorization server after a successful OAuth exchange.
OAuthClientId Specifies the client ID (also known as the consumer key) assigned to your custom OAuth application. This ID is required to identify the application to the OAuth authorization server during authentication.
OAuthClientSecret Specifies the client secret assigned to your custom OAuth application. This confidential value is used to authenticate the application to the OAuth authorization server. (Custom OAuth applications only.).
OAuthExpiresIn Specifies the duration in seconds, of an OAuth Access Token's lifetime. The token can be reissued to keep access alive as long as the user keeps working.
OAuthRefreshToken Specifies the OAuth refresh token used to request a new access token after the original has expired.
OAuthSettingsLocation Specifies the location of the settings file where OAuth values are saved.
OAuthTokenTimestamp Displays a Unix epoch timestamp in milliseconds that shows how long ago the current access token was created.
OAuthVerifier Specifies a verifier code returned from the OAuthAuthorizationURL . Used when authenticating to OAuth on a headless server, where a browser can't be launched. Requires both OAuthSettingsLocation and OAuthVerifier to be set.
Scope Scope(s) to use when authenticating, that control access to specific information.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 26.0.9655.0