{
  "openapi": "3.0.1",
  "info": {
    "title": "HTTP Request & API Calls: Bulk, Pagination, JSON to Rows",
    "description": "Send GET, POST, PUT, PATCH or DELETE requests to any REST API in bulk: headers, JSON body, a secret auth header, per-row templates from a dataset, automatic pagination, retries, JSON fields to columns and a callback URL. Made for Clay, n8n and Make.",
    "version": "0.0",
    "x-build-id": "5Z698ebvCG6rEr5x0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/charlesmarkette~http-request-api-calls-bulk-pagination/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-charlesmarkette-http-request-api-calls-bulk-pagination",
        "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/charlesmarkette~http-request-api-calls-bulk-pagination/runs": {
      "post": {
        "operationId": "runs-sync-charlesmarkette-http-request-api-calls-bulk-pagination",
        "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/charlesmarkette~http-request-api-calls-bulk-pagination/run-sync": {
      "post": {
        "operationId": "run-sync-charlesmarkette-http-request-api-calls-bulk-pagination",
        "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": "Requests",
            "type": "array",
            "description": "A JSON array of requests. Each one is an object: {\"url\": \"https://…\", \"method\": \"POST\", \"headers\": {…}, \"params\": {…}, \"json\": {…}, \"body\": \"text\", \"label\": \"my-id\", \"paginate\": false}. Only url is required; \"paginate\": false leaves that request out of the Pagination setting; the other keys override the shared settings below for that request. A plain URL string also works."
          },
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Shortcut: one URL per line. Each is sent with the shared method, headers, params and body below.",
            "items": {
              "type": "string"
            }
          },
          "method": {
            "title": "Method",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "PATCH",
              "DELETE",
              "HEAD",
              "OPTIONS"
            ],
            "type": "string",
            "description": "HTTP method for every request that doesn't set its own.",
            "default": "GET"
          },
          "headers": {
            "title": "Headers",
            "type": "object",
            "description": "Headers for every request, like {\"Accept\": \"application/json\"}. Put API keys in the secret auth header below instead, so they're stored encrypted. Header values are never written to the output or the log."
          },
          "queryParams": {
            "title": "Query parameters",
            "type": "object",
            "description": "Added to every URL, like {\"limit\": 50, \"lang\": \"en\"}. A list value repeats the parameter (?id=1&id=2). A parameter already in the URL with the same name is replaced."
          },
          "jsonBody": {
            "title": "JSON body",
            "type": "object",
            "description": "Sent as the request body (Content-Type: application/json) for every request without its own body. Leave empty for GET. For a JSON array body, use the 'json' key of a request object."
          },
          "textBody": {
            "title": "Text body",
            "type": "string",
            "description": "Raw body text (XML, form data, GraphQL…) instead of a JSON body. Set the content type below."
          },
          "contentType": {
            "title": "Content type",
            "type": "string",
            "description": "Content-Type for request bodies. Default: application/json for a JSON body, text/plain for a text body. With application/x-www-form-urlencoded, a JSON object body is sent as form fields."
          },
          "authHeaderName": {
            "title": "Auth header name",
            "type": "string",
            "description": "Name of the header that carries your API key, like Authorization, X-API-Key or api-key.",
            "default": "Authorization"
          },
          "authHeaderValue": {
            "title": "Auth header value",
            "type": "string",
            "description": "The full header value, like Bearer sk_live_… or just the key for X-API-Key. A request object that sets the same header itself keeps its own value."
          },
          "datasetId": {
            "title": "Dataset to enrich",
            "type": "string",
            "description": "Optional. One request per item of this dataset (leads, companies, products…), built from the URL template below. Use {{resource.defaultDatasetId}} in an integration."
          },
          "urlTemplate": {
            "title": "URL template",
            "type": "string",
            "description": "Like https://api.example.com/companies/{{domain}} or https://api.example.com/search?q={{name|url}}. {{field}} takes the item's field (dotted paths work: {{company.website}}, {{tags.0}}); |url percent-encodes the value. Items missing a field used here become a free error row."
          },
          "bodyTemplate": {
            "title": "Body template (JSON)",
            "type": "string",
            "description": "Optional JSON body with placeholders, like {\"name\": \"{{name}}\", \"employees\": {{size}}}. Inside quotes the value is inserted as escaped text; outside quotes it's inserted as JSON (number, true/false, null, object)."
          },
          "keepItemFields": {
            "title": "Keep the item's original fields",
            "type": "boolean",
            "description": "On: each row starts with the item's fields, followed by the response columns. An item field with the same name as a response column (or an extracted field) is kept as item_<name>.",
            "default": true
          },
          "pagination": {
            "title": "Pagination",
            "enum": [
              "none",
              "nextUrlFromJson",
              "pageParam",
              "offsetParam",
              "cursorFromJson",
              "linkHeader"
            ],
            "type": "string",
            "description": "Fetch more pages of each request. It stops at an empty items array, a missing or repeated next link or cursor, a non-2xx response, a page identical to an earlier one, or Max pages.",
            "default": "none"
          },
          "nextUrlPath": {
            "title": "Next URL path",
            "type": "string",
            "description": "For 'Next URL from a JSON field': dotted path to the next page's URL in the response, like next or links.next or paging.next. Relative URLs work."
          },
          "pageParam": {
            "title": "Page parameter",
            "type": "string",
            "description": "For 'Page number parameter': the query parameter name. Default: page."
          },
          "pageStart": {
            "title": "First page number",
            "type": "integer",
            "description": "For 'Page number parameter'. Default: 1.",
            "default": 1
          },
          "pageStep": {
            "title": "Page step",
            "minimum": 1,
            "type": "integer",
            "description": "For 'Page number parameter': how much the page number grows each time. Default: 1.",
            "default": 1
          },
          "offsetParam": {
            "title": "Offset parameter",
            "type": "string",
            "description": "For 'Offset parameter': the query parameter name. Default: offset."
          },
          "offsetStart": {
            "title": "First offset",
            "minimum": 0,
            "type": "integer",
            "description": "For 'Offset parameter'. Default: 0.",
            "default": 0
          },
          "limitParam": {
            "title": "Page size parameter",
            "type": "string",
            "description": "For 'Offset parameter': optional parameter that sets the page size, like limit or per_page."
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "type": "integer",
            "description": "For 'Offset parameter': how many items one page holds. The offset grows by this much, and a page with fewer items (found with Items path) is the last one.",
            "default": 100
          },
          "cursorPath": {
            "title": "Cursor path",
            "type": "string",
            "description": "For 'Cursor from a JSON field': dotted path to the next cursor in the response, like meta.next_cursor or response_metadata.next_cursor."
          },
          "cursorParam": {
            "title": "Cursor parameter",
            "type": "string",
            "description": "For 'Cursor from a JSON field': the query parameter that takes the cursor. Default: cursor."
          },
          "maxPages": {
            "title": "Max pages per request",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Including the first page. Each page is one request sent (charged as one request).",
            "default": 10
          },
          "itemsPath": {
            "title": "Items path",
            "type": "string",
            "description": "Dotted path to the array of results in the JSON response, like data or data.items or results. Used to stop pagination at an empty page, for Split items, and adds an itemCount column. Leave empty when the response itself is an array."
          },
          "splitItems": {
            "title": "Split items into rows",
            "type": "boolean",
            "description": "On: each element of the items array becomes its own row (with the request and page details). Off: one row per response. Split rows cost a small extra per row; see the pricing.",
            "default": false
          },
          "extractFields": {
            "title": "Extract fields",
            "type": "object",
            "description": "Turn JSON fields into columns: {\"column name\": \"dotted.path\"}, like {\"name\": \"name\", \"city\": \"address.city\", \"firstId\": \"items.0.id\"}. Applied to each response (or each item with Split items)."
          },
          "responseFormat": {
            "title": "Response format",
            "enum": [
              "auto",
              "json",
              "text"
            ],
            "type": "string",
            "description": "Auto: parsed into the json column when the content type is JSON or the body parses as JSON, else stored in text. JSON: always parse (an error is noted if it isn't JSON). Text: always store the raw text.",
            "default": "auto"
          },
          "includeResponseHeaders": {
            "title": "Include response headers",
            "type": "boolean",
            "description": "Add a responseHeaders column (lowercase names; Set-Cookie is left out).",
            "default": false
          },
          "maxResponseBytes": {
            "title": "Max response size",
            "minimum": 1024,
            "maximum": 20971520,
            "type": "integer",
            "description": "Bigger responses are cut at this size and marked truncated: true (a cut JSON response is stored as text). Up to 20 MB (20971520).",
            "default": 5242880
          },
          "callbackUrl": {
            "title": "Callback URL",
            "type": "string",
            "description": "Optional. Each output row is also POSTed as JSON to this URL (an n8n, Make or Zapier webhook, a Clay webhook table, your server). The result is noted in callbackStatus / callbackError; a failed callback never stops the run. Your auth header is never sent to it."
          },
          "timeoutSecs": {
            "title": "Timeout per request",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Seconds per attempt, from connecting to the last byte.",
            "default": 30
          },
          "maxRetries": {
            "title": "Retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries on network errors, 429 and 5xx responses, with backoff (Retry-After is honoured up to 60 s). This applies to POST too: set 0 if the API isn't safe to call twice. Retries aren't charged.",
            "default": 2
          },
          "concurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Requests in flight at the same time, across all hosts (1–50).",
            "default": 5
          },
          "perHostConcurrency": {
            "title": "Parallel requests per host",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "At most this many at a time to any one host (1–10). Keep it low for rate-limited APIs.",
            "default": 2
          },
          "delayBetweenRequestsMs": {
            "title": "Delay between requests to the same host",
            "minimum": 0,
            "maximum": 600000,
            "type": "integer",
            "description": "Minimum time between two requests to the same host, for APIs with a requests-per-second limit (1000 = one per second).",
            "default": 0
          },
          "followRedirects": {
            "title": "Follow redirects",
            "type": "boolean",
            "description": "Up to 10 hops. Off: a 3xx response is stored as it is.",
            "default": true
          },
          "maxResults": {
            "title": "Max output rows",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap on output rows. The run stops once it's reached."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}