{
  "openapi": "3.0.1",
  "info": {
    "title": "Website & Page to Markdown for RAG and LLMs",
    "description": "Turn web pages or whole sites into clean Markdown for RAG and LLMs: main content only, with title, links and word count. Whole-site mode reads the sitemap first, can return only changed pages, and splits pages into heading-based chunks. Respects robots.txt and AI opt-outs. No browser.",
    "version": "1.1",
    "x-build-id": "Puo79d3GAXweM6FeR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/humble-echidna~page-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-humble-echidna-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/humble-echidna~page-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-humble-echidna-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/humble-echidna~page-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-humble-echidna-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": "Web page URLs",
            "type": "array",
            "description": "The pages to convert, one per line, e.g. https://docs.apify.com/storage; a missing https:// is added. With crawlWholeSite, each line is a site (https://docs.example.com), a section of one (https://docs.example.com/guide: only pages under /guide) or a sitemap URL. Pages the site's robots.txt disallows, or whose robots.txt opts out of AI crawlers, are skipped and listed in the log.",
            "default": [
              "https://docs.apify.com/storage",
              "https://docs.apify.com/storage/key-value-store"
            ],
            "items": {
              "type": "string"
            }
          },
          "crawlWholeSite": {
            "title": "Whole site (sitemap first)",
            "type": "boolean",
            "description": "Default false. When true, convert every page of each site in urls instead of only the page itself: the pages its sitemap lists (found from robots.txt, /sitemap.xml or /sitemap_index.xml), or, with no usable sitemap, the pages reached by following its same-site links. A URL with a path limits it to pages under that path. Capped by maxPagesPerSite; crawlDepth and maxPagesPerUrl are ignored in this mode.",
            "default": false
          },
          "maxPagesPerSite": {
            "title": "Max pages per site (whole-site mode)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Whole-site mode only (crawlWholeSite true): return at most this many pages for each URL in urls. 1 to 10,000, default 100. Unchanged pages skipped by onlyChangedPages don't count. At most 5 pages are fetched per page returned (plus 100), so a site where almost nothing changed can't run for ever.",
            "default": 100
          },
          "crawlDepth": {
            "title": "Follow links (crawl depth)",
            "minimum": 0,
            "maximum": 2,
            "type": "integer",
            "description": "How far to follow links from each URL: 0 to 2, default 0. 0 converts only the pages you list. 1 also converts the same-site pages they link to, 2 goes one more link further, up to maxPagesPerUrl pages. Links to other sites and to files (PDF, images, ...) are never followed. Ignored when crawlWholeSite is true.",
            "default": 0
          },
          "maxPagesPerUrl": {
            "title": "Max pages per URL when following links",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "When following links (crawlDepth 1 or 2): fetch at most this many pages for each URL in urls, the URL itself included. 1 to 1,000, default 10. No effect at crawlDepth 0 or with crawlWholeSite.",
            "default": 10
          },
          "includeUrlPatterns": {
            "title": "Only pages matching",
            "type": "array",
            "description": "When crawling (crawlWholeSite, or crawlDepth 1 or 2), convert only pages whose URL matches one of these patterns, one per line. Without * a pattern matches anywhere in the URL (e.g. /docs/); with *, it must match the whole URL (e.g. https://example.com/blog/*). Case-insensitive. Pages that don't match are never fetched. The URLs you list are always converted. Default: empty (every page).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeUrlPatterns": {
            "title": "Skip pages matching",
            "type": "array",
            "description": "When crawling (crawlWholeSite, or crawlDepth 1 or 2), never fetch pages whose URL matches one of these patterns, one per line, same syntax as includeUrlPatterns, e.g. /tag/ or ?page=. Default: empty.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyChangedPages": {
            "title": "Only changed pages",
            "type": "boolean",
            "description": "Default false. When true, return only pages that are new or changed since the last run of this same input. A sitemap page whose lastmod date hasn't changed is skipped without being fetched; any other page is fetched and skipped (not charged) when its Markdown is identical to last time. The memory is kept in a key-value store named page-to-markdown-changes in your account, separately for each URL and set of options.",
            "default": false
          },
          "includeImages": {
            "title": "Include images",
            "type": "boolean",
            "description": "Default false. When true, keep images in the Markdown as ![alt text](image URL). Off by default, since images are usually noise for text models.",
            "default": false
          },
          "chunkMarkdown": {
            "title": "Split into chunks for RAG",
            "type": "boolean",
            "description": "Default false. When true, also split each page's Markdown into chunks: one per heading section, with sections larger than maxChunkChars split at paragraph breaks. Each chunk carries its heading path (the headings it sits under), the page URL, title and its index. Where chunks go: chunkOutput. Chunks are free: you still pay per page.",
            "default": false
          },
          "maxChunkChars": {
            "title": "Max chunk size (characters)",
            "minimum": 200,
            "maximum": 50000,
            "type": "integer",
            "description": "Only with chunkMarkdown: no chunk is longer than this many characters. 200 to 50,000, default 2000. A longer section is split at paragraph breaks, then at line breaks.",
            "default": 2000
          },
          "chunkOutput": {
            "title": "Chunk output",
            "enum": [
              "page",
              "chunk"
            ],
            "type": "string",
            "description": "Only with chunkMarkdown. `page` (the default): each page's chunks go in a chunks array on its row. `chunk`: every chunk is written as its own row to this run's second dataset, named chunks (the default dataset keeps one row per page; chunk rows are not charged).",
            "default": "page"
          },
          "maxResults": {
            "title": "Max pages per run",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many converted pages in total, e.g. 20. Minimum 1; leave empty (the default) for no limit. The run also stops cleanly at the maximum cost per run you set in the run options, whichever comes first. Set it to keep a run small and quick."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}