Pagination

Many API endpoints that return a list of data split that data up into separate "pages", where each page is a subset of the data. This is called pagination.
Data Fetcher handles the most common types of pagination:

1. Page

A page parameter is set in the URL to tell the API which page number of data you want. e.g.
  • Page 1:http://example.com/?page=1
  • Page 2:https://www.example.com/?page=2
Offset and limit parameters are set in the URL to tell the API which slice of data you want. e.g.
  • Page 1:https://www.example.com/?offset=0&limit=50
  • Page 2:https://www.example.com/?offset=50&limit=100
After the first request, a parameter in the URL is set to an id from the previous response to tell the API where to start the next page. e.g.
  • Page 1:http://www.example.com
  • Page 2:https://www.example.com/?starting_after=cus_IOCwDqeBZGGsrF
After the first request, the API returns a field which contains the entire URL for the next page of data. This URL is used to make the next request. Sometimes this will be in the response headers as a header called Link . The examples here could be any of the previous three examples. The difference is how the next URL is accessed.
Offset and limit parameters are set in the request body to tell the API which slice of data you want. e.g.
  • Page 1 body: { "startRow": 0, "rowLimit": 1000 }
  • Page 2 body: { "startRow": 1000, "rowLimit": 1000 }
After the first request, a field value in the request body is set to an id from the previous response to tell the API where to start the next page. e.g.
  • Page 1 body: { "pageToken": "" }
  • Page 2 body: { "pageToken": "cus_IOCwDqeBZGGsrF" }
7. Header
A header is sent with each request. The value of the header is incremented each time. e.g.
  • Page 1 headers: page 1
  • Page 2 headers: page 2
8. Path
A path parameter in the request URL is incremented with each request to determine the page. e.g. in the URL https://api.example.com/stocks/{page} and the {page} path parameter is replaced with the page. e.g.
  • Page 1:https://api.example.com/stocks/1
  • Page 2:https://api.example.com/stocks/2
Some API documentation will have a "Pagination" section which explains the type you should use. If not, it will be explained in the documentation for the API endpoint.

Select pagination type

  • On the create request screen, click
    to open the advanced settings.
  • Under Pagination, select the pagination type using the dropdown. You can set it to "None" to turn off pagination.

Set the number of pages to fetch

  • After selecting a pagination type, these options will become visible:
  • Turn on "Fetch all pages" to paginate through every page until no data is returned. This can sometimes cause infinite runs to be made if the API response always returns some data, so you will need to test it.
  • Alternatively, you can enter a fixed number of pages to fetch using the input:
Each page that is fetched will use 1 on your monthly runs.

Set up page pagination

If the API supports it, you can set a page size parameter name and size, so that Data Fetcher knows when to stop paginating more reliably.
  • Set the name of the page size parameter:
  • Set the page size:

Set up offset pagination

  • Set the pagination type to "Offset".
  • Enter the name of the Offset parameter. This is often called "offset" but some endpoints may use a different name:
  • Enter the name of the Limit parameter. This is often called "limit" but some endpoints may use a different name:
  • Enter the numerical Limit value. This is the number of entities that are fetched in each page. The offset value will be increased by this amount for each request.
  • Optionally, enter a Starting offset. If you leave this blank, 0 will be used.

Set up cursor pagination

If the API supports it, you can set a page size parameter to help Data Fetcher know when to stop paginating.
  • Set the name of the page size parameter:
  • Set the page size:

Set up next URL pagination

If the API supports it, you can set a page size parameter to help Data Fetcher know when to stop paginating.
  • Set the name of the page size parameter:
  • Set the page size:

Set up offset body pagination

Set up cursor body pagination

Set up header pagination

Set up path pagination

  • In the URL input, enter the URL with {} around the path parameter, e.g. https://api.example.com/stocks/{page} .
  • Enter the name of Path parameter, e.g. "page" in this example.
  • Optionally, enter a Page size parameter.
  • Optionally, enter a Page size.
  • Optionally, enter a Starting page. If you leave this blank, 1 will be used.