New Releases
Explore newly released albums using the Spotify API.
We'll cover the following
Is it boring to listen to the same old music over and over? The Get New Releases endpoint of the Spotify API can help get rid of boredom.
The base URL https://api.spotify.com/v1/browse/new-releases
is used to get a list of newly released albums featured on Spotify.
Request parameters
The information obtained by calling this endpoint can be filtered using the following query parameters.
Query parameter | Category | Type | Description |
| Optional | Integer | This limits the number of items to be returned in the response. Its value ranges from |
| Optional | String | This is an ISO 3166-1 alpha-2 country code that we can use to fetch only the content available in a specific country. Some examples of country codes are |
| Optional | Integer | This parameter can be used to offset the first item we get in response. |
Fetch new releases
The following code uses this endpoint to get the information about newly released albums via the client credentials access token for authorization.
url = 'https://api.spotify.com/v1/browse/new-releases'headers = {'Content-Type': 'application/json','Authorization': 'Bearer {{CLIENT_CREDENTIALS_ACCESS_TOKEN}}'}response = requests.request("GET", url, headers=headers)print(json.dumps(response.json(), indent=4))
We can use the limit
parameter to limit the number of albums we get in response. Let's say we want to get only ten albums in response. In that case, we append ?limit=10
to the base URI in line 1.
Note: If we use the authorization code access token for verification, we'll get a different list of albums. This list will be filtered based on the country associated with our ID since we ourselves are the users who granted the permission for this token.
Response fields
Given below are some important response fields from the code above:
Response field | Type | Description |
| String | This defines the albums type. |
| String | We can use this link to redirect the user to the requested item on Spotify. |
| String | This is the Spotify ID of the requested item. |
| String | This is the name of the requested item. |
| Array of objects | This is a list of countries where the album is available. |
| Array of objects | This array contains the links of images associated with the albums and their dimensions. |
| String | This is the release date of the album. |
| Integer | This is the number of tracks the album contains. |