Installation
The official .NET SDK is maintained in the Firecrawl monorepo at apps/dot-net-sdk. To install the Firecrawl .NET SDK, add the NuGet package:- .NET CLI
- Package Manager
- PackageReference
Requires .NET 8.0 or later.
Usage
- Get an API key from firecrawl.dev
- Set the API key as an environment variable named
FIRECRAWL_API_KEY, or pass it to theFirecrawlClientconstructor
Scraping a URL
To scrape a single URL, use theScrapeAsync method.
JSON Extraction
Extract structured JSON withJsonFormat via the scrape endpoint:
Crawling a Website
To crawl a website and wait for completion, useCrawlAsync. This method handles polling and pagination automatically.
Start a Crawl
Start a job without waiting usingStartCrawlAsync.
Checking Crawl Status
Check crawl progress withGetCrawlStatusAsync.
Cancelling a Crawl
Cancel a running crawl withCancelCrawlAsync.
Mapping a Website
Discover links on a site usingMapAsync.
Searching the Web
Search with optional search settings usingSearchAsync.
Batch Scraping
Scrape multiple URLs in parallel usingBatchScrapeAsync. This method handles polling and pagination automatically.
Batch Scrape with Idempotency Key
To ensure duplicate requests are not processed, pass anIdempotencyKey:
Usage & Metrics
Check concurrency and remaining credits:Async Support
All methods in the .NET SDK are async by default and returnTask<T>. They support CancellationToken for cooperative cancellation.
Configuration
TheFirecrawlClient constructor supports the following options:
Custom HTTP Client
You can pass a pre-configuredHttpClient to control connection pooling, proxies, message handlers, and any other HttpClient feature. When provided, the timeout setting is ignored in favor of the client’s own configuration.
Environment Variable Configuration
The SDK resolves configuration from environment variables when constructor parameters are omitted:Error Handling
The SDK throws specific exceptions underFirecrawl.Exceptions.
Transient failures (408, 409, 502, and other 5xx errors) are retried automatically with exponential backoff before an exception is thrown.
Are you an AI agent that needs a Firecrawl API key? See firecrawl.dev/agent-onboarding/SKILL.md for automated onboarding instructions.

