# HTTP Request Builder (`automation-lab/http-request-builder`) Actor

Build HTTP requests and export as cURL, fetch, axios, and Python code — all four at once. Supports bearer, basic, and API key auth.

- **URL**: https://apify.com/automation-lab/http-request-builder.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## HTTP Request Builder

Convert any HTTP request into ready-to-use code snippets in seconds. Input your method, URL, headers, body, and authentication — get back **cURL, JavaScript fetch, axios, and Python requests** code, perfectly formatted and ready to paste.

This is the inverse of a curl-to-code converter: you describe the request you want to make, and the builder generates all the boilerplate for every language at once.

### What does HTTP Request Builder do?

HTTP Request Builder takes structured HTTP request parameters and generates syntactically correct, immediately runnable code snippets across four popular languages and tools:

- **cURL** — the universal command-line HTTP client, works everywhere
- **JavaScript fetch** — native browser and Node.js API, no dependencies needed
- **axios** — the most popular Node.js/browser HTTP library (25M+ weekly downloads)
- **Python requests** — the de facto standard HTTP library for Python

Supply a URL, method, headers, body, and authentication config — the builder handles formatting, escaping, encoding, and correct syntax for each target. Run a single actor call against 1 to 1,000 requests in one batch.

### Who is HTTP Request Builder for?

**Backend developers** who switch between languages constantly:
- Prototype an API call in Python, then need the same call in Node.js for production
- Copy-paste a cURL command from API docs and need it as fetch or axios code
- Share a request with a colleague who uses a different stack

**API documentation writers and DevRel engineers**:
- Generate consistent, correct multi-language code samples for documentation
- Produce cURL + Python + JS examples for every API endpoint in bulk
- Ensure code samples are always syntactically valid (no more copy-paste errors)

**QA engineers and testers**:
- Convert Postman/Insomnia requests to cURL for CI/CD pipeline integration
- Generate test scripts in multiple languages from a single request definition
- Validate API requests work identically across different HTTP client implementations

**Students and developers learning APIs**:
- See the exact same request expressed in four different ways simultaneously
- Understand how authentication headers translate across languages
- Learn idiomatic patterns for each language (e.g., `json=` parameter in Python requests)

### Why use HTTP Request Builder?

- 🚀 **Zero setup** — no API key, no login, no configuration required
- 🔄 **All four formats at once** — get cURL, fetch, axios, and Python in a single run
- 🔐 **Handles all auth types** — bearer tokens, basic auth, and API key headers all correctly formatted
- 📦 **Batch processing** — convert up to 1,000 requests in one actor run
- 🎨 **Pretty-print control** — readable JSON bodies for docs or compact bodies for scripts
- 💬 **Optional code comments** — toggle explanatory inline comments on or off
- ✅ **Correct escaping** — shell special characters in cURL, JSON serialization in fetch/axios, Python dict syntax
- 🔗 **API-first** — full programmatic access via the Apify API, scheduling, and webhooks

### What code does it generate?

| Language / Tool | Format | Notes |
|----------------|--------|-------|
| cURL | Shell command | Correct `-H`, `-d`, `-X` flags; single-quote escaping |
| JavaScript fetch | async/await | Native browser + Node.js 18+; no dependencies |
| axios | async/await with import | Works in Node.js and browser; idiomatic config object |
| Python requests | requests library | `json=` for JSON bodies, `data=` for form/text; `import requests` included |

**Supported authentication types:**

| Auth type | How it's applied | Example |
|-----------|-----------------|---------|
| Bearer token | `Authorization: Bearer <token>` header | JWT tokens, OAuth tokens |
| Basic auth | `Authorization: Basic <base64>` header | Username + password, encoded correctly |
| API key | Custom header with your key name | `X-API-Key`, `x-rapidapi-key`, etc. |

### How much does it cost to generate HTTP request code?

HTTP Request Builder uses pay-per-event (PPE) pricing. You are charged per request converted, plus a small one-time start fee.

| Plan | Start fee | Per request |
|------|-----------|-------------|
| Free ($5 credit) | $0.005 | $0.00115 |
| Starter (Bronze) | $0.005 | $0.001 |
| Scale (Silver) | $0.005 | $0.00078 |
| Business (Gold) | $0.005 | $0.0006 |
| Enterprise (Platinum) | $0.005 | $0.0004 |
| Enterprise Plus (Diamond) | $0.005 | $0.00028 |

