{
  "openapi": "3.0.1",
  "info": {
    "title": "URL to Markdown: Web Page to Markdown for LLMs & RAG",
    "description": "Convert URLs and web pages to clean Markdown or plain text for LLMs, RAG and AI agents. HTML to Markdown with main-content extraction (no menus, ads or footers), or keep the full page. Title, metadata, links and word count per page. Fast HTTP, no browser, robots.txt respected. $0.50 per 1,000 pages.",
    "version": "1.0",
    "x-build-id": "WxcEryZo9Vp1yetuh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fecklesspleb~url-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fecklesspleb-url-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/fecklesspleb~url-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-fecklesspleb-url-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/fecklesspleb~url-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-fecklesspleb-url-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": "URLs",
            "type": "array",
            "description": "Pages to convert, one dataset row per URL, as objects: [{\"url\": \"https://docs.python.org/3/tutorial/appetite.html\"}]. A URL without http(s):// gets https:// added and duplicates are removed. Links on the pages are not followed, and a sitemap URL put here is converted as a page (use sitemapUrls instead). Optional when sitemapUrls is given; with an empty input the default Python tutorial page is converted.",
            "default": [
              {
                "url": "https://docs.python.org/3/tutorial/index.html"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sitemapUrls": {
            "title": "Sitemap URLs",
            "type": "array",
            "description": "Optional XML sitemaps (for example https://example.com/sitemap.xml) whose pages you want converted. Sitemap index files are followed up to 3 levels deep, gzip (.xml.gz) and plain-text URL lists work too. robots.txt is checked for the sitemap host as for pages. Page URLs are taken in sitemap order, at most Max sitemap page URLs of them (default 100), and each converted page is charged like any other page, so one sitemap costs at most Max sitemap page URLs x the page price. Reading the sitemap itself is free. A sitemap that yields no page URL gives one free status row. If you give only sitemaps, the sample URL default in URLs is skipped.",
            "items": {
              "type": "string"
            }
          },
          "maxSitemapUrls": {
            "title": "Max sitemap page URLs",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Most page URLs taken from all sitemapUrls together in one run, 1 to 10,000. Default 100, so a sitemap run costs at most 100 x $0.0005 = $0.05 in page events. If maxResults is above 0, the lower of the two applies. Has no effect on urls.",
            "default": 100
          },
          "contentMode": {
            "title": "Content",
            "enum": [
              "main",
              "page",
              "full"
            ],
            "type": "string",
            "description": "\"main\" (default): main content only, boilerplate removed with trafilatura, falling back to the whole page if nothing is found. \"page\": whole page without nav, header and footer. \"full\": whole page including navigation.",
            "default": "main"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "\"markdown\" (default) puts the content in the markdown field, keeping headings, lists, tables and links. \"text\" puts plain text in the text field instead.",
            "default": "markdown"
          },
          "includeLinks": {
            "title": "Keep links",
            "type": "boolean",
            "description": "If true (default), hyperlinks are kept as absolute Markdown links in main-content mode. Set false for shorter text.",
            "default": true
          },
          "maxCharsPerPage": {
            "title": "Max characters per page",
            "minimum": 0,
            "type": "integer",
            "description": "Cut the markdown or text of each page to this many characters, e.g. 4000 to fit an LLM context window; truncated is then true. Default 0 = no limit.",
            "default": 0
          },
          "includeRawHtml": {
            "title": "Include raw HTML",
            "type": "boolean",
            "description": "If true, each row also gets html with the original page source. Default false; it makes rows much larger.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Pages fetched in parallel, 1 to 30. Default 10. Requests to the same host are spaced at least 0.5 s apart, longer if robots.txt sets a crawl delay.",
            "default": 10
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many converted (charged) pages. Default 0 = no cap. Free rows for failed pages do not count. Sitemap page URLs are always capped by maxSitemapUrls; if this is above 0, the lower of the two applies.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}