Connecting to the API
Connecting to BrowserBee successfully comes down to four things:
- the correct base URL
- a valid token
- the right headers
- one low-risk request to prove connectivity
Required pieces
At minimum, most BrowserBee requests need:
- a base URL
- an
Authorization: Bearerheader - an
Accept: application/jsonheader
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
Bearerprefix - missing headers in a custom client wrapper
- copying a token with whitespace or truncation
- pointing at the wrong environment in CI
Next steps
- Review API limits.
- Review Errors.