# HTTP Request Runner (no user code) (`gramsesh/http-runner`) Actor

Send a batch of HTTP requests you supply and get status, headers, body, timing and errors in a dataset. No user code is executed. Private, loopback and metadata addresses are blocked. Each attempted request is billed, including failures; input errors and pre-send blocks are free.

- **URL**: https://apify.com/gramsesh/http-runner.md
- **Developed by:** [Gramsesh](https://apify.com/gramsesh) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.75 / 1,000 http requests attempted (up to 2 mb response included)

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/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 (no user code)

Send a batch of HTTP requests you supply. The Actor returns one dataset row per request with status, redacted headers, body, timing and errors. **It never executes user code**, has no proxy rotation, and will not send CONNECT or TRACE.

Private, loopback, link-local and cloud-metadata addresses (including `169.254.169.254`) are blocked. The check runs before the request, again after DNS, and on every redirect. Connections are pinned to the already-checked IP so a later DNS answer cannot retarget the socket.

Each request that **attempts a network call** is billed as `http-request`, including timeouts and connection failures. The 1 MiB default / 2 MiB hard response cap is included; there is no `response-megabyte` event. Input-validation errors, pre-send blocks and skipped rows are **free**.

### Input

- `requests`: list of `{url, method, headers, body, timeoutSecs}`
- Methods: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`
- `concurrency`, `retries`, `perHostRatePerSecond`, body and timeout caps, `responseFormat`, `revealSensitiveHeaders`

#### Caps (defaults / hard maxima a user cannot exceed)

| Cap | Default | Hard max |
|---|---:|---:|
| Requests per run | 100 | 200 |
| Concurrency | 5 | 10 |
| Per-host rate | 2/s | 5/s |
| Request body | 256 KiB | 1 MiB |
| Response body | 1 MiB | 2 MiB |
| Timeout | 8 s | 10 s |
| Redirects | 5 | 10 |
| Retries | 2 | 5 |
| Run hang cap | 30 s | 30 s |

Default run memory is **128 MB** (minimum 128 MB, maximum 2,048 MB). The platform default timeout is **45 s**, a short buffer over the 30 s in-actor hang cap so results can be written.

### Output

One dataset row per request:

- `status`: `ok` (billed), `blocked` (SSRF or disallowed method; free), `failed` (network, timeout, or connection error; billed if a request was sent), `skipped` (over the per-run or run-time cap; free)
- `statusCode`, redacted `headers`, `body` (JSON, text or base64), `timing`, `redirects`, `error`

`Authorization`, `Cookie`, `Set-Cookie` and similar headers are **always redacted in logs**. They are redacted in the dataset unless you turn on `revealSensitiveHeaders`. URL userinfo, query strings and fragments are stripped from logged and stored URLs.

### Where your output goes

Every dataset row and the run's `SUMMARY` are written only to **this run's default storage**, which belongs to the Apify account that started the run. Nothing is copied to a Gramsesh account, to Cloudflare, or to any server of ours.

### Acceptable use

Do not use this Actor to request, store or distribute illegal content, including child sexual abuse material. We do not open customer runs except to answer an Issue you have asked us to look at. We report illegal content to Apify, and CSAM to NCMEC. Support: <chris@gramsesh.com>.

### Terms of use

You must have the right to send each request to the target site, and you must follow that site's terms and applicable law. Do not use this Actor to flood, probe or attack a service, to bypass authentication, paywalls or access controls, or to reach addresses that are not yours on a private network. The platform may suspend abuse. Rate and size caps are enforced; they are not an invitation to run at the cap against a third-party site.

### Pricing

Pay per event.

- `http-request`: **$0.00075** per attempted network request, including failures. The 1 MiB default / 2 MiB hard body cap is included; there is no `response-megabyte` event.
- `apify-actor-start`: **$0.00005** per GB (minimum 1). A default 128 MB run is one start event (**$0.00005**).

A 1-request run at the default memory costs **$0.00080** listed. Input-validation errors, pre-send blocks and skipped rows are **free** (you still pay the start event). Platform usage is not passed through.

Empty and all-blocked runs do not write a `SUMMARY` file.

#### Example input

```json
{
  "requests": [
    { "method": "GET", "url": "https://example.com" }
  ]
}
```

### What this Actor does not do

- It does not run Python, JavaScript or a shell command you supply.
- It does not use residential or datacenter proxies.
- It does not follow redirects onto private or metadata addresses.

# Actor input Schema

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

List of HTTP requests to send. Each item needs a url. Optional fields: method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS), headers, body, timeoutSecs (cannot exceed the run timeout cap).

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

Maximum number of requests in flight. Default 5, hard maximum 10.

## `perHostRatePerSecond` (type: `number`):

Maximum requests per second to any one host. Default 2, hard maximum 5. Use this to avoid flooding a site.

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

Extra attempts after a network error or HTTP 429/5xx. Default 2, hard maximum 5. 4xx (except 429), blocks and oversize bodies are not retried.

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

Default 8, hard maximum 10. A per-request timeoutSecs cannot exceed this. The run also stops at a 30-second wall-clock cap.

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

Each hop is re-checked for SSRF. Default 5, hard maximum 10.

## `maxRequestsPerRun` (type: `integer`):

Further requests are skipped and are free. Default 100, hard maximum 200.

## `maxRequestBodyBytes` (type: `integer`):

Larger bodies are not sent and the row is failed (free). Default 262144 (256 KiB), hard maximum 1048576 (1 MiB).

## `maxResponseBodyBytes` (type: `integer`):

The body is truncated at this size and marked truncated. Default 1048576 (1 MiB), hard maximum 2097152 (2 MiB).

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

auto picks JSON, text or base64 from the content type and size. none stores headers only.

## `revealSensitiveHeaders` (type: `boolean`):

Off by default. Logs never include these values, even when this is on. Use only if you need them in the output and accept the risk.

## Actor input object example

```json
{
  "requests": [
    {
      "method": "GET",
      "url": "https://example.com"
    }
  ],
  "concurrency": 5,
  "perHostRatePerSecond": 2,
  "retries": 2,
  "timeoutSecs": 8,
  "maxRedirects": 5,
  "maxRequestsPerRun": 100,
  "maxRequestBodyBytes": 262144,
  "maxResponseBodyBytes": 1048576,
  "responseFormat": "auto",
  "revealSensitiveHeaders": false
}
```

# Actor output Schema

## `responses` (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": [
        {
            "method": "GET",
            "url": "https://example.com"
        }
    ],
    "responseFormat": "auto"
};

// Run the Actor and wait for it to finish
const run = await client.actor("gramsesh/http-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": [{
            "method": "GET",
            "url": "https://example.com",
        }],
    "responseFormat": "auto",
}

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

```

## MCP server setup

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