# Bulk HTTP Request — Call Any API for a List of Inputs (`openregistry/bulk-http-request`) Actor

Send hundreds of HTTP requests in one run: GET, POST, PUT, PATCH, DELETE with headers and JSON bodies, or one URL template filled from a list of variables. Retries on 429/5xx with Retry-After, per-host pacing, parsed JSON in the dataset. Pay per request.

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

## Pricing

$0.30 / 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 — call any API for a list of inputs

The missing block in many automations: **send the same API call for hundreds of inputs** and get every response back
as clean rows. Works with any REST/JSON API, webhooks, internal endpoints or plain pages.

**$0.30 per 1,000 requests.** Failed requests (after retries) are not charged.

### What you can do

- **Enrich a list**: one URL template, e.g. `https://api.example.com/companies/{{id}}`, filled from a list of IDs.
- **Bulk create or update**: POST/PUT/PATCH JSON bodies to an API or webhook (CRM, Airtable, Notion, your backend).
- **Check endpoints**: status codes and response times of many URLs.
- **Glue for Make, Zapier, n8n**: run it from a scenario and read the dataset.

### Built for real APIs

- `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`, custom headers, JSON or raw bodies.
- **Retries** on network errors, 408, 429 and 5xx, honouring `Retry-After`, then exponential backoff.
- **Rate limits**: overall concurrency plus a minimum delay per host.
- **JSON parsed** automatically into the `json` field; other bodies kept as text (length capped).
- Each row keeps its input index, label and template variables, so results join back to your list.

### Input examples

A list of requests:

```json
{
  "requests": [
    "https://httpbin.org/get",
    { "url": "https://httpbin.org/post", "method": "POST", "json": { "hello": "world" }, "label": "test" }
  ],
  "headers": { "Authorization": "Bearer YOUR_TOKEN" }
}
```

A template and variables:

```json
{
  "template": { "url": "https://api.github.com/repos/{{repo}}", "method": "GET" },
  "variables": [{ "repo": "apify/crawlee" }, { "repo": "nodejs/node" }],
  "minDelayPerHostMs": 1000
}
```

### Output

| Field | Example |
|---|---|
| `index`, `label`, `vars` | position in your input, your label, the template variables used |
| `method`, `url`, `finalUrl` | GET, requested URL, URL after redirects |
| `status`, `ok`, `contentType` | 200, true, application/json |
| `json` or `body`, `bodyTruncated`, `bodyLength` | parsed JSON, or text body |
| `ms`, `attempts` | response time, number of tries |
| `headers` | (optional) response headers |
| `error` | only on failed rows (not charged) |

### Pricing

Pay per event: **$0.0003 per request** that got an HTTP response (any status code, including 4xx). Requests that fail
with a network error or timeout after all retries are not charged.

### Responsible use

Requests are sent from Apify's servers with a `User-Agent` naming this tool unless you set your own. No proxies and no
anti-bot circumvention. Only call APIs and sites you are allowed to use, and respect their rate limits and terms.

# Actor input Schema

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

A list of URLs, or objects { url, method, headers, json, body, label }. Use json for a JSON body (Content-Type is set for you).

## `template` (type: `object`):

One request with {{placeholders}}, e.g. { "url": "https://api.example.com/users/{{id}}", "method": "GET" }. Filled once per entry of Variables.

## `variables` (type: `array`):

A list of objects, e.g. \[{ "id": 1 }, { "id": 2 }]. One request is sent per object using the template. Each result keeps its variables.

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

For example { "Authorization": "Bearer …" }. Per-request headers win. Store secrets in an Apify secret input or task, not in shared examples.

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

How many requests run at the same time overall.

## `minDelayPerHostMs` (type: `integer`):

Spaces out requests to the same host, to stay under an API's rate limit (e.g. 1000 = at most one per second).

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

Retries on network errors, 408, 429 and 5xx, honouring Retry-After, otherwise exponential backoff.

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

A request that takes longer counts as a failure (retried, then reported, not charged).

## `maxBodyChars` (type: `integer`):

Non-JSON bodies longer than this are cut (bodyTruncated = true). JSON responses are parsed into the json field.

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

Add all response headers to each row.

## Actor input object example

```json
{
  "requests": [
    "https://httpbin.org/get",
    {
      "url": "https://httpbin.org/post",
      "method": "POST",
      "json": {
        "hello": "world"
      }
    }
  ],
  "concurrency": 5,
  "minDelayPerHostMs": 0,
  "maxRetries": 2,
  "timeoutSeconds": 30,
  "maxBodyChars": 100000,
  "includeResponseHeaders": false
}
```

# Actor output Schema

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

No description

# 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": [
        "https://httpbin.org/get",
        {
            "url": "https://httpbin.org/post",
            "method": "POST",
            "json": {
                "hello": "world"
            }
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("openregistry/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 = { "requests": [
        "https://httpbin.org/get",
        {
            "url": "https://httpbin.org/post",
            "method": "POST",
            "json": { "hello": "world" },
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("openregistry/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 '{
  "requests": [
    "https://httpbin.org/get",
    {
      "url": "https://httpbin.org/post",
      "method": "POST",
      "json": {
        "hello": "world"
      }
    }
  ]
}' |
apify call openregistry/bulk-http-request --silent --output-dataset

```

## MCP server setup

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