Appearance
Go SDK
Updated Feb 2026A community-maintained Go SDK for Firecrawl. Supports the v1 API with core scraping, crawling, and mapping functionality.
| Package | github.com/mendableai/firecrawl-go |
| API Versions | v1 |
| Maintained by | Community |
| Source | github.com/mendableai/firecrawl-go |
Community SDK
This SDK is community-maintained and only supports the v1 API. For v2 features like batch scrape, extract, agent, and browser sessions, use the Python SDK or Node.js SDK.
Installation
bash
go get github.com/mendableai/firecrawl-goInitialization
Create a FirecrawlApp instance with your API key:
go
package main
import (
"fmt"
firecrawl "github.com/mendableai/firecrawl-go"
)
func main() {
app, err := firecrawl.NewFirecrawlApp("fc-YOUR-API-KEY", "")
if err != nil {
panic(err)
}
fmt.Println("Firecrawl client initialized")
}Constructor parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your Firecrawl API key (format: fc-...) |
apiURL | string | No | Custom API URL (defaults to https://api.firecrawl.dev) |
Methods
ScrapeUrl()
Scrapes a single URL and returns the content. See Scrape feature docs for general parameter details.
Signature:
go
func (app *FirecrawlApp) ScrapeUrl(url string, params *ScrapeParams) (map[string]interface{}, error)Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The URL to scrape |
params | *ScrapeParams | No | Scrape configuration (formats, etc.) |
ScrapeParams fields:
| Field | Type | Description |
|---|---|---|
Formats | []string | Output formats: "markdown", "html" |
Example:
go
params := &firecrawl.ScrapeParams{
Formats: []string{"markdown", "html"},
}
data, err := app.ScrapeUrl("https://firecrawl.dev", params)
if err != nil {
panic(err)
}
fmt.Println(data["markdown"])Without parameters (defaults to markdown):
go
data, err := app.ScrapeUrl("https://firecrawl.dev", nil)
if err != nil {
panic(err)
}
fmt.Println(data)CrawlUrl()
Crawls a website starting from a URL. This is a blocking call that initiates the crawl and returns the results.
Signature:
go
func (app *FirecrawlApp) CrawlUrl(url string, params *CrawlParams, idempotencyKey ...string) (interface{}, error)Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Starting URL |
params | *CrawlParams | No | Crawl configuration |
idempotencyKey | string | No | Optional idempotency key to prevent duplicate jobs |
CrawlParams fields:
| Field | Type | Description |
|---|---|---|
ExcludePaths | []string | URL paths to exclude |
MaxDepth | int | Maximum crawl depth |
Limit | int | Maximum pages to crawl |
ScrapeOptions | *ScrapeParams | Options for scraping each page |
Example:
go
params := &firecrawl.CrawlParams{
ExcludePaths: []string{"/blog/*", "/admin/*"},
MaxDepth: 3,
Limit: 100,
ScrapeOptions: &firecrawl.ScrapeParams{
Formats: []string{"markdown"},
},
}
result, err := app.CrawlUrl("https://docs.firecrawl.dev", params)
if err != nil {
panic(err)
}
fmt.Println(result)With idempotency key:
go
import "github.com/google/uuid"
key := uuid.New().String()
result, err := app.CrawlUrl("https://docs.firecrawl.dev", params, key)CheckCrawlStatus()
Checks the status of an ongoing crawl job.
Signature:
go
func (app *FirecrawlApp) CheckCrawlStatus(crawlID string) (interface{}, error)Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
crawlID | string | Yes | Job ID from CrawlUrl() |
Example:
go
status, err := app.CheckCrawlStatus("<crawl-id>")
if err != nil {
panic(err)
}
fmt.Println(status)MapUrl()
Discovers all URLs on a website without scraping their content. See Map feature docs for general parameter details.
Signature:
go
func (app *FirecrawlApp) MapUrl(url string, params ...interface{}) ([]string, error)Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Target URL |
params | interface{} | No | Optional map configuration |
Example:
go
urls, err := app.MapUrl("https://firecrawl.dev")
if err != nil {
panic(err)
}
for _, u := range urls {
fmt.Println(u)
}Complete Example
Here is a full working example that scrapes a page, crawls a site, and maps URLs:
go
package main
import (
"fmt"
firecrawl "github.com/mendableai/firecrawl-go"
)
func main() {
// Initialize client
app, err := firecrawl.NewFirecrawlApp("fc-YOUR-API-KEY", "")
if err != nil {
panic(err)
}
// Scrape a single page
scrapeResult, err := app.ScrapeUrl("https://firecrawl.dev", &firecrawl.ScrapeParams{
Formats: []string{"markdown"},
})
if err != nil {
fmt.Println("Scrape error:", err)
} else {
fmt.Println("Scraped:", scrapeResult["markdown"])
}
// Crawl a site
crawlResult, err := app.CrawlUrl("https://docs.firecrawl.dev", &firecrawl.CrawlParams{
Limit: 5,
MaxDepth: 2,
})
if err != nil {
fmt.Println("Crawl error:", err)
} else {
fmt.Println("Crawled:", crawlResult)
}
// Map site URLs
urls, err := app.MapUrl("https://firecrawl.dev")
if err != nil {
fmt.Println("Map error:", err)
} else {
fmt.Printf("Found %d URLs\n", len(urls))
}
}Error Handling
The SDK returns Go-standard error values. All methods return an error as the second return value:
go
data, err := app.ScrapeUrl("https://example.com", nil)
if err != nil {
// Handle error: invalid API key, rate limit, network issue, etc.
fmt.Println("Error:", err)
return
}Common error scenarios:
| Scenario | Cause |
|---|---|
| Invalid API key | Key is missing, expired, or malformed |
| Rate limit exceeded | Too many requests in a short period |
| URL not reachable | Target URL is down or blocked |
| Network error | Connection timeout or DNS failure |
Dependencies
The Go SDK uses the following dependency:
github.com/google/uuid-- for generating idempotency keys
Limitations
Since this is a community SDK targeting v1, the following v2 features are not available:
- Search
- Batch scrape
- Extract
- Agent
- Browser sessions
- WebSocket watcher
- Auto-pagination
For these features, use the Python SDK, Node.js SDK, or CLI.
Related Pages
- SDKs Overview -- Compare all available SDKs
- Python SDK -- Full-featured Python SDK
- Node.js SDK -- Full-featured Node.js SDK
- Rust SDK -- Community Rust SDK (also v1)
- Scrape -- Single-page extraction details
- Crawl -- Multi-page crawling details
- Map -- URL discovery details