DOCS TO RAG · SITEMAP + BATCH

Crawl Public Developer Docs Into Clean RAG Markdown & JSON Schema Using /v1/sitemap + /v1/batch

Target Query: crawl documentation site to rag markdown json api · Category: Use Case Guide · Verified Rate: $0.015/hit ($0 on miss) · Updated: 2026-12-02

Direct Answer: Building a grounded RAG index over public developer documentation usually means cobbling together sitemap XML parsers, regex link filters, HTML boilerplating strippers, and retry logic. Scrape-Anything turns docs ingestion into two deterministic API calls: `POST /v1/sitemap` discovers and regex-filters every canonical doc URL from `robots.txt` / `<sitemapindex>`, and `POST /v1/batch` extracts structured titles, headings, links, JSON-LD, and clean Markdown under a hard `max_cost_micros` cap.

Engineering Mechanics & Deterministic Guardrails

Two-Step Documentation Ingestion Pipeline Economics (100 Doc Pages)

Pipeline StageEndpoint UsedInitial Full SyncWeekly Refresh (90% Unchanged)
Discover & Filter Routes`POST /v1/sitemap`$0.010 (1 call)$0.0010 (same-tenant cache) or $0.010 live
Extract 100 Doc Pages`POST /v1/batch`$1.20 (100 x $0.012 batch rate)$0.228 (90 cached @ $0.0012 + 10 new @ $0.012)
Soft-404 / Broken LinksAnti-fake-200 + Schema Gate$0.00 (automatically isolated)$0.00 (never poisons RAG index)
Audit Provenance`receipt_sha256` per docInstant diff check via SHA-256Re-embed only changed digests
Pure-Stream Multi-Format Latency vs Headless Browser Stacks (Relative Overhead) Headless Chrome Pool + Residential Proxy 3,200-8,500 ms LLM Markdown-to-JSON Two-Pass Pipeline 1,800-4,500 ms Scrape-Anything PDF FlateDecode Stream 15-120 ms Scrape-Anything Complex HTML Table Grid 10-90 ms Scrape-Anything __NEXT_DATA__ / JSON-LD 8-60 ms Scrape-Anything Binary .xlsx / CSV Gate 5-50 ms SQLite WAL Verified Archive Cache Hit < 5 ms

RAG Documentation Page JSON Schema

{
  "type": "object",
  "required": [
    "title",
    "headings"
  ],
  "properties": {
    "title": {
      "type": "string",
      "minLength": 3
    },
    "headings": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    }
  }
}

Any extracted payload violating required keys, types, bounds, or regex patterns returns schema_valid: false, exact validation_errors, and billed_micros: 0.

Executable REST, Remote /mcp & treg hub Snippets

# Step 1: Discover /3/library/ pages from docs.python.org
curl -fsSL -X POST "https://scrape.fastmesh.dev/v1/sitemap" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://docs.python.org/robots.txt","include_pattern":"/3/library/","max_urls":20}'

# Step 2: Batch extract clean Markdown + headings with a $0.30 hard cap
curl -fsSL -X POST "https://scrape.fastmesh.dev/v1/batch" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"url":"https://docs.python.org/3/library/json.html"}],"max_cost_micros":30000}'

Hard guarantee: fake-200 CAPTCHA/Turnstile shells, login walls, encrypted PDFs, empty results, schema mismatches, and SSRF HTTP 422 blocks always return billed_micros: 0.

Test Schema-Validated Extraction Live in 5 Seconds

Paste any public URL, HTML table, JSON-LD, CSV, or fake-200 shell at scrape.fastmesh.dev or top up once with never-expiring Creem prepaid credits ($15 Starter / $59 Growth / $199 Scale — $0/mo recurring).

Frequently Asked Questions

How does `receipt_sha256` save vector embedding costs during weekly doc syncs?

Compare each page's `receipt_sha256` against your stored hash—skip chunking and re-embedding whenever the digest matches.

Does `/v1/sitemap` obey `robots.txt`?

Yes. `/v1/sitemap` parses `robots.txt` `Sitemap:` and `Disallow:` directives explicitly so your crawler stays transparent and compliant.

What if a documentation site uses Next.js or Docusaurus?

Both SSR frameworks work cleanly with `js_embedded` extraction, returning structured titles, headings, links, and clean Markdown without headless Chrome.

Related Structured Extraction Guides

Explore all 32 Scrape-Anything Technical Guides or inspect the machine-readable llms.txt index.