Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions sdks/go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ go get github.com/firecrawl/firecrawl/apps/go-sdk
1. Get an API key from [firecrawl.dev](https://firecrawl.dev)
2. Set the API key as an environment variable named `FIRECRAWL_API_KEY`, or pass it with `option.WithAPIKey(...)`

Here is a quick example using the current SDK API surface:
Scrape a page and start a crawl in a few lines:

```go
package main
Expand All @@ -34,24 +34,16 @@ import (
"log"

firecrawl "github.com/firecrawl/firecrawl/apps/go-sdk"
"github.com/firecrawl/firecrawl/apps/go-sdk/option"
)

func main() {
// Create a client (reads FIRECRAWL_API_KEY from environment)
// Reads FIRECRAWL_API_KEY from the environment.
// To pass the key explicitly, see the Configuration section below.
client, err := firecrawl.NewClient()
if err != nil {
log.Fatal(err)
}

// Or provide the API key directly
client, err = firecrawl.NewClient(
option.WithAPIKey("fc-your-api-key"),
)
if err != nil {
log.Fatal(err)
}

ctx := context.Background()

// Scrape a single page
Expand Down