Can't get paginated results from Spotify recently played endpoint


I’m trying to use the before and after parameters and have access to the entire returned payload rather than only the items key.


Output Returned

[...] // 25 song objects

N8N Setup

  • Version: 0.160.0
  • Database: PostgreSQL
  • Running n8n via: Docker

Hey @decodedwealth, welcome to the community :tada:

Would you be able to use the Return All option? This should handle pagination transparently for you:

So according to the Spotify docs, the maximum that can be returned is 50 at a time.

I looked into the code that seems to be returning the items from the Spotify node and I just get back the items array instead of the other variables that I would need to paginate. The “Return All” option seems to only give me the same 50 results.

Oh no, I’m so sorry for that. I’ll make sure to add this to our internal bug tracker (because that’s obviously not what the “Return All” option should do).

Until then, you could use their API which accepts pagination parameters. An example workflow connecting directly to their API can be found here: Error 413 on spotify - #15 by MutedJam

Pagination itself would need to be handled by you, an example workflow is available here: HTTP Request : Looping over REST JSON paginated results - #2 by jan

Hope this provides some pointers!

Thank you so much, I think this will work well for my needs in the interim :zap: