{
  "openapi": "3.0.1",
  "info": {
    "title": "REST API Paginator: Every Page of a JSON API",
    "description": "Fetch every page of a REST or JSON API in one run: page number, offset/limit, cursor, Link header or next-URL pagination. One dataset row per item (or per page), with your headers and API keys kept secret. Internal addresses are blocked. Empty input = free demo.",
    "version": "0.1",
    "x-build-id": "TbC1U4k3POhiosNBB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ucchiii~rest-api-paginator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ucchiii-rest-api-paginator",
        "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/ucchiii~rest-api-paginator/runs": {
      "post": {
        "operationId": "runs-sync-ucchiii-rest-api-paginator",
        "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/ucchiii~rest-api-paginator/run-sync": {
      "post": {
        "operationId": "run-sync-ucchiii-rest-api-paginator",
        "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": {
          "url": {
            "title": "API URL",
            "type": "string",
            "description": "The endpoint to paginate, for example https://api.example.com/v1/orders?status=open. Query parameters already in the URL are kept on every page. Leave empty for a free demo."
          },
          "method": {
            "title": "Method",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "PATCH"
            ],
            "type": "string",
            "description": "HTTP method. Use POST for search or query endpoints that take a JSON body (the same body is sent for every page).",
            "default": "GET"
          },
          "headers": {
            "title": "Headers (secret)",
            "type": "object",
            "description": "Request headers as a JSON object, for example {\"Authorization\": \"Bearer YOUR_TOKEN\"} or {\"X-API-Key\": \"...\"}. Stored encrypted. Values of headers whose names contain key, token, auth, secret, cookie or password are never logged and are shown as [REDACTED] in the output; if the API echoes them back, they are redacted there too. They are not sent to another host (redirects or next-page links pointing elsewhere)."
          },
          "queryParams": {
            "title": "Query parameters",
            "type": "object",
            "description": "Extra query parameters for the first request (and every request for page, offset and cursor pagination), for example {\"status\": \"open\", \"sort\": \"created\"}. Do not put API keys here; use Secret query parameters."
          },
          "secretQueryParams": {
            "title": "Secret query parameters",
            "type": "object",
            "description": "Query parameters that hold credentials, for example {\"api_key\": \"...\"} or {\"appid\": \"...\"}. Stored encrypted, added to every request to the same host (also to next-page links that drop them) and shown as [REDACTED] in _sourceUrl and logs."
          },
          "body": {
            "title": "JSON body",
            "type": "object",
            "description": "Optional JSON body for POST, PUT or PATCH (ignored for GET). Sent as application/json. With Put pagination parameters in = body, the page, offset, cursor and page-size values are written into this body."
          },
          "paginationType": {
            "title": "Pagination type",
            "enum": [
              "auto",
              "page",
              "offset",
              "cursor",
              "link",
              "nextUrl",
              "none"
            ],
            "type": "string",
            "description": "How the API moves to the next page. Auto follows a Link header rel=\"next\" or a next-page URL in the body (next, links.next, @odata.nextLink, paging.next ...) and stops when there is none.",
            "default": "auto"
          },
          "itemsPath": {
            "title": "Items path",
            "type": "string",
            "description": "Dot path to the array of items in each response, for example data.items, results or data[0].rows. Leave empty to detect it automatically from the first page (a top-level array, or the first array of objects such as data, items or results)."
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Items per page to ask for. Sent in the page-size parameter below; leave empty to use the API's default."
          },
          "limitParam": {
            "title": "Page-size parameter",
            "type": "string",
            "description": "Name of the page-size parameter, for example limit, per_page, page_size or pageSize. Used only when Page size is set."
          },
          "pageParam": {
            "title": "Page parameter (page number type)",
            "type": "string",
            "description": "Name of the page-number parameter, for example page or p.",
            "default": "page"
          },
          "startPage": {
            "title": "First page number",
            "minimum": 0,
            "type": "integer",
            "description": "Page number of the first request (1 for most APIs, 0 for some).",
            "default": 1
          },
          "offsetParam": {
            "title": "Offset parameter (offset type)",
            "type": "string",
            "description": "Name of the offset parameter, for example offset, skip or start. The offset grows by the number of items actually received on each page.",
            "default": "offset"
          },
          "startOffset": {
            "title": "First offset",
            "minimum": 0,
            "type": "integer",
            "description": "Offset of the first request.",
            "default": 0
          },
          "cursorPath": {
            "title": "Cursor path (cursor type)",
            "type": "string",
            "description": "Dot path to the next cursor or token in each response, for example meta.next_cursor, nextPageToken or response_metadata.next_cursor. Start with @last. to take it from the last item, for example @last.id (for starting_after style APIs). Pagination stops when the cursor is missing or repeats."
          },
          "cursorParam": {
            "title": "Cursor parameter (cursor type)",
            "type": "string",
            "description": "Name of the parameter that sends the cursor back, for example cursor, pageToken, starting_after or start_cursor.",
            "default": "cursor"
          },
          "hasMorePath": {
            "title": "Has-more path",
            "type": "string",
            "description": "Optional dot path to a true/false field that says whether more pages exist, for example has_more or meta.hasNextPage. When it is false, pagination stops."
          },
          "nextUrlPath": {
            "title": "Next URL path (next URL type)",
            "type": "string",
            "description": "Dot path to the next-page URL in the body, for example links.next or paging.next. Leave empty to look in the usual places. Relative URLs are resolved against the current page."
          },
          "paramLocation": {
            "title": "Put pagination parameters in",
            "enum": [
              "query",
              "body"
            ],
            "type": "string",
            "description": "Where the page, offset, cursor and page-size values go. Body is for APIs like search endpoints that read them from a POST body (dot paths such as paging.cursor are allowed).",
            "default": "query"
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "items",
              "pages"
            ],
            "type": "string",
            "description": "One row per item (each with _page and _sourceUrl), or one row per page with its items array, status and next cursor/link.",
            "default": "items"
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many requests (1 to 10,000).",
            "default": 100
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop once this many items are saved (0 = no limit). The last page is cut to fit.",
            "default": 0
          },
          "stopOnShortPage": {
            "title": "Stop on a short page",
            "type": "boolean",
            "description": "Page and offset types: stop when a page returns fewer items than Page size, saving one request. Leave off if the API may return fewer items than asked for on pages that are not the last.",
            "default": false
          },
          "delaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "number",
            "description": "Pause before each request after the first, to stay within the API's rate limit. Pages are fetched one at a time.",
            "default": 0.3
          },
          "timeoutSecs": {
            "title": "Timeout (seconds)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each request attempt.",
            "default": 30
          },
          "retries": {
            "title": "Retries",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Retries per page for HTTP 429 (honouring Retry-After, up to 120 s), 5xx and network errors. POST, PUT and PATCH are retried only for 429 or when no connection was made. Retries are not charged.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}