{
  "openapi": "3.0.1",
  "info": {
    "title": "URL to Markdown for RAG: Pages, PDFs, Sitemaps to Clean Chunks",
    "description": "Turn a URL, sitemap or docs site into clean Markdown and RAG chunks with heading paths, token counts and metadata. PDFs included, no headless browser. Failed, blocked and duplicate URLs are not charged.",
    "version": "1.0",
    "x-build-id": "pLYa0Y3RtWTLfpaCd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/atesen-software~url-to-markdown-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-atesen-software-url-to-markdown-rag",
        "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/atesen-software~url-to-markdown-rag/runs": {
      "post": {
        "operationId": "runs-sync-atesen-software-url-to-markdown-rag",
        "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/atesen-software~url-to-markdown-rag/run-sync": {
      "post": {
        "operationId": "run-sync-atesen-software-url-to-markdown-rag",
        "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, PDFs or website start URLs. Plain domains such as example.com work too. With crawl mode \"Single pages\" every URL is converted on its own; the other modes treat each URL as the start of a crawl.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "crawlMode": {
            "title": "Crawl mode",
            "enum": [
              "single",
              "sitemap",
              "crawl",
              "sitemap+crawl"
            ],
            "type": "string",
            "description": "<b>Single pages</b>: convert only the given URLs.<br><b>Sitemap</b>: read robots.txt/sitemap.xml and convert the pages under each start URL.<br><b>Follow links</b>: crawl links from the start URL.<br><b>Sitemap + links</b>: both, best coverage for docs sites.",
            "default": "single"
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many converted pages (charged rows). Default: 100 when crawling, 1000 for single pages."
          },
          "maxDepth": {
            "title": "Max link depth",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "How many clicks away from the start URL to follow links (Follow links modes only).",
            "default": 3
          },
          "crawlScope": {
            "title": "Crawl scope",
            "enum": [
              "path",
              "host",
              "domain"
            ],
            "type": "string",
            "description": "Which URLs a crawl may visit. <b>Path</b>: only URLs under the start URL (e.g. /docs/...). <b>Host</b>: the whole host. <b>Domain</b>: the host and its subdomains.",
            "default": "path"
          },
          "includeUrlPatterns": {
            "title": "Only URLs matching",
            "type": "array",
            "description": "Optional. Globs (https://example.com/blog/**), /regex/ or plain text. A crawled URL must match one of them.",
            "items": {
              "type": "string"
            }
          },
          "excludeUrlPatterns": {
            "title": "Skip URLs matching",
            "type": "array",
            "description": "Optional. Globs, /regex/ or plain text, e.g. /tag/ or **/login*.",
            "items": {
              "type": "string"
            }
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt while crawling",
            "type": "boolean",
            "description": "Skip crawled URLs that robots.txt disallows (free status row). URLs you list yourself are always fetched.",
            "default": true
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 0,
            "maximum": 8000,
            "type": "integer",
            "description": "Split each page into RAG chunks of at most this many tokens (cl100k, the OpenAI tokenizer). Chunks follow headings, paragraphs and sentences; tables keep their header row. 0 = no chunking.",
            "default": 512
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Repeat up to this many tokens of trailing paragraphs at the start of the next chunk.",
            "default": 50
          },
          "chunkOutput": {
            "title": "Chunk output",
            "enum": [
              "inline",
              "rows",
              "both"
            ],
            "type": "string",
            "description": "<b>Inline</b>: chunks array inside each page row. <b>Rows</b>: one extra dataset row per chunk (free), ready for vector DB import. <b>Both</b>.",
            "default": "inline"
          },
          "outputFormats": {
            "title": "Output formats",
            "type": "array",
            "description": "Markdown is always the main output. Add plain text and/or the cleaned HTML.",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "text",
                "html"
              ],
              "enumTitles": [
                "Markdown",
                "Plain text",
                "Cleaned HTML"
              ]
            },
            "default": [
              "markdown"
            ]
          },
          "extractionMode": {
            "title": "Extraction",
            "enum": [
              "article",
              "full"
            ],
            "type": "string",
            "description": "<b>Main content</b>: readability-style article extraction that drops menus, footers, cookie banners and ads. <b>Full page</b>: the whole body minus navigation and boilerplate.",
            "default": "article"
          },
          "includeImages": {
            "title": "Keep images in Markdown",
            "type": "boolean",
            "description": "Keep ![alt](url) image references.",
            "default": true
          },
          "saveLinks": {
            "title": "Save page links",
            "type": "boolean",
            "description": "Add the list of absolute links found on each page.",
            "default": false
          },
          "includePdfs": {
            "title": "Convert PDFs",
            "type": "boolean",
            "description": "Extract text from PDF URLs (same price per document). Off: PDFs get a free skipped status row.",
            "default": true
          },
          "maxPdfPages": {
            "title": "Max PDF pages",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Read at most this many pages of each PDF.",
            "default": 100
          },
          "minContentLength": {
            "title": "Minimum content length (characters)",
            "minimum": 0,
            "type": "integer",
            "description": "Pages with less text are returned as a free empty_content status row instead of a charged page (e.g. JavaScript-only apps, login walls).",
            "default": 100
          },
          "dedupeContent": {
            "title": "Skip duplicate content",
            "type": "boolean",
            "description": "Skip pages whose Markdown is identical to a page already saved in this run (free status row). URL and canonical-URL duplicates are always skipped.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max parallel requests",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Upper limit; it is lowered automatically for small memory sizes.",
            "default": 10
          },
          "urls": {
            "title": "URLs (plain list, for API use)",
            "type": "array",
            "description": "Same as URLs, as a plain string array.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}