Skip to main content
To answer questions about a library or a product, an LLM needs its docs as clean text. Prefetch can collect a docs site two ways:
  • Map, then batch scrape: list every URL for 1 credit, keep the ones you want, and scrape only those. Best when you want control.
  • Crawl: follow links from a start page and collect everything under it. Best when the site has no useful sitemap.
Cost: 1 credit for the map, plus 1 per page scraped. A 200-page docs site costs about 201 credits.

Option A: map, then batch scrape

Option B: crawl

One request collects everything under a path:
Read the pages from GET /crawl/{id} the same way as the batch above. If fewer pages come back than you expected, GET /crawl/{id}/errors says why.

Tips

  • only_main_content strips the docs site’s navigation and sidebar, so each file holds only the page.
  • Use exclude_selectors to drop on-page clutter such as version banners or “Was this helpful?” widgets.
  • Keep each page’s URL next to its text, so answers can cite their source.
  • To keep the copy fresh, put the same URLs in a monitor and re-scrape only the pages that change.

Prompt for your coding agent