Skip to main content

Connecting to the API

Connecting to BrowserBee successfully comes down to four things:

  1. the correct base URL
  2. a valid token
  3. the right headers
  4. one low-risk request to prove connectivity

Required pieces

At minimum, most BrowserBee requests need:

  • a base URL
  • an Authorization: Bearer header
  • an Accept: application/json header

Example

curl --silent \
--request GET \
--header "Authorization: Bearer ${BROWSERBEE_API_TOKEN}" \
--header "Accept: application/json" \
"${BROWSERBEE_BASE_URL}/browsers"

Environment configuration

Prefer passing BrowserBee configuration through environment variables:

export BROWSERBEE_BASE_URL="https://api.browserbee.com/api/v1"
export BROWSERBEE_API_TOKEN="<YOUR_TOKEN>"

This keeps your request code portable between local development, CI, and deployed services.

First-connection validation checklist

Before moving deeper into implementation, confirm:

  • DNS and network routing to BrowserBee work from the environment you are using
  • the token is valid in the targeted environment
  • the response body is valid JSON
  • your logs capture enough information to debug a failed request

Common connection failures

  • using a development token with the production base URL
  • forgetting the Bearer prefix
  • missing headers in a custom client wrapper
  • copying a token with whitespace or truncation
  • pointing at the wrong environment in CI

Next steps