**Real-world cost examples:**

- Convert 10 requests (docs sample set): ~$0.015 on Bronze
- Convert 100 API endpoints for full documentation: ~$0.105 on Bronze
- Convert 500 requests in a bulk batch: ~$0.505 on Bronze
- With the free $5 credit: ~4,300 free requests before any charge

This actor uses no proxy (pure string computation) — compute costs are minimal.

### How to generate HTTP request code snippets

1. Go to [HTTP Request Builder on Apify Store](https://apify.com/automation-lab/http-request-builder)
2. Click **Try for free**
3. In the **HTTP Requests** field, add your request(s) as a JSON array
4. Optionally enable **Include code comments** for annotated output
5. Click **Start** and wait a few seconds
6. View results in the **Dataset** tab — each row has cURL, fetch, axios, and Python columns

**Example input for a simple GET request:**

```json
{
  "requests": [
    {
      "url": "https://api.github.com/repos/apify/apify-sdk-js",
      "method": "GET",
      "headers": {
        "Accept": "application/vnd.github+json"
      }
    }
  ]
}
````

**Example input for a POST with bearer auth:**

```json
{
  "requests": [
    {
      "url": "https://api.example.com/users",
      "method": "POST",
      "headers": { "Content-Type": "application/json" },
      "body": "{\"name\": \"Alice\", \"role\": \"admin\"}",
      "bodyType": "json",
      "auth": { "type": "bearer", "token": "eyJhbGciOiJIUzI1NiJ9..." }
    }
  ],
  "prettyPrint": true,
  "includeComments": true
}
```

**Example input for a bulk batch (multiple requests):**

```json
{
  "requests": [
    { "url": "https://api.example.com/users", "method": "GET" },
    { "url": "https://api.example.com/users/42", "method": "DELETE", "auth": { "type": "bearer", "token": "TOKEN" } },
    { "url": "https://api.example.com/users/42/posts", "method": "GET" }
  ]
}
```

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `requests` | array | ✅ Yes | — | Array of HTTP request objects to convert (see structure below) |
| `includeComments` | boolean | No | `false` | Add inline code comments explaining each section |
| `prettyPrint` | boolean | No | `true` | Indent JSON request bodies for readability |

**Request object fields:**

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | ✅ Yes | Full request URL including query string |
| `method` | string | No | HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS. Defaults to GET |
| `headers` | object | No | Request headers as key-value pairs |
| `body` | string | No | Request body as a string (JSON string, form-encoded, or plain text) |
| `bodyType` | string | No | Hint: `json`, `form`, `text`, or `none`. Auto-detected from Content-Type if omitted |
| `auth` | object | No | Authentication config — see auth fields below |
| `outputFormats` | array | No | Limit output to specific formats: `["curl", "fetch", "axios", "python"]`. Defaults to all four |

**Auth object fields:**

| Field | Type | When required | Description |
|-------|------|--------------|-------------|
| `type` | string | Always | `bearer`, `basic`, or `apikey` |
| `token` | string | bearer | Bearer token value |
| `username` | string | basic | Username for basic auth |
| `password` | string | basic | Password for basic auth |
| `key` | string | apikey | Header name (e.g. `X-API-Key`) |
| `value` | string | apikey | API key value |

### Output examples

Each dataset item contains the generated code for one input request:

```json
{
  "url": "https://api.github.com/repos/apify/apify-sdk-js",
  "method": "GET",
  "curl": "curl -X GET \\\n  'https://api.github.com/repos/apify/apify-sdk-js' \\\n  -H 'Accept: application/vnd.github+json'",
  "fetch": "const response = await fetch('https://api.github.com/repos/apify/apify-sdk-js', {\n  ...\n});",
  "axios": "import axios from 'axios';\n\nconst { data } = await axios({...});\n\nconsole.log(data);",
  "python": "import requests\n\nresponse = requests.get('https://api.github.com/repos/apify/apify-sdk-js', headers=headers)\n\nprint(response.json())",
  "error": null
}
```

**POST with bearer auth output — cURL:**

```bash
curl -X POST \
  'https://api.example.com/users' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9...' \
  -d '{
  "name": "Alice",
  "role": "admin"
}'
```

**Same request in Python requests:**

```python
import requests

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9...',
}

