Installation
The official Go SDK is maintained in the Firecrawl monorepo at apps/go-sdk. To install the Firecrawl Go SDK, run:Requires Go 1.23 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 withoption.WithAPIKey(...)
Scraping a URL
To scrape a single URL, use theScrape method.
JSON Extraction
Extract structured JSON usingJsonOptions via the Scrape endpoint:
Crawling a Website
To crawl a website and wait for completion, useCrawl.
Start a Crawl
Start a job without waiting usingStartCrawl.
Checking Crawl Status
Check crawl progress withGetCrawlStatus.
Cancelling a Crawl
Cancel a running crawl withCancelCrawl.
Mapping a Website
Discover links on a site usingMap.
Searching the Web
Search with optional search settings usingSearch.
Batch Scraping
Scrape multiple URLs in parallel usingBatchScrape.
Agent
Run an AI-powered agent withAgent.
Usage & Metrics
Check concurrency and remaining credits:Browser
The Go SDK includes Browser Sandbox helpers.Create a Session
Execute Code
Scrape-Bound Interactive Session
Use a scrape job ID to run follow-up browser code in the same replayed context:Interact(...)runs code in the scrape-bound browser session (and initializes it on first use).StopInteractiveBrowser(...)explicitly stops the interactive session when you are done.
List & Close Sessions
Configuration
firecrawl.NewClient() accepts functional options:
Custom HTTP Client
You can pass a pre-configured*http.Client to control transport settings, proxy configuration, TLS settings, and more. When provided, the WithTimeout setting is ignored in favor of the client’s own configuration.
Context Support
All methods accept acontext.Context as the first argument for cancellation and deadline control:
Error Handling
The SDK uses typed errors under thefirecrawl package.
Retry Logic
The SDK automatically retries transient failures:- Retried: 408, 409, 5xx errors, and connection failures
- Not retried: 401, 429, and other 4xx errors
- Backoff: Exponential backoff with configurable factor
Pointer Helpers
The SDK provides convenience functions for optional pointer fields:Are you an AI agent that needs a Firecrawl API key? See firecrawl.dev/agent-onboarding/SKILL.md for automated onboarding instructions.

