{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Page to Markdown for LLM & RAG: Fast URL Fetcher",
    "description": "Turn any list of URLs into clean Markdown, text and metadata for LLMs, RAG and AI agents. Plain HTTP first, a headless browser only when a page needs JavaScript. Respects robots.txt.",
    "version": "0.1",
    "x-build-id": "ic4dT14HQrOuqY5D6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datlab~web-page-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datlab-web-page-to-markdown",
        "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/datlab~web-page-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-datlab-web-page-to-markdown",
        "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/datlab~web-page-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-datlab-web-page-to-markdown",
        "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": {
          "startUrls": {
            "title": "URLs",
            "type": "array",
            "description": "Pages to fetch. Each URL is fetched once and returned as one dataset item. This Actor fetches only the URLs you give it; it does not run web searches.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "query": {
            "title": "URL(s) as text (optional)",
            "type": "string",
            "description": "Alternative to the list above, compatible with RAG Web Browser's `query` field: one or more URLs separated by new lines or commas. Free-text search terms are rejected, since this Actor doesn't search the web."
          },
          "outputFormats": {
            "title": "Output formats",
            "type": "array",
            "description": "Which content fields to include in each item.",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "text",
                "html"
              ],
              "enumTitles": [
                "Markdown",
                "Plain text",
                "Cleaned HTML"
              ]
            },
            "default": [
              "markdown"
            ]
          },
          "scrapingTool": {
            "title": "Scraping tool",
            "enum": [
              "auto",
              "raw-http",
              "browser-playwright"
            ],
            "type": "string",
            "description": "Auto fetches each page with plain HTTP and switches to a headless Chromium only when the HTML looks client-rendered. You're charged the browser price only for pages that actually used the browser.",
            "default": "auto"
          },
          "htmlTransformer": {
            "title": "Main-content extraction",
            "enum": [
              "readableTextIfPossible",
              "readableText",
              "none"
            ],
            "type": "string",
            "description": "How to pick the main content. Readable text uses Mozilla Readability (as in Firefox Reader View). 'If possible' falls back to the whole cleaned page when Readability finds too little.",
            "default": "readableTextIfPossible"
          },
          "readableTextCharThreshold": {
            "title": "Readable text minimum characters",
            "minimum": 0,
            "type": "integer",
            "description": "Readability results shorter than this are treated as a failed extraction.",
            "default": 100
          },
          "removeElementsCssSelector": {
            "title": "Remove HTML elements (CSS selector)",
            "type": "string",
            "description": "Elements removed before conversion (navigation, footers, scripts, dialogs, buttons by default). Leave empty to use the default."
          },
          "keepElementsCssSelector": {
            "title": "Keep only these elements (CSS selector)",
            "type": "string",
            "description": "Optional. If set, only matching elements are converted (e.g. `article, .docs-content`)."
          },
          "removeCookieWarnings": {
            "title": "Remove cookie banners",
            "type": "boolean",
            "description": "Strip common cookie-consent banners (OneTrust, Cookiebot, Didomi, Usercentrics and others) from the output. Banners are removed from the content only; nothing is clicked or accepted.",
            "default": true
          },
          "includeLinks": {
            "title": "Include links",
            "type": "boolean",
            "description": "Add the list of links on each page (absolute URL, anchor text, internal/external).",
            "default": true
          },
          "maxLinksPerPage": {
            "title": "Max links per page",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Caps the links list per page.",
            "default": 500
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Maximum time to load one page.",
            "default": 40
          },
          "dynamicContentWaitSecs": {
            "title": "Dynamic content wait (browser only)",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "For browser-rendered pages: how long to wait for the network to go idle after load.",
            "default": 10
          },
          "waitUntil": {
            "title": "Navigation wait event (browser only)",
            "enum": [
              "domcontentloaded",
              "load",
              "networkidle"
            ],
            "type": "string",
            "description": "Which event counts as 'page loaded' before the dynamic-content wait.",
            "default": "load"
          },
          "waitForSelector": {
            "title": "Wait for CSS selector (browser only)",
            "type": "string",
            "description": "Optional. Wait until this element appears before reading the page."
          },
          "blockMedia": {
            "title": "Block images, video and fonts (browser only)",
            "type": "boolean",
            "description": "Faster and cheaper rendering. Doesn't affect image links in the Markdown.",
            "default": true
          },
          "maxRequestRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries on network errors and 5xx responses.",
            "default": 1
          },
          "desiredConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many pages to fetch in parallel.",
            "default": 5
          },
          "minDelayPerHostMs": {
            "title": "Minimum delay per host (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Politeness: minimum gap between requests to the same host. robots.txt Crawl-delay is honored when larger.",
            "default": 500
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Datacenter proxies only; residential and SERP groups are not supported.",
            "default": {
              "useApifyProxy": false
            }
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Add a `debug` object with content type, render decision and page signals.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}