{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Page to Markdown for LLM & RAG (No Browser)",
    "description": "Turn web page URLs into clean Markdown of the main content, with title, language, word and token counts and optional heading-aware RAG chunks. Plain HTTP, no browser: fast and cheap. Respects robots.txt. You pay only for pages that were read.",
    "version": "0.1",
    "x-build-id": "qF8VsTJkYtgCKCJAf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/far003~web-page-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-far003-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/far003~web-page-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-far003-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/far003~web-page-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-far003-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": "Page URLs",
            "type": "array",
            "description": "Addresses (http or https) of the pages to convert. One record per address. Fragments (#...) are ignored; a repeated address is reported once as \"duplicate\". Addresses that are not usable web addresses, or that point to private/local networks, get an \"invalid\" record (free), not a run error. Credentials written inside a URL are removed and never used.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Or: read addresses from a dataset",
            "type": "string",
            "description": "ID or name of a dataset of another run (a crawler, a sitemap reader...). Its addresses are added to the list above. Leave empty to use only the list."
          },
          "datasetUrlField": {
            "title": "Field with the address in that dataset",
            "type": "string",
            "description": "Name of the field that holds the page address in each item of the dataset. A dotted path such as \"page.url\" works.",
            "default": "url"
          },
          "selector": {
            "title": "CSS selector of the content (optional)",
            "type": "string",
            "description": "Convert only this part of the page, for example \"article\" or \"#content\". Empty: the main content is found automatically. If the selector matches nothing on a page, the automatic way is used for that page and a warning is added."
          },
          "removeSelectors": {
            "title": "CSS selectors to remove first (optional)",
            "type": "array",
            "description": "Parts to cut out before the content is read, for example a cookie banner (\".cookie-banner\") or a related-posts block (\".related\").",
            "items": {
              "type": "string"
            }
          },
          "includeLinks": {
            "title": "Keep links",
            "type": "boolean",
            "description": "Write links as Markdown links with absolute addresses. Off: only the link text.",
            "default": true
          },
          "includeImages": {
            "title": "Keep images",
            "type": "boolean",
            "description": "Write images as Markdown images (alt text and absolute address). Off by default: for LLM input the pictures are usually noise.",
            "default": false
          },
          "includeTables": {
            "title": "Keep tables",
            "type": "boolean",
            "description": "Write data tables as Markdown (GFM) tables. Off: tables are left out.",
            "default": true
          },
          "removeReferences": {
            "title": "Drop references and footnote sections",
            "type": "boolean",
            "description": "On Wikipedia-style pages, leave out the reference lists, notes, bibliography, further-reading and external-links sections (footnote markers like [1] are always dropped). Saves a large share of the tokens of an encyclopedia page. Infoboxes and navigation boxes are always left out.",
            "default": true
          },
          "outputLinks": {
            "title": "Also list the links as data",
            "type": "boolean",
            "description": "Add a \"links\" array (text and absolute address, each address once, at most 1000) to every record, for a crawl that goes on from the links of the content.",
            "default": false
          },
          "chunkTokens": {
            "title": "RAG chunk size (estimated tokens, 0 = no chunks)",
            "minimum": 0,
            "maximum": 8000,
            "type": "integer",
            "description": "When above 0, every record gets a \"chunks\" array: pieces of about this many tokens, cut at paragraph, list, table and code-block edges, never in the middle of a code block or a table that fits. A heading starts a new chunk once the current one is at least half full, and each chunk lists the headings it sits under. Tokens are estimated (about 4 characters per token; one per CJK character), not counted with a tokenizer.",
            "default": 0
          },
          "chunkOverlapTokens": {
            "title": "Chunk overlap (estimated tokens)",
            "minimum": 0,
            "maximum": 4000,
            "type": "integer",
            "description": "The end of a full chunk is repeated at the start of the next one, up to this many tokens (never across a heading change). At most half of the chunk size.",
            "default": 0
          },
          "maxPages": {
            "title": "Maximum pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Pages read in this run. Addresses beyond the limit are not fetched; the SUMMARY says how many. A safety net for long lists.",
            "default": 1000
          },
          "minWords": {
            "title": "Minimum words of content",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "A page whose main content has fewer words is reported as \"empty\" (free). Raise it to skip thin pages, lower it for short notices.",
            "default": 10
          },
          "maxPageMegabytes": {
            "title": "Maximum page size (MB)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Pages bigger than this are not read (status \"too_large\", free). Checked while the page downloads.",
            "default": 5
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Read the robots.txt of every site before the first request there and skip what it forbids to this bot (status \"robots_disallowed\", free). The Crawl-delay is honoured up to 10 seconds. Switch off only for sites you own or have permission to read.",
            "default": true
          },
          "requestsPerSecond": {
            "title": "Requests per second, per site",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "Spacing between two requests to the same site (1 or 2 per second). Different sites are read in parallel.",
            "default": 2
          },
          "maxConcurrency": {
            "title": "Pages in parallel",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many pages are read at the same time, across all sites.",
            "default": 5
          },
          "timeoutSecs": {
            "title": "Timeout per page (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Longest wait for the answer of the site, and the longest silence while the page downloads.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}