Skip to main content
The Go SDK requires Go 1.22 or later. Import the /v2 module path shown below. SDKs covers the API key and the defaults all SDKs share.

Install

In a new directory, create a module, then add the SDK. Skip go mod init if the project already has a go.mod.

Scrape a page

Save this as main.go and run go run main.go. It prints the page as Markdown, starting with # Example Domain.
main.go

Look up a brand

In main, replace the scrape request, error check, and print statement with this lookup. It prints the company name.

Notes

  • Optional fields take helpers, such as contextdev.Bool(true), contextdev.Int(0), and contextdev.String("US"); enum fields take plain strings.
  • Requests have no default timeout. Set one per attempt with option.WithRequestTimeout(120 * time.Second), or for the whole call with a context deadline. option.WithMaxRetries(0) turns off retries.
  • If a params struct has no field for an option you need, such as HighlightsParams, JsonParams, or ProductParams, your installed version predates it. Send the request with client.Post, as described in SDKs.