diff --git a/sdks/go.mdx b/sdks/go.mdx index 179a4915..1185da26 100644 --- a/sdks/go.mdx +++ b/sdks/go.mdx @@ -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 @@ -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