{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Page to Markdown for LLMs (robots.txt-safe)",
    "description": "Clean Markdown and RAG chunks from public pages or whole doc sites. Sitemap-first polite crawl: robots.txt, Crawl-delay, named bot, hard page/time budgets. Flat per-page price; cheap unchanged-page recrawls. No browser, no logins.",
    "version": "0.2",
    "x-build-id": "U9XBvEsl8ZxUFeBVh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datafeed~web-page-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datafeed-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/datafeed~web-page-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-datafeed-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/datafeed~web-page-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-datafeed-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",
        "required": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "URLs (list mode) or start URLs (crawl mode)",
            "type": "array",
            "description": "List mode: the pages to convert (up to 500, duplicates removed). Crawl mode: up to 20 start URLs; the crawl stays on their host and inside their path (https://x.com/docs/intro stays under /docs/). Pages that robots.txt disallows are never fetched and never charged.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "list",
              "crawl"
            ],
            "type": "string",
            "description": "list: convert the URLs given. crawl: read the sites' sitemaps, then follow links inside the start path, up to maxPages and maxRunMinutes.",
            "default": "list"
          },
          "maxPages": {
            "title": "Max pages (crawl mode)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on pages fetched in crawl mode (sitemaps and robots.txt not counted). Discovered pages beyond it are counted as notFetched in SUMMARY.",
            "default": 100
          },
          "maxDepth": {
            "title": "Max link depth (crawl mode)",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "How many clicks away from a start URL the crawl may go (sitemap URLs count as depth 1). 0 = start URLs only.",
            "default": 3
          },
          "useSitemaps": {
            "title": "Use sitemaps first",
            "type": "boolean",
            "description": "Read the sitemaps listed in robots.txt (or /sitemap.xml) before following links.",
            "default": true
          },
          "followLinks": {
            "title": "Follow links",
            "type": "boolean",
            "description": "Follow links found on crawled pages (same host, inside the start path).",
            "default": true
          },
          "includePaths": {
            "title": "Only these paths",
            "type": "array",
            "description": "Path prefixes such as /docs/ that replace the start-URL path scope. Empty = the start URLs' own directories.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludePaths": {
            "title": "Skip these paths",
            "type": "array",
            "description": "Path prefixes never fetched, e.g. /blog/tag/.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "removeRepeatedBlocks": {
            "title": "Remove blocks repeated across the site",
            "type": "boolean",
            "description": "Crawl mode: drop paragraphs that already appeared on 3 earlier pages of the same site (leftover banners, footers). Headings, code and tables are always kept.",
            "default": true
          },
          "maxRunMinutes": {
            "title": "Time budget (minutes)",
            "minimum": 1,
            "maximum": 1440,
            "type": "integer",
            "description": "The run stops starting new pages after this time and always finishes cleanly with a SUMMARY (it also stops before the platform run timeout).",
            "default": 30
          },
          "mainContentOnly": {
            "title": "Main content only",
            "type": "boolean",
            "description": "Keep the main content only: drop navigation, headers, footers, sidebars, cookie and consent banners, share bars, newsletter boxes, related-post lists and comments. Tables, code blocks, headings and lists are kept. Turn off to convert the whole <body>.",
            "default": true
          },
          "includeTables": {
            "title": "Structured tables",
            "type": "boolean",
            "description": "Also return every HTML table as {caption, headers, rows} next to the Markdown.",
            "default": true
          },
          "maxChars": {
            "title": "Max Markdown characters per page",
            "minimum": 1000,
            "maximum": 2000000,
            "type": "integer",
            "description": "Longer Markdown is cut and marked truncated: true.",
            "default": 200000
          },
          "maxPageMb": {
            "title": "Max page size (MB)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Pages larger than this are reported as errors (not charged).",
            "default": 5
          },
          "incremental": {
            "title": "Incremental recrawl",
            "type": "boolean",
            "description": "Remember each page's ETag, Last-Modified and content hash in a named key-value store. Next time, unchanged pages are reported as status 'unchanged' and charged the much cheaper page-unchanged event.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that keeps the recrawl state (letters, digits, '-'). Empty = one store per job, named from the mode, start URLs and paths. Set a name to share state between differently configured runs.",
            "default": ""
          },
          "chunk": {
            "title": "Add RAG chunks",
            "type": "boolean",
            "description": "Also return token-budgeted chunks of each page's Markdown, in order, each with the URL, heading path and character offsets. Free.",
            "default": false
          },
          "chunkTokens": {
            "title": "Chunk size (approx. tokens)",
            "minimum": 50,
            "maximum": 8000,
            "type": "integer",
            "description": "Approximate tokens per chunk (1 token ~ 4 characters).",
            "default": 512
          },
          "chunkOverlapTokens": {
            "title": "Chunk overlap (approx. tokens)",
            "minimum": 0,
            "maximum": 4000,
            "type": "integer",
            "description": "Repeated from the previous chunk; at most half the chunk size.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}