Get Visibility Score
curl --request GET \
--url https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}import requests
url = "https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}")
.asString();require 'uri'
require 'net/http'
url = URI("https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"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 }
]
}
π’ GET - Visibility Score
Get Visibility Score
Get current visibility score AND historical data for charts (combined endpoint)
GET
/
api
/
visibility-score
/
{org_slug}
Get Visibility Score
curl --request GET \
--url https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}import requests
url = "https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}")
.asString();require 'uri'
require 'net/http'
url = URI("https://searchcompany-main.up.railway.app/api/visibility-score/{org_slug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"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:
Fallback (before first cron run):
If
- The visibility score card (current score + trend)
- The βVisibility Over Timeβ chart (historical data)
Path Parameters
string
required
The Clerk organization slug
Query Parameters
string
Filter by product/item ID. Omit for business-level score.
string
Business website URL for ranking score fallback (e.g.,
https://nike.com)Response
object
Current score with trend
array
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 |
{
"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:| 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