API Documentation
Comprehensive guides and API references for integrating AntiBait's email threat detection into your applications.
API Request Headers
Required headers for authenticating and formatting API requests to AntiBait.
Required Headers
| Header Name | Value | Description |
|---|---|---|
Content-Type | application/json | Specifies that the request body contains JSON data |
Authorization | Bearer {token} | Your API key for authentication and authorization |
Example Request with Headers
cURL Example
curl -X POST https://api.antibait.io/api/analysis/basic \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"email": "From: [email protected]..."
}'JavaScript (Fetch API)
fetch('https://api.antibait.io/api/analysis/basic', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
email: 'From: [email protected]...'
})
})
.then(response => response.json())
.then(data => console.log(data));Python (Requests)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
data = {
'email': 'From: [email protected]...'
}
response = requests.post(
'https://api.antibait.io/api/analysis/basic',
headers=headers,
json=data
)
print(response.json())Getting Your API Key
Create an Account
Sign up for a free AntiBait account at antibait.io
Navigate to API Settings
Go to your Account page and select the API tab
Generate API Key
Click "Generate New API Key" and copy the key immediately (it won't be shown again)
Security Best Practices
Never Expose Your API Key
Don't commit API keys to version control or expose them in client-side code
Rotate Keys Regularly
Generate new API keys periodically and revoke old ones
Use Environment Variables
Store API keys in environment variables or secure secret management systems
Server-Side Only
Make API requests from your backend server, never directly from browser JavaScript
API requests are rate-limited based on your subscription plan. Exceeded limits will result in HTTP 429 (Too Many Requests) responses. Monitor your usage in the account dashboard.
Missing or invalid API keys will return HTTP 401 (Unauthorized) errors. Ensure your Authorization header is correctly formatted as Bearer YOUR_API_KEY.
Need help integrating our API? Our support team is here to assist you.