{
  "openapi": "3.0.1",
  "info": {
    "title": "Paginated REST API Fetcher - Fetch All Pages",
    "description": "Export a REST API into one Apify Dataset using page-number, offset, cursor or next-link pagination. Set page and item limits, then check the run summary to see whether the export finished or stopped early.",
    "version": "0.1",
    "x-build-id": "6dEuGrC5KDQkNrAab"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automa-flow~paginated-rest-api-fetcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automa-flow-paginated-rest-api-fetcher",
        "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/automa-flow~paginated-rest-api-fetcher/runs": {
      "post": {
        "operationId": "runs-sync-automa-flow-paginated-rest-api-fetcher",
        "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/automa-flow~paginated-rest-api-fetcher/run-sync": {
      "post": {
        "operationId": "run-sync-automa-flow-paginated-rest-api-fetcher",
        "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": [
          "url",
          "pagination"
        ],
        "properties": {
          "url": {
            "title": "API URL",
            "minLength": 1,
            "maxLength": 2048,
            "type": "string",
            "description": "Public http(s) REST endpoint to fetch. Localhost, private, link-local and cloud-metadata targets are rejected. Only ports 80 and 443 are allowed."
          },
          "method": {
            "title": "HTTP method",
            "enum": [
              "GET",
              "POST"
            ],
            "type": "string",
            "description": "GET (default) or POST. Body is only allowed with POST.",
            "default": "GET"
          },
          "headers": {
            "title": "HTTP headers",
            "type": "object",
            "description": "Optional request headers. Do not put secrets in logs; Authorization/Cookie/API-key values are redacted from Actor logs but still sent to the API. Prefer Apify secret inputs where possible. Header names must be HTTP tokens and values must contain only printable ASCII or tabs; invalid headers are rejected before fetching.",
            "default": {},
            "additionalProperties": true
          },
          "query": {
            "title": "Query parameters",
            "type": "object",
            "description": "Base query string parameters merged with query parameters already present in the configured URL for the first and parameter-based page requests. Follow-up nextUrl pages use the returned link.",
            "default": {},
            "additionalProperties": true
          },
          "body": {
            "title": "JSON body",
            "type": "object",
            "description": "Optional JSON body for POST requests."
          },
          "itemsPath": {
            "title": "Items JSON path",
            "maxLength": 512,
            "type": "string",
            "description": "Dotted path to the items array (for example data.items). Use an empty string when the response root is already a JSON array.",
            "default": ""
          },
          "pagination": {
            "title": "Pagination",
            "required": [
              "mode"
            ],
            "type": "object",
            "description": "Pagination mode and fields for the target API.",
            "properties": {
              "mode": {
                "title": "Mode",
                "type": "string",
                "enum": [
                  "page",
                  "offset",
                  "cursor",
                  "nextUrl"
                ],
                "description": "page, offset, cursor, or nextUrl."
              },
              "pageParam": {
                "title": "Page parameter",
                "type": "string",
                "description": "Query parameter name for page-number mode.",
                "default": "page",
                "minLength": 1
              },
              "startPage": {
                "title": "Start page",
                "type": "integer",
                "description": "First page number.",
                "default": 1,
                "minimum": 0
              },
              "pageIncrement": {
                "title": "Page increment",
                "type": "integer",
                "description": "How much to add to the page number after each successful page.",
                "default": 1,
                "minimum": 1
              },
              "pageSizeParam": {
                "title": "Page size parameter",
                "type": "string",
                "description": "Optional query parameter for page size.",
                "minLength": 1
              },
              "pageSize": {
                "title": "Page size",
                "type": "integer",
                "description": "Page size value. When set, a short final page (fewer items than pageSize) stops pagination.",
                "minimum": 1
              },
              "offsetParam": {
                "title": "Offset parameter",
                "type": "string",
                "description": "Query parameter name for the offset value in offset mode.",
                "default": "offset",
                "minLength": 1
              },
              "startOffset": {
                "title": "Start offset",
                "type": "integer",
                "description": "Initial offset for the first page in offset mode.",
                "default": 0,
                "minimum": 0
              },
              "limitParam": {
                "title": "Limit parameter",
                "type": "string",
                "description": "Query parameter name for the page size in offset mode.",
                "default": "limit",
                "minLength": 1
              },
              "limit": {
                "title": "Limit",
                "type": "integer",
                "description": "Page size for offset mode (required when mode=offset).",
                "minimum": 1
              },
              "offsetStep": {
                "title": "Offset step",
                "type": "integer",
                "description": "Optional fixed step. Default is the number of items returned on the page.",
                "minimum": 1
              },
              "cursorRequestParam": {
                "title": "Cursor request parameter",
                "type": "string",
                "description": "Query parameter that receives the next cursor (required for cursor mode).",
                "minLength": 1
              },
              "nextCursorPath": {
                "title": "Next cursor JSON path",
                "type": "string",
                "description": "Path to the next cursor in the response (required for cursor mode).",
                "minLength": 1
              },
              "nextUrlPath": {
                "title": "Next URL JSON path",
                "type": "string",
                "description": "Path to the next page URL in the JSON body (for nextUrl mode).",
                "minLength": 1
              },
              "useLinkHeader": {
                "title": "Use Link: rel=next header",
                "type": "boolean",
                "description": "When true, read the next page from an RFC 5988 Link header.",
                "default": false
              },
              "totalCountPath": {
                "title": "Total count JSON path",
                "type": "string",
                "description": "Optional path to a reported total. Missing/non-numeric values or a mismatch after completion make the run partial/failed instead of silently claiming completeness.",
                "minLength": 1
              }
            },
            "additionalProperties": false
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard stop after this many successful or attempted page requests. Stop reason LIMIT_PAGES (run status LIMIT_REACHED).",
            "default": 1000
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Hard stop after this many Dataset ITEM rows. Stop reason LIMIT_ITEMS (run status LIMIT_REACHED).",
            "default": 100000
          },
          "timeoutSeconds": {
            "title": "Per-request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout applied to each HTTP attempt.",
            "default": 30
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Extra GET attempts after the first try for timeouts, network errors and retryable HTTP statuses (408/425/429/5xx). POST is never retried automatically because it may be non-idempotent. Deterministic 4xx responses are never retried. Retries are not billed.",
            "default": 2
          },
          "dedupeIdPath": {
            "title": "Deduplicate by item id path",
            "type": "string",
            "description": "Optional dotted path inside each item for stable-ID deduplication. Off by default. Never invents an id from arbitrary JSON."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}