Authentication
Send your key in the X-API-Key header. Create one key per environment, rotate with an overlap and revoke what you no longer use.
Every API request is authenticated with an API key that belongs to a workspace.
Send the key
Put the key in the X-API-Key request header:
curl "https://api.buddygeo.com/v1/reverse?lat=43.6426&lon=-79.3871" \
-H "X-API-Key: YOUR_API_KEY"Keep keys out of query strings and out of code that ships to browsers or mobile apps: anyone who can read the key can spend your credits. Call BuddyGeo from your server and store the key in your secret manager or environment.
# 200: authenticated lookup with an active key
curl "https://api.buddygeo.com/v1/reverse?lat=43.6426&lon=-79.3871" \
-H "X-API-Key: YOUR_API_KEY"
# 401 missing_api_key: no header
curl -i "https://api.buddygeo.com/v1/reverse?lat=43.6426&lon=-79.3871"
# 401 invalid_api_key: not a recognized BuddyGeo key
curl -i "https://api.buddygeo.com/v1/reverse?lat=43.6426&lon=-79.3871" \
-H "X-API-Key: not-a-key"Manage keys
Keys live under API keys in the dashboard.
- Create a key with a label and an environment tag such as
productionordevelopment. The secret is revealed once; after that only the masked form (bg_live_7f3a…c91d) is shown. - One allowance, many keys. All keys of a workspace share the same monthly credits and the same requests-per-second limit. Separate keys buy you separate labels in Usage and Request logs, and the ability to replace one without touching the others.
- Owners and admins can create, rotate, rename and revoke keys. Members can see the list and which key made a request, but cannot change keys.
Key states
| State | Meaning | Requests with this key |
|---|---|---|
active | Normal working key | Accepted |
expiring | Rotated, still inside its overlap period | Accepted until the overlap ends |
rotated | Rotated and the overlap has ended | 401 revoked_api_key |
revoked | Revoked by an owner or admin | 401 revoked_api_key |
Rotate without downtime
Rotating a key issues a replacement and keeps the old key working for an overlap you choose, from 0 to 168 hours (7 days).
- Open API keys, choose Rotate key on the key and pick the overlap.
- Copy the new secret. It is shown once.
- Deploy the new secret. During the overlap both keys are accepted, and the old one is marked
expiring. - When the overlap ends, the old key becomes
rotatedand its requests fail with401.
To cut a key off immediately, for example after a leak, revoke it instead. The next request with a revoked key fails with 401:
{
"request_id": "req_kjsvrb9pvtvv",
"status": 401,
"error": {
"code": "revoked_api_key",
"message": "This API key was revoked and can no longer be used.",
"next_step": "Switch to an active key, or create a replacement under API keys in the dashboard."
}
}To verify revocation immediately, revoke a test key under API keys and send a lookup with it: the gateway refuses the request with 401 and records it in Request logs.
Authentication errors
All three are 401 responses with the error body shown above. They are never charged, and requests made with a known but unusable key are recorded in the request log with the outcome unauthorized. Passing API keys in URL query strings (such as ?api_key=...) is always rejected with 401.
error.code | Cause | Fix |
|---|---|---|
missing_api_key | No X-API-Key header was sent | Add the header |
invalid_api_key | The key is not recognized | Check for missing characters or stray whitespace |
revoked_api_key | The key was revoked, or rotated and past its overlap | Switch to the active or replacement key |
Open in the app
API keys
Create, rotate and revoke keys for the active workspace.
Request logs filtered to rejected keys
See which requests were refused and which key sent them.
Interactive API reference
Inspect every endpoint schema and test requests with your own API key.
Related guides
Quickstart
Create a key, turn an address into coordinates with your first search, look up the address for a coordinate, and find both requests and their credits in your dashboard.
Rate limits and errors
Every error code the API returns, its HTTP status, whether it was charged and what to do next. Includes the throughput limit and how to retry.
Credits and billing
One successful lookup or matched spreadsheet row costs one credit. Everything else is free. How allowances, bulk reservations and plan changes work.
Troubleshooting
Fix the problems that come up most often - 401 after a rotation, 429 bursts, swapped coordinates, no match over water - and collect what support needs.
Quickstart
Create a key, turn an address into coordinates with your first search, look up the address for a coordinate, and find both requests and their credits in your dashboard.
Forward geocoding
GET /v1/search turns an address or place name into coordinates and returns every plausible candidate when a query is ambiguous.