{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Page to Markdown: Clean Text for LLMs & RAG",
    "description": "Turn web pages into clean Markdown and text for LLMs, RAG and search, from a list of links, sitemaps or a same-site crawl. Main content only, optional token chunks, changed-pages-only monitoring. Plain HTTP, robots.txt respected.",
    "version": "0.1",
    "x-build-id": "wRIAMADe43JMl9kEc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/subtleasianmerch~web-page-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-subtleasianmerch-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/subtleasianmerch~web-page-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-subtleasianmerch-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/subtleasianmerch~web-page-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-subtleasianmerch-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",
        "properties": {
          "urls": {
            "title": "Pages",
            "type": "array",
            "description": "Links to the pages to convert, one per line, e.g. https://en.wikipedia.org/wiki/Markdown. \"example.com/page\" works too (https is added). Each page is converted on its own; its links aren't followed. Up to 10,000 per run.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Crawl from these pages",
            "type": "array",
            "description": "Optional. Start pages for a crawl of the same site: their links are followed within the site (www and non-www count as one), nearest pages first, up to the page limit and link depth below. Each site's robots.txt is respected.",
            "items": {
              "type": "string"
            }
          },
          "sitemapUrls": {
            "title": "Sitemaps",
            "type": "array",
            "description": "Optional. Sitemaps whose pages are converted, e.g. https://example.com/sitemap.xml. XML, .xml.gz, text sitemaps and sitemap indexes work. Only pages on the sitemap's own site are taken; their links aren't followed.",
            "items": {
              "type": "string"
            }
          },
          "maxPages": {
            "title": "Maximum pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "At most this many pages are read per run (pages delivered, and with monitoring also unchanged ones). Error pages, redirects and blocked addresses don't count. Up to 10,000.",
            "default": 100
          },
          "maxDepth": {
            "title": "Link depth",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Optional, for crawls. How many clicks from the start page to follow: 0 converts only the start pages, 1 adds the pages they link to, and so on. Empty: no limit (the page limit still applies)."
          },
          "includePatterns": {
            "title": "Only addresses matching",
            "type": "array",
            "description": "Optional. Only crawl or take from sitemaps the addresses that match one of these. * stands for any characters: /docs/* matches https://example.com/docs/anything; https://example.com/blog/* must match from the start. A pattern without * matches addresses that contain it. The pages you list under Pages are always converted.",
            "items": {
              "type": "string"
            }
          },
          "excludePatterns": {
            "title": "Skip addresses matching",
            "type": "array",
            "description": "Optional. Don't crawl or take from sitemaps the addresses that match one of these (same rules as above), e.g. /tag/* or ?sort=.",
            "items": {
              "type": "string"
            }
          },
          "includeSubdomains": {
            "title": "Include subdomains",
            "type": "boolean",
            "description": "Also crawl subdomains of the start page's site, e.g. docs.example.com and blog.example.com for example.com. Each subdomain's own robots.txt is respected.",
            "default": false
          },
          "removeTrackingParams": {
            "title": "Ignore tracking parameters",
            "type": "boolean",
            "description": "Treat /page?utm_source=x (and gclid, fbclid and similar) as /page, so one page isn't converted twice. Other parameters are kept as they are.",
            "default": true
          },
          "contentMode": {
            "title": "Content",
            "enum": [
              "article",
              "fullPage"
            ],
            "type": "string",
            "description": "Main content: the article or main text, found with Mozilla's Readability (the engine of Firefox Reader View); pages that aren't a clear article fall back to the whole page. Whole page: everything except navigation, header, footer, sidebars, cookie banners and ads. Cookie banners and ads are removed in both.",
            "default": "article"
          },
          "keepSelectors": {
            "title": "Keep only these elements",
            "type": "array",
            "description": "Optional CSS selectors, e.g. article or .post-body. When set, only the matching elements are converted (in page order) and the content option above is ignored.",
            "items": {
              "type": "string"
            }
          },
          "removeSelectors": {
            "title": "Remove these elements",
            "type": "array",
            "description": "Optional CSS selectors of elements to drop before converting, e.g. .newsletter-signup or #comments.",
            "items": {
              "type": "string"
            }
          },
          "keepLinks": {
            "title": "Keep links",
            "type": "boolean",
            "description": "Links as [text](address), with absolute addresses. Off: only the link text. Links to a spot on the same page always keep only their text.",
            "default": true
          },
          "keepImages": {
            "title": "Keep image references",
            "type": "boolean",
            "description": "Images as ![alt text](address). Off: images are left out. Tracking pixels and inline data images are always left out.",
            "default": true
          },
          "keepTables": {
            "title": "Keep tables",
            "type": "boolean",
            "description": "Tables as Markdown tables (merged cells become empty cells, a table inside a cell becomes text). Off: tables are left out.",
            "default": true
          },
          "keepHeadings": {
            "title": "Keep headings",
            "type": "boolean",
            "description": "Headings as #, ## and so on. Off: headings become ordinary paragraphs.",
            "default": true
          },
          "keepLists": {
            "title": "Keep lists",
            "type": "boolean",
            "description": "Lists as - item and 1. item. Off: each item becomes a line of text.",
            "default": true
          },
          "keepCodeBlocks": {
            "title": "Keep code blocks",
            "type": "boolean",
            "description": "Code as fenced blocks, with the language when the page names it. Off: code becomes plain text.",
            "default": true
          },
          "includeText": {
            "title": "Plain text too",
            "type": "boolean",
            "description": "Also give each page as plain text (paragraphs on their own lines, table cells separated by tabs).",
            "default": true
          },
          "includeLinkList": {
            "title": "List of links on the page",
            "type": "boolean",
            "description": "Give every link found on the page (absolute, once each, up to 1,000). The link count is always given.",
            "default": true
          },
          "minWords": {
            "title": "Minimum words",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Pages with fewer words of content are listed free as \"no-content\" instead of delivered, e.g. pages built with JavaScript in the browser, which show almost nothing to plain HTTP.",
            "default": 20
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 50,
            "maximum": 8000,
            "type": "integer",
            "description": "Optional, for RAG. Split each page's Markdown into chunks of about this many tokens (about 4 characters per token in English), on paragraph, list, table and code block boundaries. Each chunk carries the headings it sits under. Empty: no chunks."
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "With chunks: each chunk starts with about this many tokens from the end of the previous one, at a sentence where possible. At most half the chunk size.",
            "default": 50
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Give scheduled runs the same ID (letters, digits and dashes) to get only pages whose content changed since the last run. Pages are compared by their converted Markdown, so ads, dates and other page furniture don't count as changes. Unchanged pages are free. Leave empty for one-off runs."
          },
          "onlyChanged": {
            "title": "Only new and changed pages",
            "type": "boolean",
            "description": "With a monitor ID: deliver only new and changed pages (and pages that went missing, free). Off: deliver every page each time, with changeStatus marking what changed; then every delivered page is charged.",
            "default": true
          },
          "delayMs": {
            "title": "Pause between requests",
            "minimum": 100,
            "maximum": 60000,
            "type": "integer",
            "description": "Requests to one site go one at a time, with at least this pause after each answer. If the site's robots.txt asks for a longer Crawl-delay, that is used instead. Up to 6 sites are read side by side.",
            "default": 250
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}