Custom Integration
Send logs from any source using our standardized JSON format.
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_KEYRequest Format
Send a single log entry or an array of entries:
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"
}
]Field Reference
| Field | Type | Required | Description |
|---|---|---|---|
| timestamp | string/number | Yes | ISO 8601 string or Unix timestamp (ms) |
| method | string | Yes | HTTP method (GET, POST, etc.) |
| host | string | Yes | Request hostname |
| path | string | Yes | Request path (e.g., /page) |
| status_code | number | Yes | HTTP response status code |
| ip | string | Yes | Client IP address |
| user_agent | string | Yes | User-Agent header |
| referer | string | No | Referer header |
| query_params | object | No | URL query parameters as key-value pairs |
| content_type | string | No | Response Content-Type |
Example Request
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)"
}
]'Response
Successful requests return:
{
"success": true,
"processed": 1,
"message": "Logs received"
}Rate Limits
- Maximum 1000 log entries per request
- Maximum 100 requests per second per API key
- Contact us for higher limits
Best Practices
- Batch requests: Send multiple log entries per request for better performance
- Async sending: Don't block your main application while sending logs
- Retry on failure: Implement exponential backoff for failed requests
- Buffer locally: Queue logs and send in batches every few seconds