Get Visibility Score
π’ GET - Visibility Score
Get Visibility Score
Get current visibility score AND historical data for charts (combined endpoint)
GET
Get Visibility Score
Returns the current AI visibility score and 6 months of historical data in a single request.
This is the primary endpoint for the dashboard - it provides everything needed for:
Fallback (before first cron run):
If
- The visibility score card (current score + trend)
- The βVisibility Over Timeβ chart (historical data)
Path Parameters
The Clerk organization slug
Query Parameters
Filter by product/item ID. Omit for business-level score.
Business website URL for ranking score fallback (e.g.,
https://nike.com)Response
Current score with trend
Historical data points for charting (up to 6 months)
Visibility Score Object
| Field | Type | Description |
|---|---|---|
value | integer | Current score (0-100) |
trend | string | Week-over-week change (e.g., β+3%β, β-2%β) |
History Entry
| Field | Type | Description |
|---|---|---|
date | string | Formatted date (e.g., βJul 15β) |
value | integer | Score on that date |
Data Sources & Fallback Logic
Primary Source:| Field | Table/View | Description |
|---|---|---|
visibilityScore | current_visibility_score | VIEW for fast current lookup |
history | visibility_score_history | Daily snapshots over 6 months |
visibility_score_history is empty and business_url is provided, the endpoint falls back to pre_payment_rankings table to show an initial score immediately after onboarding.
The fallback returns:
- Score: Value from
pre_payment_rankings(32-49) - History: 2 fake data points (yesterday: 0, today: score)
visibility_score_history.
Notes
- Returns 6 months of historical data (once available)
- Score calculated from visibility across all 8 AI platforms
- Trend compares current score to 7 days ago
- Before first cron run: Shows pre-payment ranking score (32-49) with fake 2-day history
- After first cron run: Switches to real visibility data
- Real visibility analysis runs daily at 14:00 UTC via cron job