{
  "openapi": "3.0.1",
  "info": {
    "title": "RAG Web Crawler: Clean Markdown + Token-Sized Chunks",
    "description": "Turn any website into embeddings-ready chunks for RAG and vector databases. Structure-aware token-sized chunking, clean LLM-ready markdown, per-chunk citations and metadata, dedup, and junk filtering. Pay per result, no surprise compute bills.",
    "version": "1.1",
    "x-build-id": "cqhSZTFeSPfHr8CBl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/commonelements~rag-ready-crawler/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-commonelements-rag-ready-crawler",
        "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/commonelements~rag-ready-crawler/runs": {
      "post": {
        "operationId": "runs-sync-commonelements-rag-ready-crawler",
        "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/commonelements~rag-ready-crawler/run-sync": {
      "post": {
        "operationId": "run-sync-commonelements-rag-ready-crawler",
        "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": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "One or more seed URLs to crawl.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "crawlScope": {
            "title": "Crawl scope",
            "enum": [
              "same-domain",
              "same-subdomain",
              "same-path",
              "start-urls-only"
            ],
            "type": "string",
            "description": "Which links to follow.",
            "default": "same-subdomain"
          },
          "maxCrawlDepth": {
            "title": "Max crawl depth",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Link hops from a start URL. 0 = only the start URLs.",
            "default": 3
          },
          "includeGlobs": {
            "title": "Include URL globs",
            "type": "array",
            "description": "Only crawl URLs matching these glob patterns, e.g. https://x.com/docs/**",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeGlobs": {
            "title": "Exclude URL globs",
            "type": "array",
            "description": "Skip URLs matching these globs, e.g. **/tag/**, **?print=1",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxPages": {
            "title": "Max pages (hard cap)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard ceiling on pages crawled. Protects against runaway crawls and runaway bills.",
            "default": 200
          },
          "renderJs": {
            "title": "Render JavaScript",
            "type": "boolean",
            "description": "Use a headless browser for JS-heavy/SPA sites. Off = fast static HTTP crawl (recommended default).",
            "default": false
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "chunks-jsonl",
              "markdown",
              "langchain",
              "jsonl-bulk"
            ],
            "type": "string",
            "description": "RAG chunks = one record per chunk (recommended). Markdown = one record per page. LangChain = {page_content, metadata} Document JSON per chunk. JSONL bulk = flat one-record-per-chunk for bulk import.",
            "default": "chunks-jsonl"
          },
          "enableChunking": {
            "title": "Enable chunking",
            "type": "boolean",
            "description": "Split each page into token-sized retrieval units. Forced ON when output format is RAG chunks.",
            "default": true
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 64,
            "maximum": 4096,
            "type": "integer",
            "description": "Target token budget per chunk (sized for your embedding model).",
            "default": 512
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 1024,
            "type": "integer",
            "description": "Token overlap between adjacent chunks (typically 10-20% of chunk size).",
            "default": 75
          },
          "dedupNearDuplicates": {
            "title": "Collapse near-duplicate chunks",
            "type": "boolean",
            "description": "Drop exact + near-duplicate chunks (shared boilerplate, syndicated content) via content hash + SimHash.",
            "default": true
          },
          "filterJunkChunks": {
            "title": "Filter junk chunks",
            "type": "boolean",
            "description": "Drop near-empty, nav-residue, and low-information chunks.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Proxy configuration for the crawl. Apify Proxy recommended for large or rate-limited sites.",
            "default": {
              "useApifyProxy": true
            }
          },
          "incremental": {
            "title": "Incremental sync (only new/changed pages)",
            "type": "boolean",
            "description": "When ON, pages whose content is unchanged since the last run are crawled but NOT re-emitted (not billed). Requires the actor to persist state in a named key-value store (see 'State store name').",
            "default": false
          },
          "forceFullCrawl": {
            "title": "Force full crawl (ignore prior state)",
            "type": "boolean",
            "description": "Override: emit every page this run even if incremental is ON, then overwrite the saved state. Use after changing chunking settings or to rebuild a stale index.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that persists per-URL content hashes between runs. Defaults to a deterministic name derived from the start URLs so scheduled re-runs of the same task share state automatically. Set explicitly to share state across tasks/schedules.",
            "default": ""
          },
          "emitDeletions": {
            "title": "Emit tombstones for deleted pages",
            "type": "boolean",
            "description": "When incremental is ON, emit a deletion record for each URL seen last run but missing this run, so downstream vector stores can purge stale vectors. Tombstones are NOT billed.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}