Skip to Content

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

GET/v1/projects/{projectId}/ai-visibility

Get 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.

Returns · { item }

Path parameters

NameTypeDescription
projectIdstringProject ID

Request

curl "https://api.competlab.com/v1/projects/507f1f77bcf86cd799439011/ai-visibility" \ -H "CL-API-Key: YOUR_COMPETLAB_API_KEY"

Response 200 OK

{ "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

StatusCodeMeaning
401api_key_missing · api_key_invalid · api_key_revoked · api_key_expired · insufficient_scopeThe CL-API-Key is missing, malformed, revoked, expired, or lacks the required scope.
404project_not_foundNo 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

GET/v1/projects/{projectId}/ai-visibility/history

Get 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.

Returns · { items, pagination }

Path parameters

NameTypeDescription
projectIdstringProject ID

Query parameters

NameTypeRequiredDescription
pagenumberPage number (1-indexed). Default 1. Min 1.
limitnumberNumber of items per page. Default 20. Range 1100.

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

{ "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

StatusCodeMeaning
401api_key_missing · api_key_invalid · api_key_revoked · api_key_expired · insufficient_scopeThe 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

GET/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.

Returns · { item }

Path parameters

NameTypeDescription
checkIdstringCheck ID
projectIdstringProject 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

{ "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

StatusCodeMeaning
401api_key_missing · api_key_invalid · api_key_revoked · api_key_expired · insufficient_scopeThe CL-API-Key is missing, malformed, revoked, expired, or lacks the required scope.
404check_not_foundNo 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

GET/v1/projects/{projectId}/ai-visibility/trend

Get 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.

Returns · { items }

Path parameters

NameTypeDescription
projectIdstringProject ID

Query parameters

NameTypeRequiredDescription
dateFromstringStart date for trend data (ISO-8601)
dateTostringEnd date for trend data (ISO-8601)
providerstringFilter 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

{ "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

StatusCodeMeaning
401api_key_missing · api_key_invalid · api_key_revoked · api_key_expired · insufficient_scopeThe 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 } }
Last updated on