HTTP Pagination where start page is 0

I’m following the example given here:
Pagination | n8n Docs

Here it says:

$pageCount is the number of pages the HTTP Request node has fetched. It starts at zero. Most API pagination counts from one (the first page is page one). This means that adding +1 to $pageCount means the node fetches page one on its first loop, page two on its second, and so on.

But my API does not start on page 1, it start on page 0. That means that I never get the first page, using this example. Any tips on how I can get it to start on page 0, and still iterate through all pages?

I’m using the lastest cloud version of n8n.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Just use $pageCount instead of $pageCount+1

3 Likes

Omg… was it really that simple… :joy:
Thanks! Maybe update the documentation?

Update what? It’s literally saying that :sweat_smile:

$pageCount is the number of pages the HTTP Request node has fetched. It starts at zero. Most API pagination counts from one (the first page is page one). This means that adding +1 to $pageCount means the node fetches page one on its first loop, page two on its second, and so on

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.