{
  "openapi": "3.0.1",
  "info": {
    "title": "Website to Markdown – URL & Site Crawler for LLM/RAG",
    "description": "Convert any URL, sitemap or whole website to clean Markdown for LLMs, RAG and AI agents. Removes nav, footers and cookie banners, keeps headings, tables and code, adds RAG-ready chunks with token counts, llms.txt generation and an only-changed-pages mode. No browser: fast and cheap.",
    "version": "0.1",
    "x-build-id": "gcIT08Nc2SKhr5v8p"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~website-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-website-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/gazidev~website-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-website-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/gazidev~website-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-website-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": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Pages to convert. In 'Same-domain crawl' mode these are the crawl entry points; in 'Sitemap' mode give a sitemap URL (e.g. https://example.com/sitemap.xml) or just the site URL and the sitemap is found via robots.txt.",
            "default": [
              {
                "url": "https://docs.apify.com/academy/scraping-basics-javascript"
              },
              {
                "url": "https://www.paulgraham.com/greatwork.html"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "crawlMode": {
            "title": "Crawl mode",
            "enum": [
              "single",
              "sameDomain",
              "sitemap"
            ],
            "type": "string",
            "description": "'Only these URLs' converts exactly the start URLs. 'Same-domain crawl' follows links on the same site up to Max depth. 'Sitemap' converts the URLs listed in the site's sitemap(s).",
            "default": "single"
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on pages fetched in this run (start URLs included). Keeps cost predictable: at most maxPages x the page price.",
            "default": 20
          },
          "maxDepth": {
            "title": "Max crawl depth",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Same-domain crawl only: how many clicks away from a start URL to follow (0 = start URLs only).",
            "default": 2
          },
          "includeGlobs": {
            "title": "Include URL globs",
            "type": "array",
            "description": "Only crawl / take from the sitemap URLs that match one of these globs, e.g. https://docs.example.com/guides/**. ** = anything, * = anything except '/'. Empty = all URLs on the domain.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeGlobs": {
            "title": "Exclude URL globs",
            "type": "array",
            "description": "Skip URLs matching any of these globs, e.g. **/tag/**, **/page/*, **?replytocom=*.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "chunkSize": {
            "title": "RAG chunk size (tokens)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Split each page's Markdown into chunks of at most this many tokens (estimated as characters / 4) on heading and paragraph boundaries. Every chunk carries its heading path. 0 = no chunks. Included in the page price.",
            "default": 800
          },
          "contentMode": {
            "title": "Content",
            "enum": [
              "main",
              "full"
            ],
            "type": "string",
            "description": "'Main content' removes navigation, headers, footers, sidebars, cookie banners and share widgets and keeps the article / docs body. 'Full page' converts the whole <body>.",
            "default": "main"
          },
          "keepLinksInMarkdown": {
            "title": "Keep links in Markdown",
            "type": "boolean",
            "description": "Render links as [text](absolute URL). Turn off for plain text-only Markdown (fewer tokens).",
            "default": true
          },
          "includeImages": {
            "title": "Keep images in Markdown",
            "type": "boolean",
            "description": "Render images as ![alt](absolute URL). Off by default to save tokens.",
            "default": false
          },
          "outputLinks": {
            "title": "Output links[] list",
            "type": "boolean",
            "description": "Add every absolute link found on the page (including PDFs and other files, which are listed but not fetched) to the dataset row.",
            "default": true
          },
          "removeSelectors": {
            "title": "Extra CSS selectors to remove",
            "type": "string",
            "description": "Optional comma-separated CSS selectors removed before conversion, e.g. .newsletter-box, #comments."
          },
          "generateLlmsTxt": {
            "title": "Generate llms.txt + llms-full.txt",
            "type": "boolean",
            "description": "Build an llms.txt index (llmstxt.org format: sections with - [title](url): description) and an llms-full.txt with all Markdown, one pair per site, saved to the key-value store. Charged once per site.",
            "default": false
          },
          "onlyChanged": {
            "title": "Only new or changed pages",
            "type": "boolean",
            "description": "For scheduled re-indexing: remembers each page's ETag / Last-Modified / content hash in a named key-value store and outputs (and charges) only pages that are new or changed since the previous run with the same start URLs.",
            "default": false
          },
          "stateKey": {
            "title": "Change-tracking state key",
            "type": "string",
            "description": "Optional name for the change-tracking state (letters, digits, dashes). By default it is derived from the start URLs and crawl mode."
          },
          "respectRobots": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Skip URLs disallowed by robots.txt and honour Crawl-delay (max 10 s).",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Parallel requests in total.",
            "default": 10
          },
          "maxConcurrencyPerHost": {
            "title": "Max concurrency per host",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel requests to one host. Keep it low to be polite.",
            "default": 2
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per-request timeout.",
            "default": 30
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries for timeouts, connection errors, 429 and 5xx responses (with backoff).",
            "default": 2
          },
          "userAgent": {
            "title": "User-Agent",
            "type": "string",
            "description": "Custom User-Agent header. Leave empty for the default, which identifies this Actor with a contact address."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Not needed for most sites.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}