{
  "openapi": "3.0.1",
  "info": {
    "title": "Web to Markdown & AI Page Distiller — Fast RAG Crawler",
    "description": "Turn any webpage or full docs site into clean, noise-free Markdown for AI agents and RAG knowledge bases — without monthly SaaS lock-in. Includes site crawling, custom field extraction, and AI search readiness audits from $0.45–$1.00/1k pages ($0 on errors).",
    "version": "1.0",
    "x-build-id": "gaLJrb2q7N3qFNeXM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/alias_md5~web-markdown-distiller/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-alias_md5-web-markdown-distiller",
        "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/alias_md5~web-markdown-distiller/runs": {
      "post": {
        "operationId": "runs-sync-alias_md5-web-markdown-distiller",
        "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/alias_md5~web-markdown-distiller/run-sync": {
      "post": {
        "operationId": "run-sync-alias_md5-web-markdown-distiller",
        "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": {
          "mode": {
            "title": "Extraction Mode",
            "enum": [
              "urls",
              "crawl",
              "llms_audit"
            ],
            "type": "string",
            "description": "Choose batch URL distillation (`urls`), same-origin documentation site crawling (`crawl`), or AI/RAG readiness auditing (`llms_audit`).",
            "default": "urls"
          },
          "urls": {
            "title": "Target URLs (or Domains for AI Audit)",
            "type": "array",
            "description": "Public HTTP(S) URLs to convert into Markdown (`urls` mode), or domains / homepage URLs to audit (`llms_audit` mode). Duplicates are removed automatically.",
            "items": {
              "type": "string"
            },
            "default": [
              "https://example.com",
              "https://docs.python.org/3/tutorial/"
            ]
          },
          "startUrls": {
            "title": "Crawl Start URLs",
            "type": "array",
            "description": "Starting HTTP(S) URLs for `crawl` mode. If left empty in `crawl` mode, the `urls` list is used automatically.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "markdown",
              "text",
              "both"
            ],
            "type": "string",
            "description": "Return clean GitHub-Flavored Markdown, plain text, or both in each dataset item.",
            "default": "markdown"
          },
          "removeBoilerplate": {
            "title": "Remove Navigation, Footer & Ad Noise",
            "type": "boolean",
            "description": "Automatically focus on primary article/documentation content and strip menus, footers, sidebars, and consent banners for higher LLM signal density.",
            "default": true
          },
          "includeImages": {
            "title": "Include Markdown Image Links",
            "type": "boolean",
            "description": "Preserve `![alt](url)` image references in the generated Markdown.",
            "default": false
          },
          "includeInteractiveElements": {
            "title": "Include Interactive Element Map (AI Agents)",
            "type": "boolean",
            "description": "Attach a compact index of buttons, links, inputs, and controls with stable CSS and XPath locators for AI agent grounding.",
            "default": false
          },
          "includeWebMcpTools": {
            "title": "Discover WebMCP Tools",
            "type": "boolean",
            "description": "Automatically discover structured WebMCP tool definitions declared on each page.",
            "default": true
          },
          "includeLinks": {
            "title": "Include Extracted Links",
            "type": "boolean",
            "description": "Attach deduplicated resolved same-origin and outbound links found on each page.",
            "default": false
          },
          "extractSelectors": {
            "title": "Custom CSS Field Extraction",
            "type": "object",
            "description": "Optional dictionary mapping output field names to CSS selectors (for example `{\"headings\": \"h2\", \"price\": \".price\"}`).",
            "default": {}
          },
          "maxMarkdownChars": {
            "title": "Max Markdown Characters per Page",
            "minimum": 500,
            "maximum": 500000,
            "type": "integer",
            "description": "Upper character budget per distilled page (500–500,000).",
            "default": 120000
          },
          "maxDepth": {
            "title": "Max Crawl Depth",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Maximum link hop depth from `startUrls` in `crawl` mode (1–5).",
            "default": 2
          },
          "maxPages": {
            "title": "Max Crawled Pages",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum number of successfully distilled pages to deliver in `crawl` mode (1–2,000).",
            "default": 50
          },
          "includeUrlPatterns": {
            "title": "Include URL Regex Patterns",
            "type": "array",
            "description": "Optional regular expressions that discovered crawl URLs must match (for example `/docs/`).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "excludeUrlPatterns": {
            "title": "Exclude URL Regex Patterns",
            "type": "array",
            "description": "Optional regular expressions for URLs to skip during crawling (for example `/changelog/` or `\\?page=`).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "useSitemapAndLlmsDiscovery": {
            "title": "Seed Crawl via llms.txt & sitemap.xml",
            "type": "boolean",
            "description": "Automatically inspect `/llms.txt` and `/sitemap.xml` on target origins to discover documentation pages faster.",
            "default": true
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Honor `Disallow` rules declared in the target origin's `/robots.txt` during site crawling.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max Concurrent Requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Number of concurrent page fetches (1–20).",
            "default": 5
          },
          "requestTimeoutSeconds": {
            "title": "Request Timeout (Seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum seconds to wait per page request before skipping cleanly at $0 (5–120).",
            "default": 20
          },
          "maxResponseMegabytes": {
            "title": "Max Page Size (MB)",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Maximum download size per page in megabytes (1–16 MB). Oversized payloads are skipped cleanly at $0.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Network Routing (Optional)",
            "type": "object",
            "description": "Optional custom network routing configuration. Disabled by default for fastest direct fetching.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}