{
  "openapi": "3.0.1",
  "info": {
    "title": "HTTP Request & Bulk API Calls: Extract JSON, URL to Markdown",
    "description": "Send HTTP requests (GET, POST, PUT, PATCH, DELETE) to any API or URL, 1 to 10,000 per run. Bulk API calls from CSV, Google Sheet or dataset rows with {{column}} templates. Extract JSON fields into columns, URL to Markdown. For Clay, n8n, Make and AI agents. $1 per 1,000 responses; failures free.",
    "version": "1.0",
    "x-build-id": "tNpDZytbMGX0lBamO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tinplatelabs~agent-http/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tinplatelabs-agent-http",
        "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/tinplatelabs~agent-http/runs": {
      "post": {
        "operationId": "runs-sync-tinplatelabs-agent-http",
        "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/tinplatelabs~agent-http/run-sync": {
      "post": {
        "operationId": "run-sync-tinplatelabs-agent-http",
        "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",
        "properties": {
          "requests": {
            "title": "HTTP requests (GET, POST, PUT, PATCH, DELETE)",
            "type": "array",
            "description": "The HTTP requests to send. Each is a URL string or an object: <code>{\"method\": \"POST\", \"url\": \"https://api.example.com/items\", \"headers\": {...}, \"query\": {\"page\": 2}, \"json\": {...}, \"extract\": {\"id\": \"data.id\"}}</code>. Body: one of <code>json</code> (any JSON value), <code>form</code> (object, sent URL-encoded) or <code>body</code> (raw string). Optional per request: <code>extract</code> (JSON fields to pick, see below), <code>timeoutSecs</code>, <code>followRedirects</code>, <code>label</code> (echoed in the output). You get one result per request: status, headers, parsed JSON or clean Markdown, timing. Charged only when a response arrives. Max 10,000 requests per run, together with <code>urls</code> and template rows. To call an API once for every row of a CSV, Google Sheet or dataset, use the <b>Bulk API calls from CSV</b> section at the bottom instead."
          },
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Plain URLs to GET (or to check in url-health mode). Added after <code>requests</code>. A bare domain like <code>example.com</code> is fetched over https.",
            "items": {
              "type": "string"
            }
          },
          "extract": {
            "title": "Extract JSON fields",
            "type": "object",
            "description": "Pick values out of JSON responses into <code>extracted</code>: output name to path, e.g. <code>{\"name\": \"data.user.name\", \"firstId\": \"items[0].id\", \"lastId\": \"items[-1].id\", \"allIds\": \"items[*].id\"}</code>. Applies to every request; a request's own <code>extract</code> overrides names. Paths: dot keys, <code>[n]</code> index (negative from the end), <code>[*]</code> for every element, <code>[\"key.with.dots\"]</code>. A path that matches nothing gives null and is listed in <code>extractMissing</code>. Reads the whole JSON, even when <code>body</code> is cut by the token limit. No extra charge."
          },
          "includeBody": {
            "title": "Include body",
            "type": "boolean",
            "description": "When off, records hold status, headers and <code>extracted</code> only (<code>bodyFormat</code> is <code>omitted</code>): small rows for Clay, n8n, Make or an agent's context. Binary bodies are not stored.",
            "default": true
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "request",
              "url-health"
            ],
            "type": "string",
            "description": "<b>request</b>: send each request and return status, headers and an agent-ready body. <b>url-health</b>: check each URL (status, final URL, redirect chain, response time, TLS days left, broken flag) without downloading bodies.",
            "default": "request"
          },
          "headers": {
            "title": "Headers for every request",
            "type": "object",
            "description": "Headers added to every request, e.g. <code>{\"Accept-Language\": \"en\"}</code>. A request's own <code>headers</code> override these. Credential-like headers are redacted in the output and log."
          },
          "authorization": {
            "title": "Authorization header",
            "type": "string",
            "description": "Optional value for the <code>Authorization</code> header of every request, e.g. <code>Bearer sk-...</code>. Stored encrypted, never shown in the output or log, and not sent to a different host after a redirect."
          },
          "userAgent": {
            "title": "User-Agent",
            "type": "string",
            "description": "User-Agent header. Default identifies this Actor: <code>Mozilla/5.0 (compatible; TinplateAgentHTTP/1.0; Apify Actor; +https://apify.com/tinplatelabs/agent-http)</code>."
          },
          "timeoutSecs": {
            "title": "Timeout per attempt (seconds)",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Time limit for one attempt, redirects included. A request without a complete response in time gets a TIMEOUT record and is not charged.",
            "default": 30
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries on HTTP 429, 500, 502, 503, 504 and on connection failures, with exponential backoff (0.5 s, 1 s, 2 s, ...). Retry-After is honoured. POST and PATCH are retried only on 429 and connection failures unless <code>retryUnsafeMethods</code> is on.",
            "default": 2
          },
          "maxRetryWaitSecs": {
            "title": "Max wait before a retry (seconds)",
            "minimum": 0,
            "maximum": 120,
            "type": "integer",
            "description": "If the server's Retry-After asks for a longer wait, the response is returned (with a warning) instead of waiting.",
            "default": 30
          },
          "retryUnsafeMethods": {
            "title": "Retry POST/PATCH on 5xx and timeouts",
            "type": "boolean",
            "description": "Also retry non-idempotent requests on 5xx responses and timeouts. Only turn this on when sending the request twice is harmless.",
            "default": false
          },
          "followRedirects": {
            "title": "Follow redirects",
            "type": "boolean",
            "description": "Follow 301, 302, 303, 307 and 308 redirects. Every hop is listed in <code>redirects</code>. When off, the 3xx response itself is returned.",
            "default": true
          },
          "maxRedirects": {
            "title": "Max redirects",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "More redirects than this gives a TOO_MANY_REDIRECTS record (not charged).",
            "default": 10
          },
          "htmlFormat": {
            "title": "HTML output",
            "enum": [
              "markdown",
              "markdown-full",
              "text",
              "html"
            ],
            "type": "string",
            "description": "How HTML bodies are returned: Markdown of the main content (navigation, cookie banners, sidebars and footers removed; links made absolute), Markdown of the whole page, plain text, or the raw HTML.",
            "default": "markdown"
          },
          "parseJson": {
            "title": "Parse JSON",
            "type": "boolean",
            "description": "Return JSON responses as parsed values. When off, JSON is returned as text.",
            "default": true
          },
          "maxBodyTokens": {
            "title": "Max body tokens",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cut text bodies (Markdown, text, JSON text) to about this many tokens (4 characters per token), at a paragraph, line or word boundary. <code>truncated</code> is then true and <code>bodyChars</code> gives the full length. 0 = no token limit.",
            "default": 8000
          },
          "maxBodyChars": {
            "title": "Max body characters",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Optional hard character limit for text bodies. When both limits are set, the smaller applies. 0 = no character limit.",
            "default": 0
          },
          "maxResponseMb": {
            "title": "Max response size (MB)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Download at most this much of each body. Larger bodies are cut and marked <code>truncated</code>; cut binaries are not stored.",
            "default": 10
          },
          "storeBinary": {
            "title": "Store binary bodies",
            "type": "boolean",
            "description": "Save images, PDFs and other binary bodies to the run's key-value store and return <code>bodyUrl</code>. When off, only their size and type are returned.",
            "default": true
          },
          "session": {
            "title": "Keep cookies across requests",
            "type": "boolean",
            "description": "When on, cookies set by one response are sent with later requests in this run (like a browser session). When off, each request starts without cookies.",
            "default": false
          },
          "verifyTls": {
            "title": "Verify TLS certificates",
            "type": "boolean",
            "description": "Reject servers with invalid, expired or self-signed certificates (TLS_FAILED). Turn off only for servers you trust.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Requests in flight at the same time. Lowered automatically if large bodies would not fit in the run's memory.",
            "default": 5
          },
          "healthMethod": {
            "title": "Health check method",
            "enum": [
              "GET",
              "HEAD"
            ],
            "type": "string",
            "description": "url-health mode only. GET is the most reliable (some servers mishandle HEAD); the body is never downloaded either way.",
            "default": "GET"
          },
          "tlsWarningDays": {
            "title": "TLS expiry warning (days)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "url-health mode: <code>tlsExpiringSoon</code> is true when the certificate expires in fewer days than this.",
            "default": 14
          },
          "requestTemplate": {
            "title": "Bulk API calls from CSV or dataset: request template",
            "type": "object",
            "description": "One request written once, sent for every row, with <code>{{column}}</code> placeholders filled from that row: <code>{\"method\": \"POST\", \"url\": \"https://api.example.com/companies/{{domain}}\", \"query\": {\"country\": \"{{country}}\"}, \"headers\": {\"X-Ref\": \"{{id}}\"}, \"json\": {\"name\": \"{{name}}\", \"employees\": \"{{employees}}\"}, \"extract\": {\"score\": \"data.score\"}}</code>. Values are URL-encoded in the URL (a placeholder at the start of the URL, like <code>{{url}}</code>, or in triple braces <code>{{{path}}}</code> is inserted as is), and JSON-escaped in bodies; a <code>json</code> value that is just <code>\"{{column}}\"</code> keeps the column's type. Nested columns: <code>{{address.city}}</code>. A row without a column gives a MISSING_COLUMN record (free). Sent after <code>requests</code> and <code>urls</code>; clear those if you only want the rows."
          },
          "rowsDatasetId": {
            "title": "Dataset with rows (call the API for each row)",
            "type": "string",
            "description": "An Apify dataset, e.g. a scraper's output or a list of leads: pick it or paste its ID (or <code>username~dataset-name</code>). Each item is one row for the request template. Another user's dataset must be shared with you or public."
          },
          "rowsUrl": {
            "title": "CSV, JSON or Google Sheet URL with rows",
            "type": "string",
            "description": "Public URL of a CSV/TSV file (first line = column names), a JSON array, or JSON Lines, up to 25 MB. A Google Sheets link works if the sheet is shared as 'Anyone with the link can view' (the tab in the link is read). The download is free."
          },
          "rows": {
            "title": "Rows (inline)",
            "type": "array",
            "description": "Rows given directly, e.g. <code>[{\"id\": 1, \"domain\": \"apify.com\"}, {\"id\": 2, \"domain\": \"example.com\"}]</code>. Plain values (a list of URLs or names) are available as <code>{{value}}</code>. Use one row source: dataset, file URL or inline rows."
          },
          "passThroughColumns": {
            "title": "Columns to copy into each result",
            "type": "array",
            "description": "Row columns copied into each result as <code>row</code>, so results join back to your sheet or CRM, e.g. <code>id</code>, <code>email</code>. <code>*</code> copies the whole row. Every templated result also has <code>rowIndex</code>.",
            "items": {
              "type": "string"
            }
          },
          "maxRows": {
            "title": "Max rows",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Send at most this many rows (0 = all, up to 10,000 requests per run). Handy for a test run on the first few rows.",
            "default": 0
          },
          "rowsOffset": {
            "title": "Skip first rows",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Start at this row (0-based). For more than 10,000 rows, run again with the offset the log suggests.",
            "default": 0
          },
          "dedupeRequests": {
            "title": "Skip duplicate requests",
            "type": "boolean",
            "description": "When rows render exactly the same request, send it once and give the repeats a <code>skipped</code> record with <code>duplicateOfIndex</code> (free).",
            "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}