{
  "openapi": "3.0.1",
  "info": {
    "title": "HTTP Request Runner: Bulk API Calls from URLs & Datasets",
    "description": "HTTP request runner: send GET, POST, PUT, PATCH or DELETE requests in bulk, from a URL list, request objects or one request per dataset row with {{field}} templates. Retries, per-site limits, JSON parsed into rows. $0.002 per answered request; network errors free.",
    "version": "0.1",
    "x-build-id": "dp4GYM5te2GT08wqX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/klarto~http-request-runner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-klarto-http-request-runner",
        "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/klarto~http-request-runner/runs": {
      "post": {
        "operationId": "runs-sync-klarto-http-request-runner",
        "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/klarto~http-request-runner/run-sync": {
      "post": {
        "operationId": "run-sync-klarto-http-request-runner",
        "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": {
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Links to call, one per line, each with the method, headers and body below. Use 'Requests' for different methods or bodies per call, or 'Dataset rows to send' for one call per row.",
            "items": {
              "type": "string"
            }
          },
          "method": {
            "title": "Method",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "PATCH",
              "DELETE",
              "HEAD",
              "OPTIONS"
            ],
            "type": "string",
            "description": "Method for 'URLs' and dataset rows, and for 'Requests' items that set none.",
            "default": "GET"
          },
          "headers": {
            "title": "Headers",
            "type": "object",
            "description": "Headers for every request, e.g. {\"Authorization\": \"Bearer …\", \"Accept\": \"application/json\"}. Stored encrypted. A 'Requests' item can add or override headers. On a redirect to another site only Accept, Accept-Language, User-Agent and Content-Type are sent on. Host, Content-Length and other framing headers are set by the Actor."
          },
          "body": {
            "title": "Body",
            "type": "string",
            "description": "Body for 'URLs' (and rows without a 'Body template'). Text starting with { or [ is sent as application/json unless you set Content-Type in 'Headers'. Usually empty for GET."
          },
          "requests": {
            "title": "Requests",
            "type": "array",
            "description": "Request objects, e.g. [{\"url\": \"https://api.example.com/items\", \"method\": \"POST\", \"json\": {\"name\": \"A\"}, \"headers\": {\"X-Trace\": \"1\"}, \"id\": \"row-1\"}]. Keys: url (required), method, headers, body (text) or json (object), id (copied to the result row)."
          },
          "datasets": {
            "title": "Dataset rows to send",
            "type": "array",
            "description": "Optional: one request per row of these datasets, built from 'URL template' and 'Body template'. Picking a dataset gives this Actor read access to it (limited permissions). Through the API pass dataset IDs or 'username~name'."
          },
          "urlTemplate": {
            "title": "URL template",
            "type": "string",
            "description": "For dataset rows, e.g. https://api.example.com/users/{{id}}?email={{contact.email}}. Values are URL-encoded; write {{field|raw}} to insert as is, or only {{field}} when the field holds a whole URL. Rows without the value are not sent and are free. Required with 'Dataset rows to send'."
          },
          "bodyTemplate": {
            "title": "Body template",
            "type": "string",
            "description": "For dataset rows, e.g. {\"email\": {{email}}, \"tags\": {{tags}}}. Each {{field}} becomes its JSON value (text gets quotes, a missing field becomes null), so do not put quotes around placeholders."
          },
          "idField": {
            "title": "ID field",
            "type": "string",
            "description": "Optional: field of the dataset row copied to 'id' in the result, to join answers back to rows. Every row also has 'source' (<datasetId>#<row number>)."
          },
          "extract": {
            "title": "Extract fields",
            "type": "object",
            "description": "Optional: copy values from JSON answers into 'extracted', e.g. {\"name\": \"data.name\", \"firstTag\": \"data.tags.0\"}. Missing paths give null."
          },
          "parseJson": {
            "title": "Parse JSON answers",
            "type": "boolean",
            "description": "A JSON answer goes to 'json' as data. Off: the raw text goes to 'body'. Answers cut by 'Max response size' are never parsed.",
            "default": true
          },
          "maxResponseKb": {
            "title": "Max response size",
            "minimum": 1,
            "maximum": 4096,
            "type": "integer",
            "description": "Reading stops at this size and the row gets 'truncated': true. The request is still charged.",
            "default": 512
          },
          "includeResponseHeaders": {
            "title": "Include response headers",
            "type": "boolean",
            "description": "Add the answer's headers to each row.",
            "default": false
          },
          "followRedirects": {
            "title": "Follow redirects",
            "type": "boolean",
            "description": "Follow up to 10 redirects like a browser (303, and 301/302 after POST, continue as GET without a body). Off: the 3xx answer itself is the result.",
            "default": true
          },
          "maxRequests": {
            "title": "Max requests",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many requests (up to 10,000 per run).",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Requests at once in the whole run.",
            "default": 10
          },
          "maxPerSite": {
            "title": "Max at once per site",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Requests at once to the same host. Lower it for rate-limited APIs.",
            "default": 4
          },
          "delayMs": {
            "title": "Delay per site",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Minimum time between two requests to the same host.",
            "default": 0
          },
          "timeoutSecs": {
            "title": "Timeout per request",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Time limit for one attempt.",
            "default": 30
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Extra tries after HTTP 408, 425, 429, 500, 502, 503, 504, timeouts and dropped connections. For 429 and 503 the Retry-After header is followed (up to 30 s). POST and PATCH are not retried unless 'Retry POST and PATCH' is on.",
            "default": 2
          },
          "retryNonIdempotent": {
            "title": "Retry POST and PATCH",
            "type": "boolean",
            "description": "Also retry POST and PATCH. Turn on only when sending the same request twice is harmless.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}