Announcements

Help Wizard

Step 1

NEXT STEP

Duplicate results in https://api.spotify.com/v1/search

Duplicate results in https://api.spotify.com/v1/search

Plan

Premium

Country

United Kingdom

Device

PC

Operating System

Windows 11

 

My Question or Issue

Using the offset parameter for a query is giving duplicate results.

 

Reproduction:

GET https://api.spotify.com/v1/search?q=joji&type=track&limit=1&offset=3

{
	"tracks": {
		"href": "https://api.spotify.com/v1/search?offset=3&limit=1&query=joji&type=track&locale=en-GB,en;q%3D0.9,en-US;q%3D0.8",
		"limit": 1,
		"next": "https://api.spotify.com/v1/search?offset=4&limit=1&query=joji&type=track&locale=en-GB,en;q%3D0.9,en-US;q%3D0.8",
		"offset": 3,
		"previous": "https://api.spotify.com/v1/search?offset=2&limit=1&query=joji&type=track&locale=en-GB,en;q%3D0.9,en-US;q%3D0.8",
		"total": 6,
		"items": [
			{
				...
				"id": "0Y9D1Bc4fAkeZnVsGKdij6",
				"is_local": false,
				"is_playable": true,
				"name": "WANTED U",
				"popularity": 0,
				"preview_url": null,
				"track_number": 4,
				"type": "track",
				"uri": "spotify:track:0Y9D1Bc4fAkeZnVsGKdij6"
			}
		]
	}
}

GET https://api.spotify.com/v1/search?q=joji&type=track&limit=1&offset=4

{
	"tracks": {
		"href": "https://api.spotify.com/v1/search?offset=4&limit=1&query=joji&type=track&locale=en-GB,en;q%3D0.9,en-US;q%3D0.8",
		"limit": 1,
		"next": "https://api.spotify.com/v1/search?offset=5&limit=1&query=joji&type=track&locale=en-GB,en;q%3D0.9,en-US;q%3D0.8",
		"offset": 4,
		"previous": "https://api.spotify.com/v1/search?offset=3&limit=1&query=joji&type=track&locale=en-GB,en;q%3D0.9,en-US;q%3D0.8",
		"total": 9,
		"items": [
			{
				...
				"id": "0Y9D1Bc4fAkeZnVsGKdij6",
				"is_local": false,
				"is_playable": true,
				"name": "WANTED U",
				"popularity": 0,
				"preview_url": null,
				"track_number": 4,
				"type": "track",
				"uri": "spotify:track:0Y9D1Bc4fAkeZnVsGKdij6"
			}
		]
	}
}

Expected result:

Second request should return a different track than the first.

Reply
0 Replies

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random