json_data = {
    "name": "Alice",
    "role": "admin",
}

response = requests.post('https://api.example.com/users', headers=headers, json=json_data)

print(response.status_code)
print(response.json())
```

### Tips for best results

- 🎯 **Use `bodyType: "json"` explicitly** — even if your `Content-Type` is set, specifying `bodyType` ensures the correct Python `json=` parameter is used vs `data=`
- 🔑 **Put auth in the `auth` object, not headers** — the builder handles correct encoding (e.g., base64 for basic auth) when using the `auth` field; manual headers skip this
- 📋 **Set `outputFormats` to reduce output size** — if you only need cURL and Python, set `outputFormats: ["curl", "python"]` to skip fetch and axios
- 🔄 **Batch all related endpoints in one run** — the $0.005 start fee is per run, not per request; batch 100 endpoints for $0.105 instead of running 100 separate times
- 💅 **Use `prettyPrint: false` for shell scripts** — compact bodies are easier to inline in scripts and avoid multi-line heredoc complexity
- 🧪 **Test generated cURL in your terminal first** — it's the most portable format and will quickly reveal any encoding issues

### Integrations

**HTTP Request Builder → API documentation pipeline:**

- Run the builder against your full endpoint list
- Export the dataset as CSV or JSON
- Import into your documentation platform (Readme.io, Stoplight, GitBook)
- All four language examples generated in one pass — no manual code writing

**HTTP Request Builder → GitHub Actions / CI:**

- Use the Apify API to call this actor in a CI step
- Automatically regenerate code samples on every API schema change
- Commit updated samples back to your docs repo via Git actions

**HTTP Request Builder → Zapier / Make.com:**

- Connect Apify to your documentation tool via Zapier
- Trigger code generation when a new endpoint is added to a Notion or Airtable database
- Auto-post generated snippets to Slack for team review

**Scheduled runs for living documentation:**

- Schedule the actor to regenerate code samples nightly
- Catch breaking changes in API request parameters automatically
- Keep documentation always in sync with actual request definitions

### Using the Apify API

Run HTTP Request Builder programmatically via the Apify API:

**Node.js:**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('automation-lab/http-request-builder').call({
    requests: [
        {
            url: 'https://api.example.com/users',
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({ name: 'Alice' }),
            bodyType: 'json',
            auth: { type: 'bearer', token: 'MY_TOKEN' }
        }
    ],
    prettyPrint: true
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].curl);
console.log(items[0].python);
```

**Python:**

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_APIFY_TOKEN')

run = client.actor('automation-lab/http-request-builder').call(run_input={
    'requests': [
        {
            'url': 'https://api.example.com/users',
            'method': 'POST',
            'headers': {'Content-Type': 'application/json'},
            'body': '{"name": "Alice"}',
            'bodyType': 'json',
            'auth': {'type': 'bearer', 'token': 'MY_TOKEN'}
        }
    ],
    'prettyPrint': True
})

items = client.dataset(run['defaultDatasetId']).list_items().items
print(items[0]['curl'])
print(items[0]['python'])
```

**cURL:**

```bash
curl -X POST "https://api.apify.com/v2/acts/automation-lab~http-request-builder/runs" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "requests": [
      {
        "url": "https://api.example.com/users",
        "method": "GET"
      }
    ]
  }'
