Skip to main content

Purpose

Returns the current visibility score and historical data for dashboard charts. Shows how visible a business/product is across AI platforms over time.

Architecture

Query Parameters

ParameterTypeDescription
product_idstringFilter by product (optional)
business_urlstringBusiness URL for ranking lookup
ranking_scoreintPre-payment ranking score

Response Format

{
  "visibilityScore": {
    "value": 67,
    "trend": "+12%"
  },
  "history": [
    {"date": "Jan 15", "value": 55},
    {"date": "Jan 16", "value": 58},
    {"date": "Jan 17", "value": 67}
  ]
}

Trend Calculation

Compares current score to score from 7 days ago:
trend = ((current - week_ago) / week_ago) * 100

History Format

  • Returns last 6 months of data
  • Dates formatted as β€œJan 15” for frontend charts
  • Values are 0-100 percentage scores

Code Location

src/app/apis/current_setup/visibility_score/routes.py