# Bulk HTTP Request Runner – API calls for Clay, n8n & Make (`lundrik/bulk-http-request`) Actor

Send one or thousands of HTTP requests (GET, POST, PUT, PATCH, DELETE) with headers, JSON body and query params. Get status, headers and parsed JSON. Pay only for 2xx responses.

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

## Pricing

from $1.00 / 1,000 successful http responses

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 Request Runner – API calls for Clay, n8n & Make

Send **one or thousands of HTTP requests** (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) with your own headers, JSON body and query parameters – and get back the **status code, response headers and the parsed JSON body** in a clean dataset. **You pay only for successful (2xx) responses.** 4xx/5xx answers, timeouts and connection errors are free.

Typical uses:

- **Clay, n8n, Make, Zapier:** call any REST API or webhook from a table row without a paid "HTTP" plan or code.
- **Batch API jobs:** enrich 5,000 rows from your own API, push records to a CRM, trigger webhooks.
- **AI agents (MCP):** a safe, cheap "call this endpoint" tool with structured output.
- **Monitoring:** check that a list of endpoints answers 200 and how fast.

### Why this Actor

- **Pay only for 2xx.** One price per successful response. Non-2xx responses are still returned (with the body, so you can see the API's error message) but are **not charged**.
- **Safe retries.** 429 and 503 are retried for free, honouring `Retry-After`. Connection errors and 502/504 are retried only for idempotent methods (GET, HEAD, PUT, DELETE, OPTIONS) – **a POST is never sent twice by accident**.
- **Parsed output.** JSON responses are parsed, text stays text, binary files (images, PDFs) come back as base64. Pick fields with `extract` (e.g. `data.items[0].id`) so you do not have to parse anything downstream.
- **Your secrets stay yours.** Headers and bodies are never written to the log. `Authorization` and `Cookie` headers are **not forwarded to another domain** after a redirect. `Set-Cookie` is left out of the output.
- **Batch, not one run per call.** Up to 10,000 requests per run, up to 8 in parallel, each with its own row and `requestId`.

### Input

Simplest (one call – ideal for Clay / n8n / Make):

```json
{
  "url": "https://api.example.com/v1/contacts",
  "method": "POST",
  "headers": { "Authorization": "Bearer YOUR_TOKEN" },
  "json": { "email": "ann@example.com", "plan": "pro" },
  "extract": { "contactId": "data.id" }
}
```

Batch (top-level `method`, `headers`, `json`/`body`, `queryParams` are defaults for every request):

```json
{
  "headers": { "Authorization": "Bearer YOUR_TOKEN" },
  "requests": [
    "https://api.example.com/v1/orders/1001",
    { "url": "https://api.example.com/v1/orders", "method": "POST", "json": { "sku": "A-17" }, "id": "row-17" },
    { "url": "https://api.example.com/v1/search", "queryParams": { "q": "shoes", "page": 2 } }
  ]
}
```

| Field | Default | What it does |
|---|---|---|
| `url` | – | One endpoint to call |
| `requests` | – | List of URLs or `{url, method, headers, json, body, queryParams, id}` (max 10,000) |
| `method` | GET | Default method |
| `headers` | {} | Default headers (a JSON string is also accepted) |
| `json` | – | JSON body (adds `Content-Type: application/json`) |
| `body` | – | Raw text body (form data, XML…), sent as is |
| `queryParams` | {} | Added to every URL |
| `extract` | – | `{name: "path.to[0].field"}` → values in `extracted` |
| `responseFormat` | auto | auto / json / text / base64 / none |
| `maxResponseSizeKb` | 2048 | Bigger bodies are cut (`bodyTruncated: true`), max 6144 |
| `timeoutSecs` | 30 | Per request, max 300 |
| `followRedirects` | true | Off: the 3xx response is the result |
| `maxRetries` | 2 | Free retries (see above), max 5 |
| `includeResponseHeaders` | true | Adds `responseHeaders` |
| `maxConcurrency` | 0 (=5) | Parallel requests, max 8 |

Duplicates are **not** removed: if you list the same request twice, it is sent twice (and appears as two rows).

### Output

One dataset row per request, in the **Overview** view as a table:

```json
{
  "requestId": "row-17",
  "method": "POST",
  "url": "https://api.example.com/v1/orders",
  "finalUrl": "https://api.example.com/v1/orders",
  "status": "ok",
  "statusCode": 201,
  "contentType": "application/json",
  "responseHeaders": { "content-type": "application/json", "x-request-id": "abc" },
  "body": { "id": 98123, "sku": "A-17" },
  "bodyFormat": "json",
  "bodyTruncated": false,
  "responseBytes": 31,
  "extracted": { "orderId": 98123 },
  "redirects": 0,
  "timeToFirstByteMs": 142,
  "attempts": 1,
  "durationMs": 150,
  "charged": "http-response",
  "errorCode": null,
  "errorMessage": null
}
```

`status` values:

- `ok` – 2xx response (or 3xx with `followRedirects: false`). **Charged.**
- `http_error` – the server answered 4xx/5xx. Body included. **Free.**
- `error` – no response: `TIMEOUT`, `CONNECTION_FAILED`, `DNS_NOT_FOUND`, `SSL_ERROR`, `INVALID_URL`, `INVALID_REQUEST`, `PRIVATE_ADDRESS_BLOCKED`. **Free.**
- `skipped` – your maximum cost per run was reached; the request was not sent. **Free.**

A `RUN_SUMMARY` record in the key-value store has the counts and charged events.

### Pricing

Pay per event:

| Event | Price | When |
|---|---:|---|
| `http-response` | **$0.001** | One request answered with a 2xx status |

That is **$1 per 1,000 successful calls**. Everything else is free (apart from the small standard Apify Actor start fee, if set).

Examples: 1 call = $0.001 · 10,000 calls with 9,700 × 200 and 300 × 404 = $9.70.

Set **Maximum cost per run** in the run options to cap your spend: requests over the limit are not sent and are marked `skipped`.

### Limits and fair use

- Only public `http://` and `https://` addresses. Private, internal and cloud-metadata addresses are blocked (also after redirects).
- No proxies, no CAPTCHA solving and no bot-protection bypass. This is an API client, not a scraper.
- Do not use it for load testing or to flood a service – up to 8 parallel requests per run. You are responsible for following the terms of the APIs you call.
- Max response stored per row: 6 MB.

### FAQ

**Does a 404 cost money?** No. Only 2xx responses are charged.

**Will my POST be sent twice if the network fails?** No. POST and PATCH are retried only on 429/503, when the server says it did not process the request.

**Can I send form data or XML?** Yes – put it into `body` and set your own `Content-Type` header.

**Where do I see the API's error message?** In `body` of the `http_error` row.

Issues and feature requests are welcome in the **Issues** tab.

# Actor input Schema

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

One endpoint to call. Use `requests` instead for a batch.

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

Default method. A request in `requests` can override it.

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

Default headers, e.g. {"Authorization": "Bearer …", "Content-Type": "application/json"}. A JSON string is also accepted. Headers are never written to the log and are not sent to another domain after a redirect.

## `json` (type: `object`):

Default JSON body for POST/PUT/PATCH/DELETE. Sent with Content-Type: application/json (unless you set another one).

## `body` (type: `string`):

Default raw body, sent as is (e.g. form data a=1\&b=2 or XML). If it is valid JSON and no Content-Type is set, application/json is added. Ignored when `json` is given.

## `queryParams` (type: `object`):

Added to every URL, e.g. {"page": 2, "limit": 100}.

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

List of URLs or request objects: {"url": "…", "method": "POST", "headers": {…}, "body": {…}, "queryParams": {…}, "id": "row-17"}. Up to 10,000 per run. Duplicates are NOT removed – each item is sent and returned as its own row (`requestId` = your id or req-1, req-2…).

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

Optional. Copy values from a JSON response into `extracted`, e.g. {"id": "data.items\[0].id", "total": "meta.total"}. Missing paths give null.

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

auto: JSON is parsed, text stays text, binary files become base64. none: only status and headers (smallest output).

## `maxResponseSizeKb` (type: `integer`):

Larger bodies are cut at this size (`bodyTruncated: true`).

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

A request that gets no response in time fails with TIMEOUT (free of charge).

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

Off: a 3xx response is returned as the result (and counts as a success).

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

Free retries on 429 and 503 (honouring Retry-After, up to 30 s). 502/504 and connection errors are retried only for GET, HEAD, PUT, DELETE and OPTIONS – never for POST/PATCH, so nothing is sent twice by accident.

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

Adds `responseHeaders` to each row (Set-Cookie is always left out).

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

How many requests run in parallel. 0 = automatic (5). Lower it if the API has strict rate limits.

## Actor input object example

```json
{
  "url": "https://jsonplaceholder.typicode.com/posts/1",
  "method": "GET",
  "headers": {},
  "responseFormat": "auto",
  "maxResponseSizeKb": 2048,
  "timeoutSecs": 30,
  "followRedirects": true,
  "maxRetries": 2,
  "includeResponseHeaders": true,
  "maxConcurrency": 0
}
```

# Actor output Schema

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

Dataset rows: requestId, method, url, status (ok | http_error | error | skipped), statusCode, body, extracted.

## `summary` (type: `string`):

RUN_SUMMARY record: counts, charged events, cost estimate.

# 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://jsonplaceholder.typicode.com/posts/1",
    "headers": {}
};

// Run the Actor and wait for it to finish
const run = await client.actor("lundrik/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://jsonplaceholder.typicode.com/posts/1",
    "headers": {},
}

# Run the Actor and wait for it to finish
run = client.actor("lundrik/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://jsonplaceholder.typicode.com/posts/1",
  "headers": {}
}' |
apify call lundrik/bulk-http-request --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lundrik/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/TD37NQmIjJjS7Hijb/builds/xumbBdpkTsMIluqhv/openapi.json
