# HTTP Request Runner: Send API Calls, Get JSON (`forgeloop/http-request-runner`) Actor

Send HTTP requests you define: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS with headers, query, JSON body and secret bearer or basic auth. Get status, headers, timings, redirects and the parsed JSON or text body as rows. For Make, n8n, Zapier and AI agents.

- **URL**: https://apify.com/forgeloop/http-request-runner.md
- **Developed by:** [Markus Heiß](https://apify.com/forgeloop) (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.00 / 1,000 http 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

## HTTP Request Runner: Send API Calls, Get JSON

Send the HTTP requests you define and get every response back as a clean dataset row. Any method, your own headers, query parameters, a JSON, text, form or binary body, and a bearer token or basic auth stored as a secret. Each row holds the status, the response headers, the redirect chain, the timings and the body, parsed as JSON when the server sends JSON.

Built for automations and agents that need one reliable step to call an API: Make, n8n, Zapier, AI agents, scheduled health checks and quick API tests without writing code.

### What it does

- **Sends any request:** GET, POST, PUT, PATCH, DELETE, HEAD and OPTIONS, up to 1,000 requests per run.
- **Two input forms:** a simple list of URLs that share one method, header set and body, or a JSON array of request objects with their own method, headers, query, body and label. Both can be used in one run.
- **Bodies:** objects and arrays are sent as JSON, strings as they are (JSON text gets `application/json`, other text `text/plain`), `form` objects as `application/x-www-form-urlencoded`, `bodyBase64` as raw bytes. Your own `Content-Type` always wins.
- **Secret auth:** a bearer token or `username:password` for basic auth in encrypted input fields. They are added to every request without its own `Authorization` header, never written to the output or the log, and dropped when a redirect leads to another host.
- **Reads the response for you:** JSON content types become objects, text types (HTML, XML, CSV, plain text) become strings, images, PDFs and other binary files become base64. gzip, deflate and brotli are decompressed. You can force JSON, text or base64.
- **Redirects:** follows up to 10 redirects, records every hop and returns the final URL. 303, and 301/302 after a POST, switch to GET like a browser does. Can be turned off.
- **Retries:** after network errors, timeouts, HTTP 408, 429 and 5xx, with 1, 2 and 4 s pauses. A `Retry-After` header of up to 60 s is honoured.
- **Rate control:** up to 10 parallel requests and an optional pause between request starts, for APIs with a rate limit.
- **Safe by design:** only `http` and `https`. Private, local and cloud metadata addresses (localhost, 10.x, 192.168.x, 169.254.169.254, IPv6 local ranges) are blocked for the URL and for every redirect hop, checked again at connect time.

### Use cases

- **Make, n8n, Zapier:** call an API that has no ready made module, start the run from your scenario and read the rows from the dataset.
- **AI agents:** give an agent one tool for "call this endpoint" that returns structured JSON with status, headers and errors in a fixed shape.
- **Scheduled checks:** run a list of API endpoints every hour on an Apify schedule and alert on `ok: false`, slow `timings.totalMs` or a changed body.
- **Bulk API calls:** send 500 lookups to an API you have access to, each with its own query and label, and export the answers as JSON, CSV or Excel.
- **Webhook and API testing:** send a POST with a JSON body to your own endpoint and see exactly what came back, redirects and headers included.

### Input

| Field | Description | Default |
|---|---|---|
| URLs | Simple form: one request per URL with the method, headers and body below | |
| Method (for URLs) | `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`. Also the default for Requests without a method | `GET` |
| Body (for URLs) | Text or JSON body for the URLs | |
| Requests | JSON array of request objects: `url`, `method`, `headers`, `query`, `body`, `form`, `bodyBase64`, `label` | |
| Headers | Headers for every request, as a JSON object. A request's own headers win. `null` removes a default header | |
| Query parameters | Added to every URL, as a JSON object. Arrays repeat the name | |
| Bearer token | Secret. Sent as `Authorization: Bearer ...` | |
| Basic auth | Secret. `username:password` | |
| Response body format | `auto`, `json`, `text` or `base64` | `auto` |
| Include response headers | All response headers in each row | on |
| Max response size | Bytes per body, up to 10 MB. Longer bodies are cut with `truncated: true` | 5 MB |
| Follow redirects, Max redirects | Up to 10 hops | on, 10 |
| Timeout | Seconds per attempt, redirects included, 1 to 120 | 30 |
| Retries | 0 to 5 | 2 |
| Parallel requests | 1 to 10 | 5 |
| Delay between requests | Milliseconds between request starts for the whole run | 0 |

Example, POST a JSON body with a bearer token (the token goes in the secret field, shown here in the input JSON):

```json
{
  "requests": [
    {
      "label": "create-order",
      "url": "https://api.example.com/v1/orders",
      "method": "POST",
      "headers": { "Accept": "application/json", "Idempotency-Key": "order-1001" },
      "body": { "sku": "A-100", "quantity": 2 }
    }
  ],
  "bearerToken": "YOUR_API_TOKEN",
  "retries": 0
}
```

Example, GET a list of URLs with shared query parameters, one request per second:

```json
{
  "urls": [
    "https://jsonplaceholder.typicode.com/posts/1",
    "https://jsonplaceholder.typicode.com/posts/2"
  ],
  "headers": { "Accept": "application/json" },
  "query": { "_format": "json" },
  "maxConcurrency": 1,
  "delayMs": 1000
}
```

### Output

One dataset item per request:

```json
{
  "index": 1,
  "label": "create",
  "request": {
    "method": "POST",
    "url": "https://httpbin.org/post",
    "headers": {
      "user-agent": "forgeloop-http-request-runner/0.1 (+https://apify.com/forgeloop)",
      "accept": "*/*",
      "accept-encoding": "gzip, deflate, br",
      "authorization": "***",
      "content-type": "application/json"
    },
    "bodyBytes": 15
  },
  "status": 200,
  "statusText": "OK",
  "ok": true,
  "finalUrl": "https://httpbin.org/post",
  "redirectCount": 0,
  "redirects": [],
  "redirectLimitReached": false,
  "contentType": "application/json",
  "bodyFormat": "json",
  "body": { "json": { "name": "test" }, "url": "https://httpbin.org/post" },
  "bodyBytes": 508,
  "truncated": false,
  "parseError": null,
  "responseHeaders": { "content-type": "application/json", "content-length": "508", "server": "gunicorn/19.9.0" },
  "timings": { "totalMs": 411, "ttfbMs": 405 },
  "attempts": 1,
  "startedAt": "2026-11-19T22:30:12.512Z",
  "blocked": false,
  "error": null
}
```

- `index` is the position in the input: entries under Requests first, then the URLs. Requests run in parallel, so use `index` or `label` to match rows, not the row order.
- `request.headers` shows what was sent. Values of `Authorization`, `Proxy-Authorization`, `Cookie`, `X-Api-Key` and every header with token, secret, key, auth, password, session or signature in its name are replaced by `***`. Query values with such names and passwords in URLs are masked the same way in `request.url`, `finalUrl` and `redirects`.
- `ok` is `true` for 2xx. A 404 or 500 is a normal answer: `ok: false`, `error: null`.
- `bodyFormat` is `json`, `text`, `base64` or `empty`. When a JSON response cannot be parsed or was cut, the body comes back as text and `parseError` says why.
- `bodyBytes` counts the body after decompression. `truncated` is `true` when the body was longer than the maximum size.
- `redirects` lists every hop with `url`, `status` and `location`. `redirectLimitReached` is `true` when the run stopped at the redirect limit and returned the last redirect response.
- `timings.totalMs` covers all attempts and redirects. `timings.ttfbMs` is the time to the response headers of the last hop.
- A body that would make the row larger than about 8.5 MB is stored in the key-value store instead. The row then has `bodyFormat: "record"`, `bodyRecordKey` and `bodyRecordUrl`.
- Requests without an HTTP answer (connection refused, timeout, DNS error, blocked private address, invalid entry) return an item with `status: null` and `error` set. `blocked` is `true` for private targets.
- The response body is returned as the server sent it. Echo services like httpbin.org repeat your request headers, tokens included, in the body.

### Pricing

Pay per request: 0.001 USD for every request that got an HTTP answer, whatever the status code, so 1.00 USD per 1,000 requests. Retries and redirects of one request count as one request. Network errors, timeouts, invalid entries and blocked private addresses are free. Set the maximum charge in Apify to cap the cost of a run.

Each run also has a start fee of 0.00005 USD per GB of memory, which Apify shows as Actor Start. 256 MB of memory is enough for most runs.

### Limits

- At most 1,000 requests per run and 10 in parallel. Split larger lists into several runs.
- Response bodies up to 10 MB each. Request bodies up to 5 MB each.
- Only `http` and `https`. No requests to private, local or link-local networks, and no proxy option. Calls come from Apify servers, so APIs that allow only listed IP addresses will refuse them.
- Retries send the request again. For calls that must not run twice (payments, orders) set Retries to 0 or use an idempotency key if the API supports one.
- Retry-After values above 60 s are not waited for. The row then holds the 429 or 503 answer.
- TLS certificates are always verified. Sites with invalid certificates return an error item.
- HTTP/1.1 only. No WebSockets, no streaming, no cookies kept between requests.

### Data source, permitted use and legal

- **Data source:** The servers and APIs you list in the input. The Actor sends exactly the requests you define and returns the answers. It is not affiliated with any of the services you call.
- **Snapshot:** Results show the answers at the time of the run. We do not guarantee that they are complete, current or correct.
- **For business use:** This Actor is offered to businesses only, not to consumers.
- **Permitted use:** Call only APIs and sites you own or are allowed to use, within their terms and rate limits. Do not use this Actor for load tests, stress tests, denial of service, vulnerability scans or any attack on systems you do not own.
- **Your responsibility:** You choose the targets, the credentials and the request content, and you are responsible for them and for what happens with the results. If your requests or the answers contain personal data, you are the controller and need your own legal basis. Use credentials only for accounts you are entitled to use.
- **No circumvention:** The Actor does not bypass logins, captchas, rate limits, IP blocks or other access restrictions, and it has no proxy option.
- **Request volume:** At most 1,000 requests per run and 10 at a time, with optional pauses between requests. Set them so that the target is not overloaded.
- **Provider:** forgeloop, Markus Heiss, Austria. [Imprint](https://devhem.github.io/forgeloop-legal/imprint.html), [Privacy Notice](https://devhem.github.io/forgeloop-legal/privacy.html), [Terms of Use](https://devhem.github.io/forgeloop-legal/terms.html).

### Questions and issues

Open an issue on the Actor page.

# Actor input Schema

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

Simple form: one request per URL, all with the method, headers and body below. URLs without a scheme get https://. Format: a list of strings like \["https://api.example.com/items?page=1"].

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

HTTP method for the URLs above. Also the default for entries under Requests without their own method.

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

Request body for the URLs above, for example {"name": "test"}. Valid JSON is sent with Content-Type application/json, other text as text/plain, unless you set Content-Type under Headers. Ignored for HEAD.

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

Full form: a JSON array of request objects. Each object: url (required), method, headers (object), query (object), body (string, or object/array sent as JSON), form (object sent URL encoded), bodyBase64 (binary body) and label (copied to the output to match rows). Example: \[{"label": "create", "url": "https://httpbin.org/post", "method": "POST", "headers": {"X-Request-Id": "42"}, "body": {"name": "test"}}]. Can be used together with URLs.

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

Headers for every request, as a JSON object like {"Accept": "application/json"}. Headers of a single entry under Requests win. Set a header to null to remove a default, for example {"User-Agent": null}. Put tokens in the secret fields below, not here.

## `query` (type: `object`):

Query parameters added to every URL, as a JSON object like {"page": 1, "tags": \["a", "b"]}. Arrays repeat the parameter. Parameters already in the URL stay.

## `bearerToken` (type: `string`):

Optional. Sent as Authorization: Bearer <token> with every request that has no Authorization header of its own. Stored encrypted, masked in the output and the log, and dropped when a redirect leads to another host.

## `basicAuth` (type: `string`):

Optional. username:password, sent as Authorization: Basic with every request that has no Authorization header of its own. Stored encrypted, masked in the output and the log. Use either this or the bearer token.

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

Auto parses JSON content types into objects, returns text types as text and everything else (images, PDFs, ZIP) as base64. JSON always tries to parse, Text always decodes as text, Base64 always returns raw bytes as base64.

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

Add all response headers to each item (lower case names).

## `maxResponseBytes` (type: `integer`):

Read at most this many bytes of each response body (after decompression). Longer bodies are cut and get truncated: true. Default 5 MB, maximum 10 MB.

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

Follow 301, 302, 303, 307 and 308 redirects and record every hop. Turn off to get the redirect response itself.

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

Stop after this many redirects and return the last redirect response with redirectLimitReached: true.

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

Give up on one attempt after this many seconds, redirects included.

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

Retries after network errors, timeouts, HTTP 408, 429 and 5xx (not 501, 505). Waits 1, 2, 4 s or what the server asks for in Retry-After (up to 60 s). Retries send the request again, so use 0 for calls that must not run twice.

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

How many requests run at the same time.

## `delayMs` (type: `integer`):

Minimum pause between the start of two requests across the whole run. Use it to respect the rate limit of an API, for example 1000 for one request per second.

## Actor input object example

```json
{
  "urls": [
    "https://jsonplaceholder.typicode.com/todos/1"
  ],
  "method": "GET",
  "responseFormat": "auto",
  "includeResponseHeaders": true,
  "maxResponseBytes": 5242880,
  "followRedirects": true,
  "maxRedirects": 10,
  "timeoutSecs": 30,
  "retries": 2,
  "maxConcurrency": 5,
  "delayMs": 0
}
```

# 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 = {
    "urls": [
        "https://jsonplaceholder.typicode.com/todos/1"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("forgeloop/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 = { "urls": ["https://jsonplaceholder.typicode.com/todos/1"] }

# Run the Actor and wait for it to finish
run = client.actor("forgeloop/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 '{
  "urls": [
    "https://jsonplaceholder.typicode.com/todos/1"
  ]
}' |
apify call forgeloop/http-request-runner --silent --output-dataset

```

## MCP server setup

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