Map a documentation site and extract clean Markdown pages for RAG or coding agents
When you want to feed an external API doc site or changelog into Claude Code, Cursor, or a RAG index without writing a brittle HTML scraper, discover only the relevant paths with POST /v1/web/map, then batch-read those URLs in groups of up to 10 with POST /v1/web/read to save clean Markdown.
Prerequisites and cost scope
- Pricing:
POST /v1/web/mapcosts$0.001per returned URL (max100URLs per call; empty results cost$0).POST /v1/web/readcosts$0.002per successfully read URL (failedURLs cost$0). Mapping and reading 20 docs pages costs about$0.06total. See BeatAPI pricing. - Public URLs only: Both endpoints reject
localhost, private IPs, and embedded credentials with400 bad_request.
1. Map only the documentation paths you need
With BeatAPI MCP connected, hand the task straight to your agent:
Use
web_maponhttps://spec.openapis.orgwithselect_paths: ["/oas/.*"],max_depth: 2, andlimit: 20. Review the returned URLs, then callweb_readin batches of up to 10 (format: "markdown",max_chars: 20000) and save each page as a local.mdfile with its source URL. List anyfailedortruncated: truepages separately.
To run step 1 over HTTP:
If urls comes back empty, check the returned note—the page may build its links purely in client-side JavaScript or link only externally.
2. Batch-read selected URLs as Markdown
Split your shortlisted URLs into batches of 1–10 URLs and send each batch to POST https://api.beatapi.io/v1/web/read. Add query (up to 400 characters) when you only need passages about a specific topic, or omit query to keep the full page:
3. Handle failed[] and truncated: true cleanly
failed[]does not break the batch: Readable pages still return inresults[]. Log each failed URL with itsreason(blockedorunreachable); you are not charged for failed URLs.- Check
truncated: true: If a long specification is cut off at20,000characters, rerunPOST /v1/web/readfor that single URL with a highermax_chars(up to100,000) or pass a targetedquery.
4. Save the local Markdown pack
Example cost breakdown for mapping and reading 20 documentation pages (assuming 18 succeed and 2 are blocked):
Write one .md file per entry in results[] with frontmatter recording source_url, title, truncated, and request_id. Keep a manifest.json of any failed URLs so your RAG pipeline or coding agent knows exactly what was indexed and what was skipped.

