Skip to main content
GET
https://searchcompany-main.up.railway.app
/
api
/
visibility-score
/
{org_slug}
Get Visibility Score
curl --request GET \
  --url https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}
{
  "visibilityScore": {
    "value": 48,
    "trend": "+3%"
  },
  "history": [
    { "date": "Oct 15", "value": 42 },
    { "date": "Oct 22", "value": 44 },
    { "date": "Oct 29", "value": 45 },
    { "date": "Nov 05", "value": 46 },
    { "date": "Nov 12", "value": 47 },
    { "date": "Nov 19", "value": 48 }
  ]
}
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:
  • The visibility score card (current score + trend)
  • The β€œVisibility Over Time” chart (historical data)

Path Parameters

org_slug
string
required
The Clerk organization slug

Query Parameters

product_id
string
Filter by product/item ID. Omit for business-level score.
business_url
string
Business website URL for ranking score fallback (e.g., https://nike.com)

Response

visibilityScore
object
Current score with trend
history
array
Historical data points for charting (up to 6 months)

Visibility Score Object

FieldTypeDescription
valueintegerCurrent score (0-100)
trendstringWeek-over-week change (e.g., β€œ+3%”, β€œ-2%β€œ)

History Entry

FieldTypeDescription
datestringFormatted date (e.g., β€œJul 15”)
valueintegerScore on that date
{
  "visibilityScore": {
    "value": 48,
    "trend": "+3%"
  },
  "history": [
    { "date": "Oct 15", "value": 42 },
    { "date": "Oct 22", "value": 44 },
    { "date": "Oct 29", "value": 45 },
    { "date": "Nov 05", "value": 46 },
    { "date": "Nov 12", "value": 47 },
    { "date": "Nov 19", "value": 48 }
  ]
}

Data Sources & Fallback Logic

Primary Source:
FieldTable/ViewDescription
visibilityScorecurrent_visibility_scoreVIEW for fast current lookup
historyvisibility_score_historyDaily snapshots over 6 months
Fallback (before first cron run): If 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)
Once the daily cron job completes the first real visibility analysis, the endpoint automatically switches to using the real data from 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