API Key Authentication
All API requests must include your API key in the api_key header.
Getting your API Key
- Sign up or log in at app.dataforb2b.ai
- Navigate to Settings > API Keys
- Click Generate new key
- Copy and securely store your API key
Your API key grants access to your account and credits. Keep it secure and never share it publicly or commit it to version control.
Example Request
curl -X POST https://api.dataforb2b.ai/search/people \
-H "api_key: sk_live_abc123..." \
-H "Content-Type: application/json" \
-d '{"count": 10}'
import requests
headers = {
"api_key": "sk_live_abc123...",
"Content-Type": "application/json"
}
response = requests.post(
"https://api.dataforb2b.ai/search/people",
headers=headers,
json={"count": 10}
)
const headers = {
'api_key': 'sk_live_abc123...',
'Content-Type': 'application/json'
};
const response = await fetch('https://api.dataforb2b.ai/search/people', {
method: 'POST',
headers,
body: JSON.stringify({ count: 10 })
});
Authentication Errors
| Status Code | Error | Description |
|---|
| 401 | unauthorized | Missing or invalid API key |
| 403 | forbidden | API key doesn’t have permission for this resource |