Metrics API reference
A read-only REST API under /api/v1 that returns the same aggregates the dashboard shows, authenticated with an API key from Settings.
Get a key and test it
Open Settings and select API Keys, then New key.
Copy the key when it is shown. It starts with
ans_and is displayed once.Send it as a bearer token to
GET https://app.legitgeo.com/api/v1/whoami. It returns your user and organization.
Requests are GET and return JSON. A key works while your organization can use the dashboard: an active subscription, a free trial or the grace period after a failed payment, on a plan that includes API access. Otherwise the API answers 403 with a message that says whether billing or the plan is why. A partner-provided Visibility account has no API access. Revoking a key in Settings takes effect at once.
Endpoints
/api/v1/whoami echoes the identity behind the key. /api/v1/brands lists your businesses with id, name, industry, region, phone, trade and metro.
Every other endpoint needs brand_id: visibility-summary, visibility-trend (granularity=day or week), competitor-comparison, citations, where-ai-looks, ai-traffic, prompt-performance and shopping-cards.
Most accept date_from and date_to as YYYY-MM-DD (the end day is included), and model, region and topic_id filters. The headline number is ai_visibility_score, 0 to 100, which is not a percentage. See What AI visibility means.
Limits and errors
Errors return { "error": "…" } with 400 for bad parameters, 401 for a missing or invalid key, 403 for billing or plan, 404 for a business that is not in your organization and 500 for a problem on LegitGeo’s side. A 500 includes a requestId: quote it to support.
Some endpoints read at most 50,000 answers or visits and say so in truncated; narrow the date range to count all of it. where-ai-looks and shopping-cards answer 503 with a retry hint while answers are still being reconciled, instead of returning an empty list that would look like zero.
The full route inventory is in the OpenAPI file on GitHub.
Frequently asked questions
Why do keys start with ans_?
The prefix is kept for compatibility with keys created before the product was renamed. Treat it like any other secret.