```

### Use with AI agents via MCP

HTTP Request Builder is available as a tool for AI assistants that support the [Model Context Protocol (MCP)](https://docs.apify.com/platform/integrations/mcp).

Add the Apify MCP server to your AI client — this gives you access to all Apify actors, including this one:

#### Setup for Claude Code

```bash
claude mcp add --transport http apify "https://mcp.apify.com"
```

#### Setup for Claude Desktop, Cursor, or VS Code

Add this to your MCP config file:

```json
{
    "mcpServers": {
        "apify": {
            "url": "https://mcp.apify.com"
        }
    }
}
```

Your AI assistant will use OAuth to authenticate with your Apify account on first use.

#### Example prompts

Once connected, try asking your AI assistant:

- "Use automation-lab/http-request-builder to convert this POST request to Python and axios: POST https://api.example.com/users with bearer token ABC123 and JSON body {"name": "Alice"}"
- "Generate cURL and fetch code for a DELETE request to https://api.example.com/user/42 with basic auth (admin/secret)"
- "Build code snippets for all four languages for these three API endpoints: GET /products, POST /orders, PATCH /orders/123"

Learn more in the [Apify MCP documentation](https://docs.apify.com/platform/integrations/mcp).

### Is it legal to use HTTP Request Builder?

HTTP Request Builder is a pure utility tool — it performs no web scraping, makes no external HTTP connections, and does not interact with any third-party services. It is a code generator that transforms input data (your request parameters) into output data (code strings).

There are no legal concerns with using this tool. It generates code for you to use; the legal considerations of the requests you ultimately make with that code depend on the target API's terms of service and applicable law.

### FAQ

**What HTTP methods are supported?**
GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS are all supported. Any other string is passed through as uppercase — useful if you need non-standard methods for testing.

**Can I generate code for only one language instead of all four?**
Yes — use the `outputFormats` field in your request object: `"outputFormats": ["curl", "python"]` will skip fetch and axios, reducing output size and processing time.

**Why does my Python output use `json=` instead of `data=` for the body?**
When `bodyType` is `"json"` (or detected from `Content-Type: application/json`), the actor uses Python's `requests` library `json=` parameter, which automatically serializes the dict and sets the correct Content-Type. This is the idiomatic Python pattern. Use `"bodyType": "text"` if you want the raw string body via `data=`.

**How does the builder handle special characters in URLs or header values?**
In cURL output, single quotes and backslashes are correctly shell-escaped. In fetch/axios, strings are JSON-serialized. In Python, string values use safe representation. You do not need to pre-escape your values.

**What happens if my JSON body string is invalid JSON?**
The actor passes the body through as a raw string rather than failing the entire request. The cURL output shows the body as-is; Python falls back to `data=` with the string. The error field will be null — invalid JSON bodies are handled gracefully.

**How many requests can I batch in one run?**
There is no enforced limit. Batches of up to 1,000 requests work well in practice. Very large batches (10,000+) work but take longer due to dataset write overhead. The start fee ($0.005) is per run, not per request — batching maximizes value.

**Can I use this to convert raw cURL commands to other languages?**
The actor takes structured parameters, not raw cURL command strings. Parse your cURL command into components (method, URL, headers, body) first, then pass them as structured input. Many online tools and libraries can parse cURL strings into structured objects.

**Why are there no fetch/axios/python fields in my output?**
Check the `outputFormats` field in your request object — if set, only the specified formats are generated. The default (all four formats) applies when `outputFormats` is omitted.

### Other developer tools you might find useful

Looking for more automation-lab tools for developers and API work?

- [Base64 Converter](https://apify.com/automation-lab/base64-converter) — encode/decode Base64 strings and files in bulk
- [JSON Schema Generator](https://apify.com/automation-lab/json-schema-generator) — infer JSON Schema from sample JSON documents
- [Color Contrast Checker](https://apify.com/automation-lab/color-contrast-checker) — validate WCAG 2.1 AA/AAA color contrast ratios
- [Canonical URL Checker](https://apify.com/automation-lab/canonical-url-checker) — verify canonical tags and redirects across pages
- [Broken Link Checker](https://apify.com/automation-lab/broken-link-checker) — find dead links on any website
- [Accessibility Checker](https://apify.com/automation-lab/accessibility-checker) — audit web pages for WCAG accessibility issues
- [AAAA Record Checker](https://apify.com/automation-lab/aaaa-record-checker) — check IPv6 DNS records in bulk

# Actor input Schema

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

List of HTTP requests to convert to code. Each item should specify method, URL, headers, body, and authentication.

## `includeComments` (type: `boolean`):

When enabled, generated code includes inline comments explaining each section. Useful for learning or documentation.

## `prettyPrint` (type: `boolean`):

When enabled, JSON bodies in the generated code are indented for readability. When disabled, they are compact (better for scripting).

## Actor input object example

```json
{
  "requests": [
    {
      "url": "https://api.github.com/repos/apify/apify-sdk-js",
      "method": "GET",
      "headers": {
        "Accept": "application/vnd.github+json"
      }
    },
    {
      "url": "https://httpbin.org/post",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json"
      },
      "body": "{\"name\": \"John\", \"email\": \"john@example.com\"}",
      "bodyType": "json",
      "auth": {
        "type": "bearer",
        "token": "YOUR_TOKEN_HERE"
      }
    }
  ],
  "includeComments": false,
  "prettyPrint": true
}
```

# Actor output Schema

## `overview` (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": [
        {
            "url": "https://api.github.com/repos/apify/apify-sdk-js",
            "method": "GET",
            "headers": {
                "Accept": "application/vnd.github+json"
            }
        },
        {
            "url": "https://httpbin.org/post",
            "method": "POST",
            "headers": {
                "Content-Type": "application/json"
            },
            "body": "{\"name\": \"John\", \"email\": \"john@example.com\"}",
            "bodyType": "json",
            "auth": {
                "type": "bearer",
                "token": "YOUR_TOKEN_HERE"
            }
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/http-request-builder").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://api.github.com/repos/apify/apify-sdk-js",
            "method": "GET",
            "headers": { "Accept": "application/vnd.github+json" },
        },
        {
            "url": "https://httpbin.org/post",
            "method": "POST",
            "headers": { "Content-Type": "application/json" },
            "body": "{\"name\": \"John\", \"email\": \"john@example.com\"}",
            "bodyType": "json",
            "auth": {
                "type": "bearer",
                "token": "YOUR_TOKEN_HERE",
            },
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/http-request-builder").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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://api.github.com/repos/apify/apify-sdk-js",
      "method": "GET",
      "headers": {
        "Accept": "application/vnd.github+json"
      }
    },
    {
      "url": "https://httpbin.org/post",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json"
      },
      "body": "{\\"name\\": \\"John\\", \\"email\\": \\"john@example.com\\"}",
      "bodyType": "json",
      "auth": {
        "type": "bearer",
        "token": "YOUR_TOKEN_HERE"
      }
    }
  ]
}' |
apify call automation-lab/http-request-builder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=automation-lab/http-request-builder",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "HTTP Request Builder",
        "description": "Build HTTP requests and export as cURL, fetch, axios, and Python code — all four at once. Supports bearer, basic, and API key auth.",
        "version": "0.1",
        "x-build-id": "nfB2HmgYCA0essHQl"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/automation-lab~http-request-builder/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-automation-lab-http-request-builder",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/automation-lab~http-request-builder/runs": {
            "post": {
                "operationId": "runs-sync-automation-lab-http-request-builder",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/automation-lab~http-request-builder/run-sync": {
            "post": {
                "operationId": "run-sync-automation-lab-http-request-builder",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "requests"
                ],
                "properties": {
                    "requests": {
                        "title": "🌐 HTTP Requests",
                        "type": "array",
                        "description": "List of HTTP requests to convert to code. Each item should specify method, URL, headers, body, and authentication.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL",
                                    "description": "The full request URL (e.g. https://api.example.com/users)."
                                },
                                "method": {
                                    "type": "string",
                                    "title": "HTTP Method",
                                    "description": "HTTP method: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS. Defaults to GET."
                                },
                                "headers": {
                                    "type": "object",
                                    "title": "Headers",
                                    "description": "Request headers as key-value pairs."
                                },
                                "body": {
                                    "type": "string",
                                    "title": "Body",
                                    "description": "Request body as a string (JSON string, form-encoded, plain text)."
                                },
                                "bodyType": {
                                    "type": "string",
                                    "title": "Body Type",
                                    "description": "Body content type hint: json | form | text | none. Affects Content-Type header and code generation."
                                },
                                "auth": {
                                    "type": "object",
                                    "title": "Authentication",
                                    "description": "Authentication configuration. Supported types: bearer (token), basic (username+password), apikey (key+value)."
                                },
                                "outputFormats": {
                                    "type": "array",
                                    "title": "Output Formats",
                                    "description": "Which code formats to generate. Defaults to all: curl, fetch, axios, python. Pass a subset to limit output.",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "includeComments": {
                        "title": "💬 Include code comments",
                        "type": "boolean",
                        "description": "When enabled, generated code includes inline comments explaining each section. Useful for learning or documentation.",
                        "default": false
                    },
                    "prettyPrint": {
                        "title": "🎨 Pretty-print JSON bodies",
                        "type": "boolean",
                        "description": "When enabled, JSON bodies in the generated code are indented for readability. When disabled, they are compact (better for scripting).",
                        "default": true
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
