API Authentication
All API requests require a valid API key passed as a Bearer token in the Authorization header. API keys are scoped to your user account and can be created, rotated, and revoked from Settings.What It Is
API authentication uses Bearer token authentication with API keys. Each key is prefixed with sg_live_ (production) or sg_test_ (development) and grants access based on assigned scopes.
How It Works
- Create an API key in Settings > API Keys
- Copy the key immediately (it's only shown once)
- Add the Authorization header to every request:
- Never commit API keys to version control
- Use environment variables to store keys
- Rotate keys regularly
- Use minimum required scopes
- Revoke unused keys promptly
``
Authorization: Bearer sg_live_abc123def456...
`
Request Example
`bash
curl
curl -X GET "https://seogeo.tools/api/public/v1/me" \
-H "Authorization: Bearer sg_live_abc123def456"
`
`javascript
// JavaScript (fetch)
const response = await fetch("https://seogeo.tools/api/public/v1/me", {
headers: {
"Authorization": "Bearer sg_live_abc123def456"
}
});
const data = await response.json();
`
`python
Python (requests)
import requests
response = requests.get(
"https://seogeo.tools/api/public/v1/me",
headers={"Authorization": "Bearer sg_live_abc123def456"}
)
data = response.json()
`
Response Example
`json
{
"data": {
"userId": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"plan": "pro",
"apiKeyPrefix": "sg_live_"
},
"meta": {
"requestId": "req_abc123"
}
}
``
API Key Scopes
Keys can be limited to specific operations:
| Scope | Permissions |
|---|---|
| projects:read | List and view projects |
| projects:write | Create projects |
| audits:read | List audits and pages |
| audits:write | Start new audits |
| content:read | List content drafts |
| content:write | Create content briefs |
| reports:read | List report snapshots |
| geo:read | View GEO monitor data |
| geo:write | Start GEO tests |
API Key Limits by Plan
| Plan | Max Active Keys |
|---|---|
| Starter | 2 |
| Pro | 10 |
| Agency | 50 |
Common Errors
| Error Code | Meaning |
|---|---|
| UNAUTHORIZED | Missing or invalid API key |
| FORBIDDEN | API key lacks required scope |