Announcements

Help Wizard

Step 1

NEXT STEP

Spotify Search Web API pagination returns inconsistent total count

Spotify Search Web API pagination returns inconsistent total count

first-page.png

second-page.png

  

I’m facing an issue with pagination in the Spotify Search Web API where the total value changes unexpectedly when updating the offset.

Steps to reproduce:

  1. Perform a search request (e.g., /v1/search) with:

    • limit = 10

    • offset = 0

  2. The response returns a total value = N

  3. Change the offset to offset = N - 10

  4. The response now returns a different total value = M (where M ≠ N)

Expected behavior:

  • The total count should remain consistent for the same query, regardless of offset changes, as it represents the total number of matching results.

Actual behavior:

  • The total value changes when the offset is updated, which breaks pagination logic and makes it unreliable to calculate the last page or total pages.

Impact:

  • This makes cursor/offset-based pagination unpredictable

  • UI pagination (page numbers, last page detection) becomes incorrect

  • Difficult to determine when all results have been fetched

Has anyone else encountered this issue, or is this expected behavior due to backend ranking/index updates?

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