# Bulk HTTP Request Runner: Batch API Calls (`bardach_technologies/bulk-http-request-runner`) Actor

Bulk HTTP request runner for batch API calls: send a list of requests in one run and get one row per unique request with status, headers and body. Per-host rate limits, safe retries and restart, secret headers kept out of the output. For endpoints you own or may use.

- **URL**: https://apify.com/bardach_technologies/bulk-http-request-runner.md
- **Developed by:** [Bardach Technologies](https://apify.com/bardach_technologies) (community)
- **Categories:** Developer tools, Automation, Integrations
- **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 request completeds

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: Batch API Calls

**Bulk HTTP Request Runner** sends a list of HTTP requests (batch API calls) to endpoints you own or are entitled to use and returns **one row per unique request**: status, safe headers and a cleaned body. Each request is sent exactly as you listed it, with strict limits per host, safe retries and a safe restart. Your credentials go in a secret field and are kept out of every row, stored body, log and summary.

Typical jobs: calling your own or a licensed API for a list of records, checking a set of endpoints on a schedule, and sending a reviewed batch of updates once.

### How to run it

1. Add your requests under **Requests**: each entry is a URL, or an object with `url` and optional `method`, `headers`, `body` and `label`.
2. If the API needs a key, put it in **Secret headers** (a JSON object or lines of `Name: value`) and name the hosts that may receive it under **Hosts that may receive secret headers**.
3. Keep the other settings for a first run: the defaults are low (one request at a time per host, 30 per minute per host).
4. Click **Start**. Read one row per request in the Output tab, download it as JSON, CSV or Excel, or read it through the Apify API. The run summary is the `OUTPUT` record.
5. To run it on a schedule or from your own code, use Apify schedules or the Apify API with the same input JSON.

### What you get

| Field | Meaning |
|---|---|
| `outcome` | `completed`, or the reason there is no paid result |
| `httpStatus`, `finalUrl` | Final status and the address that gave it, without sensitive values |
| `attempts`, `redirectCount`, `responseTimeMs` | How the request went |
| `responseHeaders` | Safe headers only, such as content type, ETag and rate-limit counters |
| `body` or `bodyKey` | Cleaned text or JSON, in the row or in the key-value store as plain text |
| `bodyBytes`, `bodySha256` | Size and hash, useful for spotting changes between scheduled runs |
| `pickedFields` | The JSON values you asked for by path |
| `refusalCategory`, `failureHttpStatus`, `detail` | Why a request gave no paid result |

The run summary is in the `OUTPUT` record.

### Example input

```json
{
  "requests": [
    "https://api.example.com/v1/items/1",
    {"url": "https://api.example.com/v1/items/2", "label": "second item"}
  ],
  "secretHeaders": "{\"Authorization\": \"Bearer your-own-token\"}",
  "secretHeaderHosts": ["api.example.com"],
  "pickJsonFields": ["data.id", "data.status"]
}
```

### Example output row

```json
{
  "position": 2,
  "label": "second item",
  "method": "GET",
  "requestUrl": "https://api.example.com/v1/items/2",
  "outcome": "completed",
  "billable": true,
  "httpStatus": 200,
  "finalUrl": "https://api.example.com/v1/items/2",
  "attempts": 1,
  "bodyFormat": "json",
  "pickedFields": {"data.id": 2, "data.status": "open"},
  "credentialsSent": true
}
```

This row is an illustration of the format.

### How requests are made

- **robots.txt is read first** on every origin. A disallowed address is not requested, and only a missing robots.txt (404 or 410) means no rules; any other answer, such as 400, 405 or a server error, counts as unreadable and that host is not requested. Many APIs disallow all paths in robots.txt: those requests come back as free `robots_blocked` rows.
- **Low limits by default:** one request at a time per host, 30 per minute per host, 200 per host, 1,000 per run and 25 hosts per run. Subdomains of a site count as one host. Retries and redirects count too.
- **Retries** apply only to GET, HEAD and OPTIONS, after a timeout, a dropped connection, or a 502, 503 or 504 answer.
- **Writes need your opt-in.** POST, PUT, PATCH and DELETE, and any request with a method-override header (`X-HTTP-Method-Override`, `X-HTTP-Method`, `X-Method-Override`), are sent at most once: no retry, no redirect, and no resend after a restart. A write interrupted by a restart gets a free `write_outcome_unknown` row, so check it yourself.
- **Refusals stop the host.** 401, 402, 403, 407, 429, 451, other client refusals, edge refusals (520-529), non-standard statuses such as 999, challenge pages and login redirects are saved, not retried, free, and end all work on that host for the run. Ordinary API answers such as 400, 409 and 422 are returned as results.
- **The run time limit is respected.** A request that could not finish before the limit is not started; it stays open and a resurrected run sends it.
- **Every address is checked**, including each redirect target and the address actually connected to. Private and internal networks are refused.
- The Actor identifies itself as `BulkHttpRequestRunner`. Its user agent cannot be changed, and headers that reroute or rewrite a request at a proxy or name a client address are refused as whole families, judged by the words in the header name: any `IP` word (`Client-IP`, `X-Real-IP`, `X-Custom-IP-Authorization`, `X-Azure-ClientIP`), anything that forwards (`X-Forwarded-*`, `X-Forward-For`), rewrites or sets a destination (`X-Rewrite-URL`, `Destination`), an original or overriding URL, host or path (`X-Original-URL`, `X-Override-URL`, `X-Host-Override`), a proxy or a URL scheme, any name that is only an address (`X-Host`, `X-Host-Name`, `Request-Uri`, `X-Request-Uri`, `Base-Url`), and any `X-Upstream-*` or `X-Backend-*` name. Other `X-Client-*` and `X-Original-*` names, such as `X-Client-Id` or `X-Original-Request-Id`, are accepted.

### Credentials

Put credentials only in **Secret headers**, and name the hosts that may receive them. They are dropped when a redirect leaves the origin. Their values are removed from output, also when a server echoes them, in plain, URL-encoded, Base64 or hex form. Credentials in the request list are refused. Cookies are refused everywhere: logged-in sessions are not supported.

**Credentials in URLs** are refused by default: a user name and password, a credential-named parameter such as `?token=`, and tokens with a known shape in the path or query (Telegram bot tokens, also percent-encoded; Slack services, workflow and trigger webhooks; Discord webhooks of any API version; Teams, Zapier and IFTTT webhook addresses, and secret-looking path parts after `webhook` or `hooks` on any host; Stripe `sk_`/`rk_` keys, AWS key ids, Google, GitHub, GitLab, Slack and SendGrid tokens). Webhook addresses are recognised after normalising the URL (host case, default port, trailing dot, percent-encoding, an encoded slash or backslash such as `%2F` or `%5C` read as `/`, empty path segments and path parameters). If an API only accepts its token in the URL, turn on **Allow credentials inside URLs**: the request is sent, and `requestUrl`, `finalUrl` and every other row field show those parts as `REDACTED`, also where a server repeats them in a kept response header. A refused URL is shown in the same redacted form in its free row. Input that is not a valid http or https URL (for example with a backslash, `%5C`, a space or `[` after the host) shows no path: only its scheme and host, with `/REDACTED` in place of anything after the host, or just `REDACTED` when no host can be read. A single short word without dots or URL signs (such as `-2+3`) is shown as typed, with a leading `'` if a spreadsheet could read it as a formula. A user name and password in a URL are always refused.

**Bodies are cleaned before they are stored.** Sensitive JSON fields, bearer strings, JWTs, tokens with a known shape and private keys are replaced by `REDACTED`, and so is a value written after a credential-named field in plain text (`aws_secret_access_key = ...`, `client_secret: ...`); a secret with no known shape and no such field name cannot be recognised and stays. E-mail addresses (also written with a full-width `＠`, `%40` or `&#64;`, and also when used as a JSON field name), phone numbers (also in full-width or other-script digits and with any Unicode dash, minus sign or middle dot, and a number or a string of 7 to 15 digits, with or without a leading `+`, stored anywhere below a phone-like JSON field such as `phone`, `mobile`, `tel` or `fax`, for example `phone.number` or `phones[0].value`; under `contact`, `contacts` or `cell` only the field's own value and list), valid IBANs, payment card numbers and US social security numbers are masked in bodies and `pickedFields` and counted in `contactDetailsMasked`, so a body can differ from what the server sent. Invisible characters (soft hyphen, zero-width space and joiners, word joiner, byte order mark and every other Unicode format character) are removed before these checks, so they cannot split an address or number. A URL path segment holding an e-mail address or phone number, also after a redirect, is shown as `REDACTED`. A phone number written as bare digits with no `+`, separator or phone-like label around it looks like any other number and is kept. Not recognised either: an e-mail address written with an HTML-entity or double-encoded dot or `@` (`&#46;`, `%2540`), an ideographic full stop (`。`) as its dot, or a word such as `{at}`, `<at>`, `arobase` or `arroba` instead of `@`, and phone numbers spelled out in words. Names, street addresses and birth dates cannot be recognised reliably and are not removed: do not use this Actor to collect personal data. The `label` you give a request is masked the same way (e-mail addresses and phone numbers in it are replaced) before it appears in any row, so do not put contact details in labels.

### What this Actor will not do

It has no load testing, proxy rotation, user-agent changes or ways around a block. It does not generate URLs from templates, ranges or word lists, and an exact repeat runs once. It does not submit passwords (fields such as `password`, `pass`, `pwd`, `pw`, also inside brackets or URL-encoded), and it stops a host after 25 not-found answers in a row or 5 failures in a row.

### Pricing

Pay per event: **USD 0.001 per completed request**, plus Apify's small actor-start event. A completed request is a unique listed request that received a final answer below status 500 and was delivered whole, including answers such as 404. Everything else is free: refusals, challenges, 5xx answers, network failures, oversized or cut bodies, robots blocks and requests not sent. Your maximum charge is respected.

**Cost example:** 1,000 listed requests that all get a final answer below status 500 cost 1,000 x USD 0.001 = USD 1.00, plus Apify's actor-start event (USD 0.00005 per run). If 100 of them end in 5xx answers or refusals, only the other 900 are charged: USD 0.90 plus the start event.

### Limits and troubleshooting

- `robots_blocked` or `robots_unavailable`: the host's robots.txt does not allow the request, or could not be read.
- `refused` or `host_stopped`: the host refused the Actor. Check your credentials and your entitlement before running again.
- `body_too_large`: raise **Largest response body**, or choose **Do not keep** if the status is enough.
- `secret_in_plain_field`: move the credential to **Secret headers**, or allow credentials inside URLs if the API needs them there.
- `cookie_not_supported`: cookies and logged-in sessions are not supported.
- The `OUTPUT` summary says `stopped` with `stopReason` `cap_reached`, `state_damaged` or `timeout` when listed requests were not sent. `httpRequestsSent` counts requests this run actually sent; `httpRequestsReserved` is the saved count the caps use across restarts.
- Labels, echoed invalid entries, `contentType` and kept response header values that start with `=`, `+`, `-` or `@` get a leading `'` so a spreadsheet does not run them. Response bodies are kept as the server sent them (after cleaning), so take care when opening a CSV export.
- `request_cap_reached` or `host_cap_reached`: raise the caps if the host's terms allow it.
- After a forced restart, one batch of already delivered rows can stay uncharged. You are never charged twice.

Use this Actor only for endpoints you are entitled to call, and follow their terms.

### FAQ

**Does it send POST, PUT, PATCH or DELETE?** Only when you switch on **Allow write methods** (`allowWriteMethods`, off by default). A write is sent at most once: no retry and no redirect.

**Where do my API keys go?** In **Secret headers**, with the hosts that may receive them. They are kept out of rows, stored bodies, logs and the summary. Cookies and logged-in sessions are not supported.

**Why do I get `robots_blocked`?** robots.txt is read first on every origin, and many APIs disallow all paths in it. Those requests come back as free rows and are not sent.

**What happens when a host refuses or shows a challenge?** The answer is saved, not retried, free, and that host is stopped for the rest of the run.

**Is it a load-testing or scraping tool?** No. It has no load testing, proxy rotation, user-agent changes or ways around a block, and its default limits are low.

**How do I spot changes between scheduled runs?** Compare `bodySha256` and `bodyBytes` of the same request across runs.

### Related Actors

- **Dataset Merge & Deduplicate**: merge the rows of several runs into one dataset and remove duplicates.

# Actor input Schema

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

Up to 20,000 entries. Each is a URL, or an object with url and optional method, headers, body and label. Requests are never generated or expanded, and an exact repeat runs once. Do not put credentials here: use Secret headers.

## `secretHeaders` (type: `string`):

Your own credentials, as a JSON object or as lines of Name: value. They are stored encrypted, sent only to the hosts listed below on the origin each request started on, and removed from all output.

## `secretHeaderHosts` (type: `array`):

Exact host names, such as api.example.com. Required when Secret headers is set.

## `allowWriteMethods` (type: `boolean`):

Allows POST, PUT, PATCH and DELETE, and method-override headers such as X-HTTP-Method-Override, which make a request a write. A write is sent at most once: no retry, no redirect, and no resend after a restart.

## `allowCredentialUrls` (type: `boolean`):

Off: a URL with a token in its path or query (bot tokens, webhook secrets, API keys, credential-named parameters) is refused. On: it is sent, and every row shows those parts as REDACTED. A user name and password in a URL are always refused. Prefer Secret headers.

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

Extra attempts for GET, HEAD and OPTIONS after a timeout, a dropped connection, or a 502, 503 or 504 answer.

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

Read requests only. Every target is checked again. Set 0 to return the redirect itself.

## `timeoutSeconds` (type: `integer`):

Time limit for one HTTP request.

## `requestsPerMinutePerHost` (type: `integer`):

Most requests one host receives per minute. Subdomains of a site count as one host.

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

Most requests in progress at once on one host.

## `maxRequestsPerHost` (type: `integer`):

Most HTTP requests sent to one host in this run, counting retries and redirects.

## `maxTotalRequests` (type: `integer`):

Most HTTP requests sent in this run, counting retries and redirects.

## `maxHosts` (type: `integer`):

Most different hosts contacted in this run.

## `responseBody` (type: `string`):

Where the cleaned text or JSON body goes. Binary bodies are described by size and hash and are not stored.

## `maxBodyKb` (type: `integer`):

A larger body gives a free body_too_large row. At most 256 KB in the dataset row or 1,024 KB in the key-value store.

## `pickJsonFields` (type: `array`):

Dot paths such as data.items.0.id. Their values appear in pickedFields.

## Actor input object example

```json
{
  "requests": [
    {
      "url": "https://example.com/",
      "label": "Example request"
    }
  ],
  "allowWriteMethods": false,
  "allowCredentialUrls": false,
  "maxRetries": 1,
  "maxRedirects": 3,
  "timeoutSeconds": 20,
  "requestsPerMinutePerHost": 30,
  "maxConcurrencyPerHost": 1,
  "maxRequestsPerHost": 200,
  "maxTotalRequests": 1000,
  "maxHosts": 25,
  "responseBody": "inline",
  "maxBodyKb": 128
}
```

# Actor output Schema

## `results` (type: `string`):

One row per listed request.

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

How the run ended, counts per outcome, stopped hosts and requests charged.

# 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": [
        {
            "url": "https://example.com/",
            "label": "Example request"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bardach_technologies/bulk-http-request-runner").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": [{
            "url": "https://example.com/",
            "label": "Example request",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("bardach_technologies/bulk-http-request-runner").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": [
    {
      "url": "https://example.com/",
      "label": "Example request"
    }
  ]
}' |
apify call bardach_technologies/bulk-http-request-runner --silent --output-dataset

```

## MCP server setup

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

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/mcKSC6ZYeJnCrqda8/builds/15KKKMeah7HrQZcww/openapi.json
