SPTBrowse Class Reference
| Inherits from | NSObject |
| Declared in | SPTBrowse.h |
Overview
This class provides helpers for using the browse features in the Spotify API
API Docs: https://developer.spotify.com/web-api/browse-endpoints/
API Console: https://developer.spotify.com/web-api/console/browse/
Tasks
API Request Factories
-
+ createRequestForFeaturedPlaylistsInCountry:limit:offset:locale:timestamp:accessToken:error: -
+ createRequestForNewReleasesInCountry:limit:offset:accessToken:error:
API Response Parsers
Convenience methods
Class Methods
createRequestForFeaturedPlaylistsInCountry:limit:offset:locale:timestamp:accessToken:error:
Get a list of featured playlists
+ (NSURLRequest *)createRequestForFeaturedPlaylistsInCountry:(NSString *)country limit:(NSInteger)limit offset:(NSInteger)offset locale:(NSString *)locale timestamp:(NSDate *)timestamp accessToken:(NSString *)accessToken error:(NSError **)errorParameters
- country
A ISO 3166-1 country code to get playlists for, or
nilto get global recommendations.
- limit
The number of results to return, max 50.
- offset
The index at which to start returning results.
- locale
The locale of the user, for localized recommendations,
nilwill default to American English.
- timestamp
The time of day to get recommendations for (without timezone), or
nilfor current local time
- accessToken
An authenticated access token. Must be valid and authorized.
- error
An optional error value, will be set if the creation of the request failed.
Return Value
The request
Discussion
Parse the response into an SPTFeaturedPlaylistList using SPTFeaturedPlaylistList playlistListFromData:withResponse:error
See https://developer.spotify.com/web-api/get-list-featured-playlists/ for more information on parameters
Declared In
SPTBrowse.hcreateRequestForNewReleasesInCountry:limit:offset:accessToken:error:
Get a list of new releases.
+ (NSURLRequest *)createRequestForNewReleasesInCountry:(NSString *)country limit:(NSInteger)limit offset:(NSInteger)offset accessToken:(NSString *)accessToken error:(NSError **)errorParameters
- country
A ISO 3166-1 country code to get releases for, or
nilfor global releases.
- limit
The number of results to return, max 50.
- offset
The index at which to start returning results.
- accessToken
An authenticated access token. Must be valid and authorized.
- error
An optional error value, will be set if the creation of the request failed.
Discussion
Parse the response into an SPTListPage of SPTAlbum’s using SPTListPage listPageFromData:withResponse:error
See https://developer.spotify.com/web-api/get-list-new-releases/ for more information on parameters
Declared In
SPTBrowse.hnewReleasesFromData:withResponse:error:
Parse the response from createRequestForNewReleasesInCountry into a list of new releases
+ (SPTListPage *)newReleasesFromData:(NSData *)data withResponse:(NSURLResponse *)response error:(NSError **)errorParameters
- data
The API response data
- response
The API response object
- error
An optional pointer to an
NSErrorthat will receive the error code if operation failed.
Return Value
The list of new releases as an SPTListPage object
Declared In
SPTBrowse.hrequestFeaturedPlaylistsForCountry:limit:offset:locale:timestamp:accessToken:accessTokenType:callback:
Get a list of featured playlists
+ (void)requestFeaturedPlaylistsForCountry:(NSString *)country limit:(NSInteger)limit offset:(NSInteger)offset locale:(NSString *)locale timestamp:(NSDate *)timestamp accessToken:(NSString *)accessToken accessTokenType:(NSString *)accessTokenType callback:(SPTRequestCallback)blockParameters
- country
A ISO 3166-1 country code to get playlists for, or
nilto get global recommendations.
- limit
The number of results to return, max 50.
- offset
The index at which to start returning results.
- locale
The locale of the user, for localized recommendations,
nilwill default to American English.
- timestamp
The time of day to get recommendations for (without timezone), or
nilfor current local time
- accessToken
An authenticated access token. Must be valid and authorized with the
user-library-modifyscope.
- accessTokenType
The string that describes how the access token may be used. Should always be equal to “Bearer”.
- block
The block to be called when the operation is complete, containing a
SPTFeaturedPlaylistList
Discussion
This is a convenience method around the createRequest equivalent and the current SPTRequestHandlerProtocol
See https://developer.spotify.com/web-api/get-list-featured-playlists/ for more information on parameters
Declared In
SPTBrowse.hrequestNewReleasesForCountry:limit:offset:accessToken:callback:
Get a list of new releases.
+ (void)requestNewReleasesForCountry:(NSString *)country limit:(NSInteger)limit offset:(NSInteger)offset accessToken:(NSString *)accessToken callback:(SPTRequestCallback)blockParameters
- country
A ISO 3166-1 country code to get releases for, or
nilfor global releases.
- limit
The number of results to return, max 50.
- offset
The index at which to start returning results.
- accessToken
An authenticated access token. Must be valid and authorized.
- block
The block to be called when the operation is complete, containing a
SPTListPage
Discussion
This is a convenience method around the createRequest equivalent and the current SPTRequestHandlerProtocol
See https://developer.spotify.com/web-api/get-list-new-releases/ for more information on parameters
Declared In
SPTBrowse.h