Go uses the
/v2 module path, github.com/context-dot-dev/context-go-sdk/v2. The unversioned path is the older v1 SDK, which lacks the current Scrape, Map URLs, and Brand methods.
Set your API key
Every SDK readsCONTEXT_DEV_API_KEY when you don’t pass a key to the client:
Timeouts and retries
- TypeScript, Python, Ruby, and PHP wait up to 60 seconds for each attempt. Go has no default request timeout (its default HTTP client waits up to 10 minutes for response headers).
- All five SDKs retry twice, with exponential backoff, after connection errors and
408,409,429, or5xxresponses.
timeoutOpts.milliseconds can be up to 300,000. For Scrape, Crawl (80,000 ms default budget), or any request with a deadline above 60,000 ms, raise the SDK timeout above that deadline. Otherwise the SDK gives up and retries while the first attempt may still be running: only Scrape and Parse stop when the client disconnects. Each language page shows how to change both settings, and Timeouts covers server deadlines.
Use the low-level request method
SDKs are generated from the API spec and released separately, so an installed version can lag the API. If a typed method doesn’t accept a field you need, send the request with the SDK’s low-level method. It keeps the SDK’s authentication, retries, and error handling.
Check the request body against the API reference before you send it.
Billing errors
402 USAGE_EXCEEDED means the authenticated account cannot cover the operation’s credit cost. Inspect error_data for the balance, required credits, retry condition, and available refill details. Save request_id when investigating a failed request. Use the free usage endpoint or MCP get-usage to inspect the account, and retry once the balance covers the operation. Token refresh and reconnection do not restore credits.
401 means authentication failed. 403 PAID_PLAN_REQUIRED identifies a feature entitlement, and 429 RATE_LIMITED identifies temporary throttling. For concurrency limits, inspect error_data and follow Retry-After before retrying. See billing and concurrency errors for response fields and recovery options.