{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Fetch for AI - URL to Markdown, Text, HTML & PDF",
    "description": "Fetch any URL or a list of URLs as clean Markdown, plain text, HTML or links for AI agents, MCP, RAG, n8n and Make. Auto JavaScript rendering, PDF/DOCX to Markdown, token counts. Failed, blocked and 404 pages are free.",
    "version": "1.0",
    "x-build-id": "jAKFN7suGJxBZd6Bf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kantolabs~web-fetch-for-ai/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kantolabs-web-fetch-for-ai",
        "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/kantolabs~web-fetch-for-ai/runs": {
      "post": {
        "operationId": "runs-sync-kantolabs-web-fetch-for-ai",
        "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/kantolabs~web-fetch-for-ai/run-sync": {
      "post": {
        "operationId": "run-sync-kantolabs-web-fetch-for-ai",
        "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": "URL",
            "type": "string",
            "description": "One web address to fetch (http:// or https://; 'example.com' works too). Agents: use this for a single page. For many pages use 'urls'. Both can be combined."
          },
          "urls": {
            "title": "URLs (list)",
            "type": "array",
            "description": "Many web addresses in one run (up to 1,000), fetched in parallel, one result row each. Pages, PDFs, DOCX/PPTX/XLSX, JSON, text files. If both 'url' and 'urls' are empty, a sample page is fetched.",
            "items": {
              "type": "string"
            }
          },
          "formats": {
            "title": "Output formats",
            "type": "array",
            "description": "What to return per URL. markdown = clean main content with headings, links, tables (best for LLMs). text = same without formatting. html = cleaned HTML. links = every absolute link on the page. raw = untouched body (base64 for binary files up to 5 MB). Empty list = best default per file type.",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "text",
                "html",
                "links",
                "raw"
              ],
              "enumTitles": [
                "Markdown (best for LLMs)",
                "Plain text",
                "Cleaned HTML",
                "Links on the page",
                "Raw response body"
              ]
            },
            "default": [
              "markdown"
            ]
          },
          "onlyMainContent": {
            "title": "Main content only",
            "type": "boolean",
            "description": "On (default): keep the article / main content and drop navigation, header, footer, sidebars, cookie banners, ads and share buttons. Off: the whole page body (only scripts and styles removed) - use when you need menus or footers.",
            "default": true
          },
          "renderJs": {
            "title": "JavaScript rendering",
            "enum": [
              "auto",
              "never",
              "always"
            ],
            "type": "string",
            "description": "auto (default): plain HTTP first; a headless browser is used only when the page is an empty JavaScript app shell or shows a JavaScript check. never: HTTP only, fastest. always: render every HTML page in Chromium. Same price either way.",
            "default": "auto"
          },
          "wait": {
            "title": "Wait after load (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Extra milliseconds to wait after the page loads, for content that appears late. Any value above 0 renders the page in the headless browser (unless JavaScript rendering is 'never'). 0 = no extra wait.",
            "default": 0
          },
          "maxTokens": {
            "title": "Max tokens per page",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cut markdown and text to this many tokens (cl100k, about 0.75 words per token) so a page fits an LLM context; the row then has truncated=true. 0 = no limit. Every row reports tokenCount either way.",
            "default": 0
          },
          "language": {
            "title": "Preferred language",
            "type": "string",
            "description": "Sent as the Accept-Language header so multilingual sites return that language, e.g. 'de-DE,de;q=0.9' or 'ja'.",
            "default": "en-US,en;q=0.9"
          },
          "timeoutSecs": {
            "title": "Timeout per URL (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Time allowed for downloading one URL; the browser step gets the same again. A URL that runs out of time becomes a free FETCH_TIMEOUT row; the run itself never hangs.",
            "default": 30
          },
          "maxConcurrency": {
            "title": "Parallel URLs",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many URLs are fetched at the same time. Raise it for long lists of different sites; lower it to be gentle with one site.",
            "default": 5
          },
          "useApifyProxy": {
            "title": "Retry blocked URLs on Apify Proxy",
            "type": "boolean",
            "description": "When a site refuses the request (403/429/503, bot-check page, timeout), retry once from a fresh Apify datacenter proxy IP. No CAPTCHA solving, no login, no cookies: still blocked = free BLOCKED row.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}