# Bulk HTTP Requests: Batch API Caller for CSV Rows & URL Lists (`siteacs/bulk-http-request`) Actor

Send bulk HTTP requests to any API from CSV, JSON or a URL list: one GET, POST or PUT per row from a {{column}} template. An HTTP client for batch API calls and webhook tests, with retries, per-host rate limits and JSON or regex extraction.

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

## Pricing

$0.50 / 1,000 answered requests

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Bulk HTTP Requests: Batch API Caller for CSV Rows & URL Lists

Send bulk HTTP requests to any API: write the request once as a template, give it rows (CSV, JSON, a file or Google
Sheet link, or an Apify dataset) and get one result per row with the status code, the parsed JSON or text body,
headers, timing and the values you asked to extract. GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS, with JSON, form
or text bodies.

**Quick start**

- **In:** a URL template with `{{column}}` placeholders (`url`) and rows (`csvRows`, `rows`, `rowsUrl` or
  `rowsDatasetId`), or a plain list of addresses (`urls`). Optional `method`, `headers`, `jsonBody`, `formBody`,
  `textBody` and `extract`.
- **Out:** one row per request: `index`, `row`, `method`, `url`, `ok`, `statusCode`, `json` or `body`, `extracted`,
  `headers`, `redirects`, `timing`, `charged`, and `errorType` when there was no answer.
- **Price:** $0.50 per 1,000 answered requests (any status code, retries included), no start fee. DNS failures,
  refused connections, timeouts and refused private addresses are free. 10,000 API calls cost $5.

```json
{ "url": "https://jsonplaceholder.typicode.com/users/{{id}}", "rows": [{"id": 1}, {"id": 2}, {"id": 3}],
  "extract": {"name": "name", "city": "address.city"} }
```

Three fields of one output row: `{"statusCode": 200, "extracted": {"name": "Leanne Graham", "city": "Gwenborough"}, "charged": true}`.

The input prefilled in the form POSTs three CSV rows to a public echo API and pulls two fields back out. One result, trimmed:

```json
{
  "index": 0,
  "row": {"id": "1", "name": "Ana Lima", "email": "ana@example.com"},
  "method": "POST",
  "url": "https://postman-echo.com/post?id=1",
  "ok": true,
  "statusCode": 200,
  "json": {"args": {"id": "1"}, "json": {"id": "1", "name": "Ana Lima", "email": "ana@example.com", "source": "bulk import"}},
  "extracted": {"echoedName": "Ana Lima", "echoedId": "1"},
  "attempts": 1,
  "timing": {"dnsMs": 14, "connectMs": 2, "tlsMs": 22, "ttfbMs": 27, "downloadMs": 1, "rateWaitMs": 0, "totalMs": 90},
  "charged": true
}
```

Use it as a batch API caller from a spreadsheet, a URL fetcher for a list of addresses, a webhook tester, or a
Postman alternative for runs too long to click through: enrich a lead list through your enrichment API, push rows into
a CRM, check thousands of IDs against an API and keep two fields, or feed another actor's dataset into an API.

