API Endpoints
Site Management
API endpoints for site validation, sync, and management.
Validate API Key
Validate an API key and retrieve associated site information.
text
POST /sites/validateRequest
Bash
curl -X POST "https://aioradar.vercel.app/api/sites/validate" \
-H "Authorization: Bearer aio_sk_your_api_key" \
-H "Content-Type: application/json"Response
JSON
{
"data": {
"site_id": "550e8400-e29b-41d4-a716-446655440000",
"domain": "example.com",
"name": "Example Travel Tours"
}
}Error Responses
| Status | Error | Description |
|---|---|---|
| 401 | Invalid or missing API key | API key not provided or malformed |
| 401 | API key not found | Key doesn't exist in database |
Sync Site Inventory
Synchronize the site's content inventory with AIO Radar. This is typically called after content changes on the WordPress site.
text
POST /sites/syncRequest Body
JSON
{
"pages": [
{
"id": "123",
"title": "Costa Rica Adventure Tours",
"url": "https://example.com/costa-rica-tours",
"type": "page",
"content_excerpt": "Discover the best adventure tours...",
"full_content": "Full HTML content...",
"modified_at": "2024-01-15T10:30:00Z",
"word_count": 1500,
"include_in_llm_txt": true
}
],
"images": [
{
"id": "456",
"url": "https://example.com/images/tour.jpg",
"alt": "",
"title": "Tour Image"
}
],
"markdown": {
"total_count": 50,
"pages_with_markdown": 45
}
}Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
pages | array | Yes | Array of page objects |
pages[].id | string | Yes | WordPress post ID |
pages[].title | string | Yes | Page title |
pages[].url | string | Yes | Full page URL |
pages[].type | string | Yes | Post type (page, post, etc.) |
pages[].content_excerpt | string | No | Short content excerpt |
pages[].full_content | string | No | Full page content |
pages[].modified_at | string | No | ISO 8601 date of last modification |
pages[].word_count | number | No | Word count of content |
pages[].include_in_llm_txt | boolean | No | Include in LLMs.txt (default: true) |
images | array | No | Array of image objects |
images[].id | string | Yes | WordPress attachment ID |
images[].url | string | Yes | Image URL |
images[].alt | string | No | Current alt text |
images[].title | string | No | Image title |
markdown | object | No | Markdown coverage stats |
markdown.total_count | number | Yes | Total pages count |
markdown.pages_with_markdown | number | Yes | Pages with cached .md files |
Response
JSON
{
"success": true,
"data": {
"pages_synced": 50,
"images_synced": 120,
"snapshot_id": "snap_abc123"
}
}Error Responses
| Status | Error | Description |
|---|---|---|
| 400 | Invalid request body | Missing or malformed fields |
| 401 | Invalid API key | Authentication failed |
Capture Site Screenshot
Capture or retrieve a screenshot of the site homepage.
text
GET /sites/{id}/screenshotReturns the current screenshot if available.
text
POST /sites/{id}/screenshotCaptures a new screenshot. Use ?force=true to bypass freshness check.
Request
Bash
# Get current screenshot
curl -X GET "https://aioradar.vercel.app/api/sites/{id}/screenshot" \
-H "Authorization: Bearer aio_sk_your_api_key"
# Capture new screenshot
curl -X POST "https://aioradar.vercel.app/api/sites/{id}/screenshot?force=true" \
-H "Authorization: Bearer aio_sk_your_api_key"Response
JSON
{
"data": {
"screenshot_url": "https://cdn.screenshotone.com/...",
"captured_at": "2024-01-15T10:30:00Z",
"is_stale": false
}
}Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
force | boolean | false | Force new capture, bypass freshness check |
Notes
- Screenshots are cached for 30 days
- A new screenshot is captured automatically if the existing one is stale
- Screenshots are captured at 1280x720 viewport