Log Ingestion API
Send logs from custom integrations to AI Search Index for bot detection.
Overview
The Log Ingestion API allows you to send access logs from any source. This is useful for:
- Custom CDN integrations
- Self-hosted infrastructure
- Batch log import
- CDNs not directly supported
Endpoint
POST
/api/v1/logs/customURL: https://aisearchindex.com/api/v1/logs/custom
Method: POST
Content-Type: application/json
Headers:
x-api-key: bot_YOUR_BOT_TRACKING_KEYNote: Use your Bot Tracking Key (starts with bot_) for log ingestion, not your API key.
Request Format
Send a single log entry or an array of entries (max 1000 per request):
Single Entry
{
"timestamp": "2024-01-11T12:00:00Z",
"method": "GET",
"host": "example.com",
"path": "/",
"status_code": 200,
"ip": "66.249.66.1",
"user_agent": "Mozilla/5.0 (compatible; GPTBot/1.0)",
"referer": "https://google.com"
}Batch (Array)
[
{
"timestamp": "2024-01-11T12:00:00Z",
"method": "GET",
"host": "example.com",
"path": "/",
"status_code": 200,
"ip": "66.249.66.1",
"user_agent": "Mozilla/5.0 (compatible; GPTBot/1.0)"
},
{
"timestamp": "2024-01-11T12:00:01Z",
"method": "GET",
"host": "example.com",
"path": "/about",
"status_code": 200,
"ip": "66.249.66.2",
"user_agent": "ClaudeBot/1.0"
}
]Required Fields
| Field | Type | Description |
|---|---|---|
| timestamp | string/number | ISO 8601 or Unix timestamp (ms) |
| method | string | HTTP method |
| host | string | Request hostname |
| path | string | Request path |
| status_code | number | HTTP status code |
| ip | string | Client IP address |
| user_agent | string | User-Agent header |
Response
Success (200)
{
"success": true,
"processed": 2,
"message": "Logs received"
}Example
cURL
curl -X POST https://aisearchindex.com/api/v1/logs/custom \
-H "Content-Type: application/json" \
-H "x-api-key: bot_YOUR_BOT_TRACKING_KEY" \
-d '[
{
"timestamp": "2024-01-11T12:00:00Z",
"method": "GET",
"host": "example.com",
"path": "/",
"status_code": 200,
"ip": "66.249.66.1",
"user_agent": "Mozilla/5.0 (compatible; GPTBot/1.0)"
}
]'For more details, see the Custom Integration guide.