{
  "openapi": "3.0.1",
  "info": {
    "title": "Smart Page Fetcher",
    "description": "Fetch a batch of URLs adaptively: cheap HTTP for static pages, browser render for JavaScript pages, stealth+residential proxy only for actively defended pages. Pay per URL by the difficulty that actually worked, with browser launches amortized across the batch.",
    "version": "0.0",
    "x-build-id": "rCePdavLRGrC4Vudb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/shelvick~smart-page-fetcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-shelvick-smart-page-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/shelvick~smart-page-fetcher/runs": {
      "post": {
        "operationId": "runs-sync-shelvick-smart-page-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/shelvick~smart-page-fetcher/run-sync": {
      "post": {
        "operationId": "run-sync-shelvick-smart-page-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",
        "properties": {
          "urls": {
            "title": "URLs",
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "description": "List of URLs to fetch. The Actor processes them as a batch: tier-1 (plain HTTP) is tried for all URLs in parallel first, escalating any that fail to tier-2 (JavaScript render), and only the still-failed ones to tier-3 (stealth + residential proxy). Browser launch and Actor overhead are amortized across the batch, so larger batches lower the effective per-URL cost. Each entry is either a string (URL only) or an object {\"url\": \"https://...\", \"headers\": {\"Accept\": \"application/json\"}} to set request headers for that URL. Allowed header names: Accept, Accept-Language, Accept-Encoding, User-Agent, Referer, Content-Type. Anything else (Cookie, Authorization, X-*) is rejected to prevent the Actor from being used as an authenticated session proxy."
          },
          "basic": {
            "title": "Basic HTTP tier",
            "enum": [
              "auto",
              "true",
              "false"
            ],
            "type": "string",
            "description": "Controls the plain-HTTP tier. 'auto' lets it participate in the escalation chain (lowest cost first). 'false' skips it (use when callers know JS is required). 'true' forces the chain to start here (the default behavior in most cases).",
            "default": "auto"
          },
          "js": {
            "title": "JavaScript render tier",
            "enum": [
              "auto",
              "true",
              "false"
            ],
            "type": "string",
            "description": "Controls the JavaScript-render tier (real browser, no stealth, no proxy). 'auto' uses it after basic fails. 'true' starts the chain here when caller knows JS is needed. 'false' caps cost at basic (or jumps straight to stealth if basic fails too).",
            "default": "auto"
          },
          "stealth": {
            "title": "Stealth + proxy tier",
            "enum": [
              "auto",
              "true",
              "false"
            ],
            "type": "string",
            "description": "Controls the stealth tier (anti-bot bypass with rotating residential proxy). 'auto' uses it as the last fallback. 'true' starts here when caller knows the target has aggressive defenses (saves the cost of two failed lower tiers). 'false' caps the per-URL max at the JS-render tier price.",
            "default": "auto"
          },
          "outputs": {
            "title": "Output formats",
            "type": "array",
            "description": "Output formats to compute per URL — derived from the same fetched HTML, no extra fetch charge. Choose any combination of: html (full raw HTML, returned as a Key-Value Store URL), text (boilerplate-stripped visible text), markdown (page content as Markdown), a11y (browser accessibility tree, requires JS render or higher, returned as a Key-Value Store URL), screenshot (full-page PNG, requires JS render or higher, returned as a Key-Value Store URL), links (every anchor as {url, text, title}), json_ld (Schema.org JSON-LD blocks), og (OpenGraph values with og: prefix stripped), meta (other meta tags as a flat dict including twitter:*). Unknown formats cause the run to fail.",
            "items": {
              "type": "string"
            },
            "default": [
              "html",
              "markdown"
            ]
          },
          "runtime_budget_ms": {
            "title": "Total runtime budget (ms)",
            "minimum": 30000,
            "maximum": 3600000,
            "type": "integer",
            "description": "Total wall-clock budget for the whole batch. When exhausted, unprocessed URLs come back as 'deferred' records (zero charge) and the run ends cleanly. Default 270000 (4m30s) keeps synchronous callers under Apify's 5-minute sync API timeout with headroom. Raise up to 3600000 (60m) for large async batches.",
            "default": 270000
          },
          "country": {
            "title": "Proxy geo (stealth tier only)",
            "pattern": "^[A-Z]{2}$",
            "type": "string",
            "description": "Optional ISO-3166-1 alpha-2 country code (e.g. 'US', 'GB', 'DE'). Forwarded to the stealth tier's residential proxy for geo-targeting. Ignored by basic and JS tiers."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}