AI Visibility
REST endpoints for AI Visibility. Base URL https://api.competlab.com; every request needs a CL-API-Key header (see Authentication). Responses wrap in { item } or { items }; errors in { error }.
Get latest AI visibility data
/v1/projects/{projectId}/ai-visibilityGet the latest AI visibility data for a project. Returns AI Visibility Scores, mention rates, and per-provider breakdowns for all competitors found across ChatGPT, Claude, and Gemini. Use this to understand how AI models perceive and recommend your brand vs competitors.
Path parameters
| Name | Type | Description |
|---|---|---|
projectId | string | Project ID |
Request
curl "https://api.competlab.com/v1/projects/507f1f77bcf86cd799439011/ai-visibility" \
-H "CL-API-Key: YOUR_COMPETLAB_API_KEY"Response 200 OK
Example
{
"item": {
"lastUpdatedAt": "2026-03-15T10:00:00.000Z",
"summary": {
"customer": {
"domain": "mycompany.com",
"mentionRate": 66.7,
"avgRank": 2.5,
"mentionCount": 6,
"aiScore": 73,
"perProvider": {
"openai": {
"rank": 2.3,
"mentioned": true,
"mentionCount": 3
},
"claude": {
"rank": 2.3,
"mentioned": true,
"mentionCount": 3
},
"gemini": {
"rank": 2.3,
"mentioned": true,
"mentionCount": 3
}
}
},
"topCompetitor": {
"domain": "competitor.com",
"name": "Competitor Inc",
"mentionRate": 88.9,
"avgRank": 1.8
},
"mentionRateGap": -22.2,
"totalCompetitorsFound": 8,
"totalQueries": 9,
"totalEntries": 45,
"competitorRankings": [
{
"domain": "competitor.com",
"name": "Competitor Inc",
"isOwn": false,
"openaiAvgRank": 2,
"claudeAvgRank": 1.7,
"geminiAvgRank": 3,
"overallAvgRank": 2.2,
"mentionCount": 7,
"mentionRate": 77.8,
"aiScore": 68
}
]
}
}
}Errors
| Status | Code | Meaning |
|---|---|---|
| 401 | api_key_missing · api_key_invalid · api_key_revoked · api_key_expired · insufficient_scope | The CL-API-Key is missing, malformed, revoked, expired, or lacks the required scope. |
| 404 | project_not_found | No project matches the id in the path. |
Every error uses the shared { error: { code, message, status } } envelope; code is one of the values listed above.
{
"error": {
"code": "api_key_invalid",
"message": "Invalid API key",
"status": 401
}
}Get AI visibility check history
/v1/projects/{projectId}/ai-visibility/historyGet paginated history of AI visibility checks for a project. Each entry includes check timing and summary statistics with customer metrics, top competitor, and competitor rankings.
Path parameters
| Name | Type | Description |
|---|---|---|
projectId | string | Project ID |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
page | number | Page number (1-indexed). Default 1. Min 1. | |
limit | number | Number of items per page. Default 20. Range 1–100. |
Request
curl "https://api.competlab.com/v1/projects/507f1f77bcf86cd799439011/ai-visibility/history?page=1&limit=20" \
-H "CL-API-Key: YOUR_COMPETLAB_API_KEY"Response 200 OK
Example
{
"items": [
{
"checkId": "507f1f77bcf86cd799439011",
"completedAt": "2026-03-15T10:00:00.000Z",
"summary": {
"customer": {
"domain": "mycompany.com",
"mentionRate": 66.7,
"avgRank": 2.5,
"mentionCount": 6,
"aiScore": 73,
"perProvider": {
"openai": {
"rank": 2.3,
"mentioned": true,
"mentionCount": 3
},
"claude": {
"rank": 2.3,
"mentioned": true,
"mentionCount": 3
},
"gemini": {
"rank": 2.3,
"mentioned": true,
"mentionCount": 3
}
}
},
"topCompetitor": {
"domain": "competitor.com",
"name": "Competitor Inc",
"mentionRate": 88.9,
"avgRank": 1.8
},
"mentionRateGap": -22.2,
"totalCompetitorsFound": 8,
"totalQueries": 9,
"totalEntries": 45,
"competitorRankings": [
{
"domain": "competitor.com",
"name": "Competitor Inc",
"isOwn": false,
"openaiAvgRank": 2,
"claudeAvgRank": 1.7,
"geminiAvgRank": 3,
"overallAvgRank": 2.2,
"mentionCount": 7,
"mentionRate": 77.8,
"aiScore": 68
}
]
}
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 47,
"totalPages": 3,
"hasMore": true
}
}Paginated — pass page and limit query parameters and follow pagination.hasMore to page through the full set.
Errors
| Status | Code | Meaning |
|---|---|---|
| 401 | api_key_missing · api_key_invalid · api_key_revoked · api_key_expired · insufficient_scope | The CL-API-Key is missing, malformed, revoked, expired, or lacks the required scope. |
Every error uses the shared { error: { code, message, status } } envelope; code is one of the values listed above.
{
"error": {
"code": "api_key_invalid",
"message": "Invalid API key",
"status": 401
}
}Get AI visibility data for a specific check
/v1/projects/{projectId}/ai-visibility/history/{checkId}Get full AI visibility data for a specific historical check, including per-competitor rankings across all three AI providers with mention rates and AI Visibility Scores.
Path parameters
| Name | Type | Description |
|---|---|---|
checkId | string | Check ID |
projectId | string | Project ID |
Request
curl "https://api.competlab.com/v1/projects/507f1f77bcf86cd799439011/ai-visibility/history/507f1f77bcf86cd799439012" \
-H "CL-API-Key: YOUR_COMPETLAB_API_KEY"Response 200 OK
Example
{
"item": {
"checkId": "507f1f77bcf86cd799439011",
"completedAt": "2026-03-15T10:00:00.000Z",
"summary": {
"customer": {
"domain": "mycompany.com",
"mentionRate": 66.7,
"avgRank": 2.5,
"mentionCount": 6,
"aiScore": 73,
"perProvider": {
"openai": {
"rank": 2.3,
"mentioned": true,
"mentionCount": 3
},
"claude": {
"rank": 2.3,
"mentioned": true,
"mentionCount": 3
},
"gemini": {
"rank": 2.3,
"mentioned": true,
"mentionCount": 3
}
}
},
"topCompetitor": {
"domain": "competitor.com",
"name": "Competitor Inc",
"mentionRate": 88.9,
"avgRank": 1.8
},
"mentionRateGap": -22.2,
"totalCompetitorsFound": 8,
"totalQueries": 9,
"totalEntries": 45,
"competitorRankings": [
{
"domain": "competitor.com",
"name": "Competitor Inc",
"isOwn": false,
"openaiAvgRank": 2,
"claudeAvgRank": 1.7,
"geminiAvgRank": 3,
"overallAvgRank": 2.2,
"mentionCount": 7,
"mentionRate": 77.8,
"aiScore": 68
}
]
},
"competitors": [
{
"domain": "competitor.com",
"name": "Competitor Inc",
"isOwn": false,
"openaiAvgRank": 2,
"claudeAvgRank": 1.7,
"geminiAvgRank": 3,
"overallAvgRank": 2.2,
"mentionCount": 7,
"mentionRate": 77.8,
"aiScore": 68
}
]
}
}Errors
| Status | Code | Meaning |
|---|---|---|
| 401 | api_key_missing · api_key_invalid · api_key_revoked · api_key_expired · insufficient_scope | The CL-API-Key is missing, malformed, revoked, expired, or lacks the required scope. |
| 404 | check_not_found | No check matches the id in the path. |
Every error uses the shared { error: { code, message, status } } envelope; code is one of the values listed above.
{
"error": {
"code": "api_key_invalid",
"message": "Invalid API key",
"status": 401
}
}Get AI visibility trend data
/v1/projects/{projectId}/ai-visibility/trendGet AI visibility trend data over time for chart visualization. Returns time-series data points with customer and top competitor mention rates and AI Visibility Scores. Optionally filter by date range or specific AI provider — the provider filter applies to mention rates only; the AI Visibility Score is a single weighted composite across all providers, so customerAiScore/topCompetitorAiScore are null when a provider filter is applied. Returns up to 200 data points — use dateFrom/dateTo to narrow the range for longer histories.
Path parameters
| Name | Type | Description |
|---|---|---|
projectId | string | Project ID |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
dateFrom | string | Start date for trend data (ISO-8601) | |
dateTo | string | End date for trend data (ISO-8601) | |
provider | string | Filter by AI provider. Omit to get aggregated trend across all providers. Values: openai, claude, gemini. |
Request
curl "https://api.competlab.com/v1/projects/507f1f77bcf86cd799439011/ai-visibility/trend?dateFrom=2026-01-01&dateTo=2026-03-15&provider=openai" \
-H "CL-API-Key: YOUR_COMPETLAB_API_KEY"Response 200 OK
Example
{
"items": [
{
"date": "2026-03-15T10:00:00.000Z",
"customerMentionRate": 66.7,
"topCompetitorMentionRate": 88.9,
"topCompetitorDomain": "competitor.com",
"gap": -22.2,
"customerAiScore": 73,
"topCompetitorAiScore": 85
}
]
}Errors
| Status | Code | Meaning |
|---|---|---|
| 401 | api_key_missing · api_key_invalid · api_key_revoked · api_key_expired · insufficient_scope | The CL-API-Key is missing, malformed, revoked, expired, or lacks the required scope. |
Every error uses the shared { error: { code, message, status } } envelope; code is one of the values listed above.
{
"error": {
"code": "api_key_invalid",
"message": "Invalid API key",
"status": 401
}
}