Amazon SP-API pagination returns same results with new nextToken — how to properly fetch next page? #4837
Replies: 2 comments 1 reply
-
Hi @msrnayeem02 Please ensure that the Thanks, |
Beta Was this translation helpful? Give feedback.
-
According to the doc @ritikacd linked to the API doc, the correct query parameter name for nextToken is actually "pageToken" |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using the Amazon Selling Partner API (/listings/2021-08-01/items/{sellerId}) to fetch my product listings. I'm handling pagination using the nextToken parameter. My API fetch code looks like this:
When I hit my endpoint (/api/amazon/products), I get the expected response:
But when I call the same API again using that nextToken, I get the same products again, although the API returns a new nextToken. It keeps going in a loop — returning the same items but giving new nextToken each time.
Questions:
Is there something I’m missing in how Amazon SP-API handles pagination?
How can I ensure I get the next page of products, not repeated ones?
Environment:
Node.js + Express
Beta Was this translation helpful? Give feedback.
All reactions