Crawl a documentation section with Firecrawl

Run a small Firecrawl job limited to a documentation path, then check the URLs and Markdown before scaling up.

Updated

Goal: a small, verifiable corpus

This guide uses Firecrawl’s REST API to collect up to ten documentation pages. You need authorized API access, an HTTP client and public documentation you are allowed to process. Collection may consume credits. Do not use confidential customer pages or put an API key in a shared document.

1. Define the scope first

Identify a real starting URL and three pages you expect to find. For a /docs path, ^/docs(/|$) matches /docs and its descendants but not /docs-other. Here the filter applies to the path, not the full address. The starting URL must also match.

2. Submit one limited request

Send a POST to https://api.firecrawl.dev/v2/crawl with Bearer authentication configured in your client and the body below. Replace the fictional address with your authorized documentation. Keep the key in a secret field. This is a teaching configuration, not an executed crawl.

{
  "url": "https://example.com/docs",
  "includePaths": [
    "^/docs(/|$)"
  ],
  "regexOnFullURL": false,
  "limit": 10,
  "allowExternalLinks": false,
  "allowSubdomains": false,
  "ignoreRobotsTxt": false,
  "scrapeOptions": {
    "formats": [
      {
        "type": "markdown"
      }
    ],
    "onlyMainContent": true
  }
}

3. Follow the job without creating another

Keep the returned identifier. Use GET https://api.firecrawl.dev/v2/crawl/{id} to follow that same job. Receiving an identifier does not mean the pages are ready. Inspect status, data and errors; matching counters do not prove every discovered page succeeded. If next pagination remains, retrieve the result pages as documented rather than assuming the first response contains everything.

4. Validate the collected content

For each document, check its source URL and HTTP code in metadata. Error pages can appear in the data. Open the three expected pages and compare the heading, main paragraph and code example against their Markdown. Record missing pages and possible duplicates. Ten arbitrary documents do not constitute complete documentation.

Expected result and troubleshooting

You should have a small readable collection within the chosen scope, with traceable source URLs. If nothing returns, check the filter and starting address first. If the response reports a credit problem, check allowance and requested limit without automatically purchasing more. Respect access refusals from the website. Increase volume only after validating both content and cost.