To check whether a list of websites is live, parked, dead or redirected (one verdict per domain, no templates), use
[Website Status Checker](https://apify.com/siteacs/website-status-checker); to pull emails and phones from those
sites, [Website Contact Scraper](https://apify.com/siteacs/website-contact-scraper).

### How to use it

1. **URL or URL template**: `https://api.example.com/users/{{id}}?country={{country}}`.
2. **Rows**: paste CSV (first line names the columns), JSON rows, a file link, or a dataset ID. Or skip the template
   and give a plain list of URLs.
3. **Method, headers and body**: placeholders work in all of them:
   `{"Authorization": "Bearer {{token}}"}`, a JSON body `{"email": "{{email}}", "score": "{{score}}"}`, a form body,
   or any text body (XML, GraphQL).
4. **Extract** (optional): `{"userId": "data.id", "title": "regex:<title>(.*?)</title>"}`.
5. Run it, then download the dataset as JSON, CSV or Excel, or read it through the API.

Test a template on a few rows first with **Max requests**.

### Templates

| You write | You get |
|---|---|
| `https://x.com/u/{{id}}?q={{q}}` with q = `a b&c` | `https://x.com/u/7?q=a%20b%26c` (values are URL-encoded) |
| `{{url}}` (a column of full addresses) | the address as it is |
| `https://x.com/{{{path}}}` (triple braces) | the value inserted as it is, slashes kept |
| `{{address.city}}` | a nested value from a JSON row or dataset item |
| `{"n": "{{n}}"}` in a JSON body | the row's value with its type: a number stays a number, a list stays a list |
| `{"note": "row {{n}}"}` | text: `"row 5"`, quotes and line breaks escaped |

CSV values are text; give JSON rows or a dataset when a JSON body needs numbers. A row without a column the template
uses becomes a free `missing_column` result that names the row's columns. A **Method column** lets one run mix
methods: each row's cell (GET, POST, PUT ...) decides, empty cells use **Method**. A body is sent with POST, PUT,
PATCH and DELETE only.

### What you get

One dataset item per request (per list element with **One dataset item per array element**):

| Field | What it holds |
|---|---|
| `index`, `row` | The row number (from 0) and the input row, so results join back to your sheet |
| `method`, `url` | The request as sent; secret-looking query values (`key`, `token`, `signature` ...) show as `REDACTED` |
| `ok`, `statusCode`, `statusText` | `ok` is true for 2xx |
| `finalUrl`, `redirects` | Where the redirects ended, and each hop with its status |
| `contentType`, `bodyBytes`, `bodySha256`, `truncated` | About the body; the hash helps to spot changes between runs |
| `json` / `body` / `bodyBase64` | The parsed JSON, the text, or a file as base64 (**Body format**) |
| `item`, `itemsTotal`, `itemsCut` | One element of the list at **One dataset item per array element** (at most 1,000 per request), the list's length, and whether it was cut |
| `extracted` | Your extract columns |
| `headers` | Response headers (`set-cookie` as a list) |
| `attempts`, `remoteAddress` | Tries it took; the server address connected to |
| `timing` | `dnsMs`, `connectMs`, `tlsMs`, `ttfbMs` (time to first byte), `downloadMs`, `rateWaitMs`, `totalMs` (retries included); DNS, connect and TLS are empty when a connection was reused |
| `startedAt`, `charged` | When the request went out; whether it was charged |
| `errorType`, `error` | Why a request got no answer: `dns`, `blocked_address`, `connect`, `timeout`, `tls`, `protocol`, `too_many_redirects`, `invalid_redirect`, `unsupported_encoding`, `missing_column`, `invalid_request` |

The Output tab has three views: responses, bodies, and timing with redirects.

### Extract

| Expression | Result |
|---|---|
| `data.items[0].id`, `$.data.items[0].id` | One value, or null when it is not there |
| `items[-1].name` | From the end of a list |
| `items[*].id` | Every match, as a list |
| `['key.with.dots']` | A key that contains dots |
| `regex:<title>(.*?)</title>` | The first match in the body text (its first group, if it has one) |
| `regexAll:href="([^"]+)"` | Every match, as a list |
| `header:x-ratelimit-remaining` | A response header |

Extraction reads the whole body up to **Max body size**, also when **Body format** is None.

### Rate limits, retries and redirects

- **Requests at a time** (default 20) across all hosts; **per host** at most 5 at a time and 600 a minute by default
  (20 and 1,200 at most), spaced evenly, retries and redirects included. Set the per-minute number to your API's
  limit. "Host" means the server: names that point at the same address (`x.com`, `x.com.`, its IP, other names on
  it) share one limit.
- **Retries** (default 2) after a timeout, a dropped connection or HTTP 408, 425, 429, 500, 502, 503 or 504, waiting
  1 s, 2 s, 4 s ... or what `Retry-After` asks (up to **Longest Retry-After wait**; a longer wait returns the 429 as
  the result). POST and PATCH are repeated only when the request surely never arrived, or on 429 (or 503 with
  Retry-After), unless you turn on **Retry POST and PATCH on any retryable error**.
- **Redirects** are followed up to 10 hops and listed; **Max redirects** 0 saves the 3xx answer itself. A 303 (and a
  301 or 302 after a POST) continues as GET without the body. `Authorization` and `Cookie` headers are not sent to
  another host. Cookies a server sets during a redirect chain are sent on along that chain (as a browser would, by
  domain); no cookies are kept from one request to the next.
- **Headers** must be plain ASCII; a row whose header value has other characters (or a control character) is saved
  free as `invalid_request`. `Content-Length`, `Transfer-Encoding` and `Connection` are set by the actor.
- **Compressed answers** (gzip, deflate, br) are decoded up to **Max body size** and no further, so a small
  compressed body that would expand to gigabytes is cut at the cap. Other encodings are refused free as
  `unsupported_encoding`.

### Pricing

$0.50 per 1,000 answered requests ($0.0005 each), no start fee. Charged: any HTTP answer, 2xx to 5xx, once per row
however many retries it took. Free: no DNS, refused or dropped connection, timeout, TLS failure, private address,
redirect loop, invalid URL, missing column. Set **Maximum cost per run** and the run stops before it: a request is
sent only when its charge still fits.

In testing, 1,000 requests to 20 hosts took two runs of about 50 seconds each at the default 256 MB.

### Private and internal addresses are refused

The actor resolves every host itself and refuses it when any of its addresses is private, loopback, link-local,
carrier-grade NAT, multicast or reserved (10/8, 172.16/12, 192.168/16, 127/8, 169.254/16 including cloud metadata,
::1, fc00::/7, fe80::/10, and IPv4 inside IPv6 forms). It then connects to the address it checked, so a name that
changes its DNS answer between check and connect cannot get through, and it checks every redirect hop the same way.
These requests are saved free as `blocked_address`.

### API, schedules and integrations

Run it from your code, Make, Zapier, n8n or an AI agent through the Apify API or the Apify MCP server. Pass the rows
in the input, or point **Rows: Apify dataset ID** at another run's output. Schedule it to check endpoints and watch
`statusCode`, `bodySha256` or an extracted value change; use Apify's run webhooks to be told when a run finishes.

### Options

| Option | Default | |
|---|---|---|
| Max requests | 0 (all) | Send only the first N rows |
| Body format | auto | auto, json, text, base64 or none |
| Max body size (KB) | 1024 | Up to 4096; longer bodies are cut and marked `truncated` |
| Save response headers / Save the input row | on | Turn off for smaller items, or when rows hold secrets |
| Timeout (seconds) | 30 | For the connection and each part of the answer |
| Follow redirects / Max redirects | on / 10 | |
| Ignore TLS certificate errors | off | For expired or self-signed certificates |

### Limits

- Requests go out from Apify's data-centre addresses, without proxies. Sites that refuse data-centre traffic or show a
  bot challenge return that answer (often 403 or 429); this actor does not get around them.
- One template per run. For different endpoints per row, put the whole address in a column (`{{url}}`) and the method
  in **Method column**.
- Rows files up to 50 MB. Each item holds at most about 4 MB of body. **One dataset item per array element** makes
  at most 1,000 items per request.
- Call only APIs you are allowed to use, within their terms and rate limits.

### FAQ

**Am I charged for 404 or 500 answers?** Yes: the server answered. You are not charged when there is no answer.

**Can it page through an API?** Not by following next links. Put the page numbers or cursors in your rows instead.

**How do I send an array as the JSON body?** Use **Text body** with the JSON text and `Content-Type: application/json`.

**Why is a value in my JSON body a string?** CSV values are text. Give the rows as JSON (or a dataset) to keep numbers.

**Is there a size limit on runs?** No fixed one; large runs are limited by your maximum cost per run and the run timeout.

**Em português / en español:** o actor envia requisições HTTP em massa (GET, POST, PUT) para qualquer API, uma por
linha de uma planilha CSV ou JSON, e devolve o status e os campos extraídos de cada resposta. Envía peticiones HTTP
masivas a cualquier API, una por fila de un CSV o JSON, con reintentos y límite por servidor; las fallas no se cobran.

# Changelog

This Actor's version history is a separate document: https://apify.com/siteacs/bulk-http-request/changelog.md

# Actor input Schema

## `url` (type: `string`):

The address to call. Put {{column}} where a value from each row goes, for example https://api.example.com/users/{{id}}?country={{country}}. Values are URL-encoded; a placeholder at the very start ({{url}}, a column of full addresses) or in triple braces ({{{path}}}) is inserted as is. Leave empty when you give a URL list below.

## `method` (type: `string`):

The HTTP method for every request. A body (below) is sent with POST, PUT, PATCH and DELETE only.

## `csvRows` (type: `string`):

One request per row. The first line names the columns (comma, semicolon or tab separated); each line below is one request. Use the column names as {{placeholders}} in the URL, headers and body.

## `rows` (type: `array`):

One request per item, for example \[{"id": 1, "name": "Ana"}, {"id": 2, "name": "Bo"}]. Nested values are reached with dots: {{address.city}}. A list of plain values (\["a", "b"]) is used as {{value}}.

## `rowsUrl` (type: `string`):

A link to a CSV, TSV, JSON or JSON Lines file with the rows, up to 50 MB. A Google Sheet link works when the sheet is shared as "Anyone with the link can view".

## `rowsDatasetId` (type: `string`):

Use the items of an Apify dataset as rows, for example the output of another actor run. Its fields become the {{placeholders}}.

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

One full address per line, each called with the method, headers and body set here. Use this instead of rows when you only have URLs (the URL template above can stay empty, or use {{url}} in it).

## `maxRequests` (type: `integer`):

Send only the first N rows, to test a template before the full run. 0 sends them all.

## `headers` (type: `object`):

Request headers as a JSON object, for example {"Authorization": "Bearer {{token}}", "Accept": "application/json"}. Values can use {{placeholders}} and must be plain ASCII (a row whose value has other characters is saved free as invalid_request). Content-Length, Transfer-Encoding and Connection are set by the actor and ignored here. Authorization and Cookie headers are not sent on to another host after a redirect.

## `jsonBody` (type: `object`):

A JSON body template. A value that is exactly "{{column}}" keeps the row's type (number, true/false, list); inside longer text it is inserted as text. Sent as application/json unless you set Content-Type.

## `formBody` (type: `object`):

A form body (application/x-www-form-urlencoded) as a JSON object of field names and values, for example {"email": "{{email}}"}. Use one body type per run.

## `textBody` (type: `string`):

Any other body (XML, GraphQL, plain text, a JSON list) as text with {{placeholders}}, inserted as is. Set Content-Type in Headers; the default is text/plain.

## `methodColumn` (type: `string`):

Optional. The name of a row column that holds each row's method (GET, POST, PUT, ...). Empty cells use Method above.

## `extract` (type: `object`):

Pull values out of each response into the extracted column. Keys are your column names; values are a JSON path (data.items\[0].id, items\[*].name), regex:PATTERN (first match, or its first group), regexAll:PATTERN (every match) or header:NAME. Example: {"userId": "data.id", "title": "regex:<title>(.*?)</title>", "remaining": "header:x-ratelimit-remaining"}.

## `responseFormat` (type: `string`):

How the response body is saved. None keeps items small when you only need the status code and extracted columns.

## `maxResponseKb` (type: `integer`):

The body is read up to this size; a longer one is cut and marked truncated: true. Extraction runs on what was read.

## `splitItemsPath` (type: `string`):

Optional. A JSON path to a list in the response (for example data.items). Each element becomes its own dataset item in the item field, next to the request's row and status, up to 1,000 per request (itemsTotal gives the list's length, itemsCut says it was cut). Still charged once per request.

## `includeResponseHeaders` (type: `boolean`):

Keep the response headers in each item.

## `includeRow` (type: `boolean`):

Keep each request's input row in the row field, so results join back to your sheet. Turn off when rows hold secrets.

## `maxConcurrency` (type: `integer`):

How many requests are in flight at once across all hosts.

## `maxConcurrencyPerHost` (type: `integer`):

How many requests one server gets at once (at most 20). Host names that point at the same address share this limit. Lower it for small APIs.

## `maxRequestsPerMinutePerHost` (type: `integer`):

Request starts per server per minute, retries and redirects included, spaced evenly (600 = one every 0.1 s; at most 1,200). Host names that point at the same address share this limit. Set it to your API's rate limit.

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

How long to wait for a connection and for each part of the answer.

## `maxRetries` (type: `integer`):

Extra tries after a timeout, a dropped connection or HTTP 408, 425, 429, 500, 502, 503 or 504, with exponential backoff (1 s, 2 s, 4 s ...). Retry-After is honoured. POST and PATCH are retried only when the request surely never arrived, or on 429 (or 503 with Retry-After), unless you turn on the option below.

## `maxRetryAfterSecs` (type: `integer`):

When a server asks to wait longer than this, the answer (for example the 429) is saved instead of waiting.

## `retryUnsafeMethods` (type: `boolean`):

Turn on only when sending the same POST twice is harmless (the API ignores duplicates).

## `followRedirects` (type: `boolean`):

Follow 301, 302, 303, 307 and 308 answers. Every hop is listed in redirects. Off: the 3xx answer itself is saved.

## `maxRedirects` (type: `integer`):

A longer chain is saved free as too_many_redirects. 0 does not follow: the 3xx answer itself is saved (and charged), as with Follow redirects off.

## `ignoreTlsErrors` (type: `boolean`):

Accept expired or self-signed certificates.

## Actor input object example

```json
{
  "url": "https://postman-echo.com/post?id={{id}}",
  "method": "POST",
  "csvRows": "id,name,email\n1,Ana Lima,ana@example.com\n2,Bo Chen,bo@example.com\n3,Cy Diaz,cy@example.com",
  "maxRequests": 0,
  "headers": {
    "Accept": "application/json"
  },
  "jsonBody": {
    "id": "{{id}}",
    "name": "{{name}}",
    "email": "{{email}}",
    "source": "bulk import"
  },
  "extract": {
    "echoedName": "json.name",
    "echoedId": "args.id"
  },
  "responseFormat": "auto",
  "maxResponseKb": 1024,
  "includeResponseHeaders": true,
  "includeRow": true,
  "maxConcurrency": 20,
  "maxConcurrencyPerHost": 5,
  "maxRequestsPerMinutePerHost": 600,
  "timeoutSecs": 30,
  "maxRetries": 2,
  "maxRetryAfterSecs": 60,
  "retryUnsafeMethods": false,
  "followRedirects": true,
  "maxRedirects": 10,
  "ignoreTlsErrors": false
}
```

# Actor output Schema

## `overview` (type: `string`):

One item per request: method, URL, status code, extracted columns and the error for requests that got no response.

## `bodies` (type: `string`):

Parsed JSON, text or base64 body per request, with content type, size and SHA-256.

## `timing` (type: `string`):

DNS, connect, TLS, time to first byte and total time, the server address and the redirect chain.

# 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 = {
    "url": "https://postman-echo.com/post?id={{id}}",
    "method": "POST",
    "csvRows": `id,name,email
1,Ana Lima,ana@example.com
2,Bo Chen,bo@example.com
3,Cy Diaz,cy@example.com`,
    "headers": {
        "Accept": "application/json"
    },
    "jsonBody": {
        "id": "{{id}}",
        "name": "{{name}}",
        "email": "{{email}}",
        "source": "bulk import"
    },
    "extract": {
        "echoedName": "json.name",
        "echoedId": "args.id"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("siteacs/bulk-http-request").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 = {
    "url": "https://postman-echo.com/post?id={{id}}",
    "method": "POST",
    "csvRows": """id,name,email
1,Ana Lima,ana@example.com
2,Bo Chen,bo@example.com
3,Cy Diaz,cy@example.com""",
    "headers": { "Accept": "application/json" },
    "jsonBody": {
        "id": "{{id}}",
        "name": "{{name}}",
        "email": "{{email}}",
        "source": "bulk import",
    },
    "extract": {
        "echoedName": "json.name",
        "echoedId": "args.id",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("siteacs/bulk-http-request").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 '{
  "url": "https://postman-echo.com/post?id={{id}}",
  "method": "POST",
  "csvRows": "id,name,email\\n1,Ana Lima,ana@example.com\\n2,Bo Chen,bo@example.com\\n3,Cy Diaz,cy@example.com",
  "headers": {
    "Accept": "application/json"
  },
  "jsonBody": {
    "id": "{{id}}",
    "name": "{{name}}",
    "email": "{{email}}",
    "source": "bulk import"
  },
  "extract": {
    "echoedName": "json.name",
    "echoedId": "args.id"
  }
}' |
apify call siteacs/bulk-http-request --silent --output-dataset

```

## MCP server setup

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

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/a3KdsAuXaKdiX7rRs/builds/Ucta532otcofgNYpS/openapi.json
