API Reference
Authentication
All API requests require authentication. Databuddy supports two authentication methods: API keys for server-side integrations and session cookies for browser-based apps.
API Key Authentication
Use your API key in the x-api-key header:
curl -H "x-api-key: dbdy_your_api_key_here" \
https://api.databuddy.cc/v1/query/websitesAlternatively, use Bearer token format:
curl -H "Authorization: Bearer dbdy_your_api_key_here" \
https://api.databuddy.cc/v1/query/websitesGetting an API Key
API Key Scopes
Scopes control what actions an API key can perform:
Access Levels
API keys can have two access levels:
Global Access
Access all websites in your account or organization. Best for:
Website-Specific Access
Access only specified websites. Best for:
Session Cookie Authentication
Browser-based applications using the Databuddy dashboard session can authenticate automatically via cookies. This works when:
fetch('https://api.databuddy.cc/v1/query/websites', {
credentials: 'include'
})Choosing an Authentication Method
Authentication Errors
Example error response:
{
"success": false,
"error": "Authentication required",
"code": "AUTH_REQUIRED"
}Best Practices
How is this guide?