Programmatic access to BrainyLion website audits. This API is designed for both human developers and AI coding agents.
/admin/api-keysPOST /api/v1/auditsGET /api/v1/audits/:idcallback_url and we'll POST results to you when readyAll /api/v1/* endpoints require a valid API key passed as a Bearer token in the Authorization header.
Authorization: Bearer bl_live_your_api_key_hereAPI keys are created by admins through the API Keys dashboard. Keys start with bl_live_ and are shown only once at creation — store them securely.
| Status | Meaning |
|---|---|
401 | Missing or invalid API key |
403 | API key doesn't have access to this resource |
/api/v1/auditsSubmits a website URL for auditing. Returns immediately with the audit ID and a pending status. The audit runs asynchronously in the background (typically 30–50 seconds).
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The website URL to audit. https:// is added automatically if missing. |
audit_type | string | No | One of: basic (default, 10 questions), advanced (26 questions), dental (dental-specific), restoration-seo (SEO with metadata analysis). |
callback_url | string | No | URL to receive a POST with results when the audit completes. See Webhooks. |
model_override | string | No | Override the AI model used for analysis (e.g. gpt-5.4). Defaults to gpt-5.4-mini. |
curl -X POST https://brainylion.com/api/v1/audits \
-H "Authorization: Bearer bl_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example-restoration.com",
"audit_type": "basic",
"callback_url": "https://your-server.com/webhook"
}'{
"id": 1623,
"status": "pending",
"website": "https://example-restoration.com",
"audit_type": "basic",
"callback_url": "https://your-server.com/webhook",
"created_at": "2026-03-25T18:23:05.000Z"
}/api/v1/audits/:idRetrieve the status and results of a specific audit. Poll this endpoint until status is completed or failed.
| Param | Type | Description |
|---|---|---|
include | string | Set to screenshot to include the base64-encoded screenshot (large). Omitted by default. |
| Status | Meaning |
|---|---|
pending | Audit is queued and waiting to start |
processing | Audit is actively running (screenshot + AI analysis) |
completed | Audit finished successfully — results are available |
failed | Audit failed — see error_message for details |
curl https://brainylion.com/api/v1/audits/1623 \
-H "Authorization: Bearer bl_live_your_key"{
"id": 1623,
"status": "completed",
"website": "https://example-restoration.com",
"audit_type": "basic",
"overall_grade": "B",
"runtime_ms": 34200,
"created_at": "2026-03-25T18:23:05.000Z",
"error_message": null,
"scores": [
{
"question": "Is there a clearly visible phone number in the header?",
"score": 1,
"reason": "A phone number (555-123-4567) is prominently displayed in the top navigation bar."
},
{
"question": "Does the website have a clear call-to-action above the fold?",
"score": 0,
"reason": "No clear CTA button is visible in the initial viewport. The first CTA appears below the fold."
}
],
"technical_seo_scores": [
{
"metric": "https",
"passed": true,
"value": "true",
"recommendation": "Your site uses HTTPS. Great for security and SEO."
},
{
"metric": "page_speed",
"passed": true,
"value": "1.2",
"recommendation": "Excellent! Your page loads in 1.2 seconds."
},
{
"metric": "title_tag",
"passed": true,
"value": "Example Restoration - Water Damage Experts",
"recommendation": "Good! Your title tag is present and has appropriate length."
}
]
}/api/v1/auditsReturns a paginated list of all audits submitted with your API key.
| Param | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Number of results per page (max 100) |
offset | integer | 0 | Number of results to skip |
status | string | — | Filter by status: pending, processing, completed, failed |
curl "https://brainylion.com/api/v1/audits?status=completed&limit=5" \
-H "Authorization: Bearer bl_live_your_key"{
"audits": [
{
"id": 1623,
"website": "https://example-restoration.com",
"status": "completed",
"audit_type": "basic",
"overall_grade": "B",
"runtime": 34200,
"created_at": "2026-03-25T18:23:05.000Z",
"error_message": null
}
],
"pagination": {
"total": 42,
"limit": 5,
"offset": 0,
"has_more": true
}
}When you provide a callback_url in your audit submission, we'll POST the results to that URL when the audit completes (or fails).
| Header | Description |
|---|---|
X-BrainyLion-Signature | HMAC-SHA256 hex digest of the request body (for verifying authenticity) |
X-BrainyLion-Event | audit.completed or audit.failed |
X-BrainyLion-Delivery | Unique delivery ID for deduplication |
{
"event": "audit.completed",
"audit": {
"id": 1623,
"status": "completed",
"website": "https://example-restoration.com",
"audit_type": "basic",
"overall_grade": "B",
"runtime_ms": 34200,
"created_at": "2026-03-25T18:23:05.000Z",
"error_message": null,
"scores": [ ... ],
"technical_seo_scores": [ ... ]
}
}If not using webhooks, poll GET /api/v1/audits/:id with increasing intervals:
# Pseudocode for polling
response = POST /api/v1/audits { url: "https://example.com" }
audit_id = response.id
loop:
wait 5 seconds
result = GET /api/v1/audits/{audit_id}
if result.status == "completed":
# Use result.scores, result.overall_grade, etc.
break
if result.status == "failed":
# Check result.error_message
break
# Still pending/processing — keep polling
# Increase wait to 10s after first few attemptsTypical audit time is 30–50 seconds. We recommend starting with 5-second polling intervals and backing off to 10 seconds after 30 seconds.
| Type | Questions | Description |
|---|---|---|
basic | 10 | Standard website audit — checks phone number visibility, CTAs, trust signals, and basic UX. Best for quick assessments. |
advanced | 26 | Comprehensive audit covering all basic checks plus mobile optimization, content quality, social proof, and conversion optimization. |
dental | ~15 | Specialized audit for dental practice websites with industry-specific criteria. |
restoration-seo | ~20 | SEO-focused audit for restoration companies. Includes technical metadata extraction (title tags, H1s, internal links, schema markup, word count) and SEO-specific scoring. |
Each question is scored 0 (fail) or 1 (pass). The overall grade is calculated from the percentage of questions passed:
| Grade | Score |
|---|---|
| A | 90–100% |
| B | 80–89% |
| C | 70–79% |
| D | 60–69% |
| F | Below 60% |
The API processes up to 3 audits concurrently. Additional requests are queued and processed in order. Each audit requires a Puppeteer browser instance and an OpenAI API call, so this limit protects upstream service availability.
There are no per-key rate limits at this time, but excessive usage may be throttled.
| Status | Meaning | Action |
|---|---|---|
400 | Bad request (invalid URL, bad audit_type, etc.) | Check request body format |
401 | Missing or invalid API key | Check your Authorization header |
403 | API key doesn't own this audit | You can only access audits you created |
404 | Audit not found | Check the audit ID |