# Crawl FastAPI Documentation to Markdown Chunks for RAG

**Use case:** 

Crawls documentation portals into clean Markdown datasets for AI engineers building RAG pipelines. Returns markdown, tokenCount, title, url, and embedding-ready chunks with headingPath and charCount while stripping navigation and ads. Change startUrls and includeUrlGlobs to target a different documentation portal or documentation section.

## Input

```json
{
  "startUrls": [
    {
      "url": "https://fastapi.tiangolo.com/tutorial/"
    }
  ],
  "maxCrawlDepth": 2,
  "maxCrawlPages": 30,
  "useSitemaps": false,
  "useLlmsTxt": false,
  "respectRobotsTxtFile": true,
  "crawlOnlyPagesChangedSince": "",
  "includeUrlGlobs": [
    "https://fastapi.tiangolo.com/tutorial/*"
  ],
  "excludeUrlGlobs": [],
  "includeUrlRegexps": [],
  "excludeUrlRegexps": [],
  "keepUrlFragments": false,
  "ignoreCanonicalUrl": false,
  "outputFormat": "markdown",
  "htmlTransformer": "auto",
  "includeImages": false,
  "chunkMarkdown": true,
  "chunkMaxChars": 1500,
  "chunkOverlapChars": 200,
  "keepElementsCssSelector": "",
  "removeElementsCssSelector": "",
  "parsePdfText": true,
  "clickElementsCssSelector": "",
  "takeScreenshots": false,
  "customHttpHeaders": [],
  "storeSkippedUrls": false
}
```

## Output

```json
{
  "url": {
    "label": "URL",
    "format": "text"
  },
  "title": {
    "label": "Title",
    "format": "text"
  },
  "depth": {
    "label": "Depth",
    "format": "number"
  },
  "wordCount": {
    "label": "Words",
    "format": "number"
  },
  "httpStatusCode": {
    "label": "Status",
    "format": "number"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Domain-Scoped Site Crawler for Markdown Datasets Actor is ready to run with the inputs already set for "Crawl FastAPI Documentation to Markdown Chunks for RAG". [Sign up or log in](https://console.apify.com/create-task-from-example/pKm1854Z5FPewfxwv) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Crawl FastAPI Documentation to Markdown Chunks for RAG" task

The Domain-Scoped Site Crawler for Markdown Datasets Actor will start running based on the input automatically. You can also change all the input fields, like start urls, max crawl depth, and more, to match your specific use case.

### 3. Receive the "Crawl FastAPI Documentation to Markdown Chunks for RAG" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as URL, title, depth, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Crawl FastAPI Documentation to Markdown Chunks for RAG" task via API](https://apify.com/vexaloom-labs/domain-scoped-site-crawler-for-markdown-datasets.md).

## FAQ

### How do I crawl FastAPI documentation to Markdown for RAG?

The FastAPI docs crawl task starts at the tutorial and follows matching tutorial pages up to 2 links deep, with a limit of 30 pages.

### What does the FastAPI tutorial crawl return for RAG?

Each page in the FastAPI docs crawl task can include Markdown, an approximate token count, and heading-aware chunks with heading paths and character counts.

### How do I limit a FastAPI documentation crawl to the tutorial section?

The FastAPI docs crawl task is set to include URLs matching the FastAPI tutorial path; change the URL pattern to target another documentation section.

### How large are the Markdown chunks from the FastAPI tutorial?

Chunks in the FastAPI docs crawl task target 1500 characters with about 200 characters of overlap; code blocks and tables stay whole even when larger.

### How many FastAPI documentation pages can one run return?

The FastAPI docs crawl task is limited to 30 pages; its crawl stops when the configured page limit is reached.

### Can I schedule or run the FastAPI tutorial crawl through an API?

You can schedule the FastAPI docs crawl task or run it through the Apify API and integrations such as Zapier, Make, and n8n.

## About this Actor

This example demonstrates how to use [Domain-Scoped Site Crawler for Markdown Datasets](https://apify.com/vexaloom-labs/domain-scoped-site-crawler-for-markdown-datasets.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/vexaloom-labs/domain-scoped-site-crawler-for-markdown-datasets.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/vexaloom-labs/domain-scoped-site-crawler-for-markdown-datasets.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
