# HTTP Request Batch with Auto Pagination — Every Item as a Row (`northbell/http-paginate`) Actor

Send batches of HTTP requests to APIs and follow pagination automatically: next links, cursors, offsets, page numbers or Link headers. Every item comes back as its own row. Retries, rate-limit aware, secrets in headers never logged.

- **URL**: https://apify.com/northbell/http-paginate.md
- **Developed by:** [Northbell](https://apify.com/northbell) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## HTTP Request Batch with Auto Pagination — Every Item as a Row

**Give it the first page; it follows next links, cursors, offsets or page numbers until the end and returns every item as its own row — no loop to write in Clay, n8n or Make.** $2.00 per 1,000 pages fetched (a page is one successful HTTP response). Failed requests, and with only-new-items on pages with nothing new, are not charged. Secrets in headers are never logged. Schedule it with only-new-items on and each run returns just the new records.

**Try it now — the input is already filled in.** Press **Start**: it reads the public test API at jsonplaceholder.typicode.com page by page (25 items per page) and returns each post as a row: 100 posts from 5 pages in 5 seconds, $0.01 (our own run on Apify, 21 Nov 2026). Two of those rows (body shortened); each item keeps its own fields and gets a `_request` field saying where it came from:

```json
{ "userId": 1, "id": 1, "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", "body": "quia et suscipit…", "_request": { "label": "posts", "url": "https://jsonplaceholder.typicode.com/posts?_limit=25&_page=1", "page": 1 } }
{ "userId": 1, "id": 2, "title": "qui est esse", "body": "est rerum tempore vitae…", "_request": { "label": "posts", "url": "https://jsonplaceholder.typicode.com/posts?_limit=25&_page=1", "page": 1 } }
```

For your own API with a cursor, the input looks like this (your address, your token; the token is never shown in rows or logs):

```json
{
  "requests": [
    {
      "label": "items",
      "url": "https://api.example.com/v1/items?limit=100",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  ],
  "pagination": {
    "type": "cursor",
    "cursorPath": "meta.next_cursor",
    "cursorParam": "cursor",
    "itemsPath": "data.items"
  }
}
```

If a page fails after the retries, you get one error row instead (not charged) with `_request`, `error` (for example `HTTP 500`), `status` and `attempts`, and the items already fetched stay in the dataset.

### Inputs

| Field | What it does |
|---|---|
| `requests` | List of `{url, method, headers, query, body, label, pagination, output}`. Only `url` is required. Method defaults to GET. `body` can be a string or JSON. `query` is added to the URL. |
| `urls` | Shortcut: plain GET URLs. Added to `requests`. |
| `pagination` | Default for all requests (a request's own `pagination` overrides it). See below. |
| `output.rowMode` | `items`: one row per item (default when `itemsPath` is set, or when the response is a top-level JSON array). `responses`: one row per HTTP response with `status`, `headers`, `body` (parsed JSON, or text up to 1 MB), `timingMs`, `finalUrl`. |
| `onlyNewItems` | Default off. On: items returned to you by an earlier run are left out (and not pushed). Needs `itemKeyPath`. |
| `itemKeyPath` | JSON path to a stable id inside each item, for example `id`. Required when `onlyNewItems` is on. When set, every run remembers the items it returned (switch on or off), so turning `onlyNewItems` on later leaves out what you already have. |
| `stopAtSeen` | Default on with `onlyNewItems`. Stops paginating a request when a whole page holds only items returned before. |
| `retries` | Default 2. Retries on 429, 5xx and network errors with exponential backoff; `Retry-After` is respected. |
| `timeoutSecs` | Default 30, per HTTP call. |
| `concurrency` | Default 3, max 20. Different requests run in parallel; the pages of one request go one after another. |

`pagination` fields: `type` (`none`, `nextUrl`, `cursor`, `offset`, `page`, `linkHeader`), `itemsPath` (JSON path to the array of items, for example `data.items`; empty means the top-level array, or the whole body as one item), `maxPages` (default 50), `delayMs` (default 250 between pages).

### Pagination types

**nextUrl** — the response holds the URL of the next page. Stops when it is missing or null. Relative URLs are resolved.

```json
{ "type": "nextUrl", "nextUrlPath": "links.next", "itemsPath": "items" }
```

**cursor** — the response holds a cursor; it is sent back as a query parameter. Stops when the cursor is missing, null or empty.

```json
{ "type": "cursor", "cursorPath": "meta.next_cursor", "cursorParam": "cursor", "itemsPath": "data.items" }
```

**offset** — the Actor adds `offset` and `limit` to the URL and moves the offset by `limit`. Stops when a page returns fewer than `limit` items.

```json
{ "type": "offset", "offsetParam": "offset", "limitParam": "limit", "limit": 100, "itemsPath": "results" }
```

**page** — the Actor adds the page number, starting at `startPage` (default 1). Stops when a page returns 0 items.

```json
{ "type": "page", "pageParam": "page", "startPage": 1, "itemsPath": "items" }
```

**linkHeader** — follows `Link: <https://...>; rel="next"` (RFC 5988, as GitHub and many others send it).

```json
{ "type": "linkHeader" }
```

Every request also stops at `maxPages`, when a page URL repeats (loop guard), when your maximum charge for the run is reached, and 30 seconds before the run's time limit. Everything charged is already in the dataset.

### Run it on a schedule

Schedule the Actor hourly or daily with `onlyNewItems` on and `itemKeyPath` set to a stable id (for example `id`). Each run returns only the items it has not returned before, and it stops paginating as soon as it reaches a page of items it already returned. For an API that lists the newest items first, a scheduled run usually costs 1 to 2 pages. A page whose items were all returned before is not charged, so a run that finds nothing new costs only the run start.

The list of returned items is kept in a named store called `http-paginate-seen` in your account: one 16-character hash per item, per request (the request is identified by method, URL without pagination parameters, and label), the newest 200,000 per request. If the store cannot be opened the run stops before charging anything. `onlyNewItems` works on items, not on `rowMode: "responses"`. The run summary (OUTPUT) shows `newItems` and `seenItems` per request.

### Limits

- No browser, no JavaScript rendering, no CAPTCHA solving. It calls HTTP APIs and returns what they send back.
- Only public APIs or your own. Respect the API's terms of use and rate limits (raise `delayMs` for strict ones).
- Only http and https URLs. Private, loopback and link-local addresses (10.x, 127.x, 169.254.x, localhost and so on) are refused.
- Authorization, Cookie, X-Api-Key and similar header values, and secret-looking query values (api_key, token and so on), are replaced by `***` in logs and rows. If the API echoes your secret inside its response body, that body is returned as the API sent it.
- Without `itemsPath` and with `page` pagination, a response that is not an array never ends on its own; set `itemsPath` or `maxPages`.

### 日本語

最初のページのURLを渡すだけで、次のページへのリンク・カーソル・オフセット・ページ番号をたどって最後まで取得し、1件ずつ1行で返します。Clayやn8n、Makeでループを組む必要はありません。料金は成功したHTTPレスポンス1ページにつき$0.002です。失敗したリクエストは課金されず、エラー行として返ります。ヘッダーの認証情報（Authorization、Cookie、X-Api-Key など）はログにも結果にも出ません（`***`に置き換え）。公開APIまたはご自身のAPIにのみお使いください。ブラウザ描画・CAPTCHA突破はできません。

# Actor input Schema

## `requests` (type: `array`):

List of requests. Each one: {"url": "...", "method": "GET", "headers": {}, "query": {}, "body": "string or JSON", "label": "name", "pagination": {...}, "output": {"rowMode": "items"}}. Only url is required. A request's own pagination overrides the one below.

## `urls` (type: `array`):

Plain GET URLs. They are added to the requests above and use the pagination below.

## `pagination` (type: `object`):

type: none, nextUrl, cursor, offset, page or linkHeader. nextUrl: nextUrlPath. cursor: cursorPath, cursorParam. offset: offsetParam, limitParam, limit. page: pageParam, startPage. All types: itemsPath (JSON path to the array of items, for example data.items), maxPages (default 50), delayMs (default 250 between pages).

## `output` (type: `object`):

rowMode: "items" (one row per item, default when itemsPath is set or the response is a top-level array) or "responses" (one row per HTTP response with status, headers, body, timingMs, finalUrl). Without itemsPath the default is items when the response is a top-level array, otherwise responses.

## `onlyNewItems` (type: `boolean`):

Off (default): every item is returned. On: items this Actor already returned to you in an earlier run are left out. Needs Item key path. Use it with a schedule.

## `itemKeyPath` (type: `string`):

JSON path to a stable id inside each item, for example id. Required when Only new items is on. When set, every run remembers the items it returned (switch on or off), so turning Only new items on later does not return or charge them again.

## `stopAtSeen` (type: `boolean`):

Only with Only new items. When a whole page holds only items returned before, stop paginating that request. Pages are still charged one by one, so for APIs that list newest first a scheduled run costs 1 to 2 pages.

## `retries` (type: `integer`):

Retries on 429, 5xx and network errors, with exponential backoff. Retry-After is respected.

## `timeoutSecs` (type: `integer`):

Time allowed for one HTTP call.

## `concurrency` (type: `integer`):

How many requests run at the same time. Pages of one request are always fetched one after another.

## Actor input object example

```json
{
  "requests": [
    {
      "label": "posts",
      "url": "https://jsonplaceholder.typicode.com/posts?_limit=25"
    }
  ],
  "pagination": {
    "type": "page",
    "pageParam": "_page",
    "maxPages": 10
  },
  "output": {
    "rowMode": "items"
  },
  "onlyNewItems": false,
  "itemKeyPath": "id",
  "stopAtSeen": true,
  "retries": 2,
  "timeoutSecs": 30,
  "concurrency": 3
}
```

# Actor output Schema

## `rows` (type: `string`):

Items or responses with \_request (label, url, page).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "requests": [
        {
            "label": "posts",
            "url": "https://jsonplaceholder.typicode.com/posts?_limit=25"
        }
    ],
    "pagination": {
        "type": "page",
        "pageParam": "_page",
        "maxPages": 10
    },
    "output": {
        "rowMode": "items"
    },
    "itemKeyPath": "id"
};

// Run the Actor and wait for it to finish
const run = await client.actor("northbell/http-paginate").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "requests": [{
            "label": "posts",
            "url": "https://jsonplaceholder.typicode.com/posts?_limit=25",
        }],
    "pagination": {
        "type": "page",
        "pageParam": "_page",
        "maxPages": 10,
    },
    "output": { "rowMode": "items" },
    "itemKeyPath": "id",
}

# Run the Actor and wait for it to finish
run = client.actor("northbell/http-paginate").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "requests": [
    {
      "label": "posts",
      "url": "https://jsonplaceholder.typicode.com/posts?_limit=25"
    }
  ],
  "pagination": {
    "type": "page",
    "pageParam": "_page",
    "maxPages": 10
  },
  "output": {
    "rowMode": "items"
  },
  "itemKeyPath": "id"
}' |
apify call northbell/http-paginate --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,northbell/http-paginate"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/jBqzqsgDwCeIFLy7B/builds/qHOMQ9nx3Io7CaFHP/openapi.json
