What it does
The REST API exposes the same operations as the dashboard:- Onboard new clients automatically. Hand the API a website URL. It researches the brand, proposes competitors and buyer-intent topics, and creates the project with prompts ready to scan.
- Run AI visibility scans across ChatGPT, Perplexity, Google AI Overviews, and DeepSeek. (Claude is gated to specific accounts.)
- Read visibility, share of voice, sentiment, citation sources, and per-attribute breakdowns programmatically.
- Download client-ready PDF reports.
- Manage projects, topics, prompts, and platforms.
Authentication
Every request needs a Clerk API key in theAuthorization header.
Get an API key
1
Sign in to OpenLens
Sign in. If you don’t have an account yet, sign up here. The API doesn’t provision accounts in beta, so the web sign-up is the only path.
2
Open your account settings
From the dashboard, click your avatar in the bottom-left corner and choose Manage account.
3
Add a key
Open the API Keys tab and click Add new key.
4
Name it and pick an expiry
Give the key an optional name (handy if you’re running it from multiple machines) and pick an expiration date.
5
Copy the secret immediately
The secret never appears again. If you lose it, you’ll need to revoke it and create a new one.
Send it on every request
Base URL
application/pdf.
End-to-end example
We’ll onboard Anthropic from scratch and read back their visibility scores. Five short steps, about 11 minutes end to end. The individual steps run fast. The wait is the AI platforms thinking.Setup
Pin the base URL and the auth header so every request below can reuse them.1
Analyze the brand (about 30s)
POST /onboard with action: "analyze" hands the API a website URL. It reads the page, figures out what the brand does, and proposes a starting set of competitors and buyer-intent topics. Nothing is saved yet, so you can edit the result before committing. The endpoint streams progress events as Server-Sent Events. We just wait for the full response and parse the final data: line.2
Confirm and create the project (about 1m)
action: "confirm" takes the analysis back (with any edits), creates the project, and generates 10 prompts per topic in the background.3
Kick off a scan
POST /prompts/run returns immediately with a runId. A typical run is 30 prompts × 4 platforms = 120 platform responses.4
Wait for it to finish (5 to 15 min)
Poll every 30 seconds. Most fresh projects complete in 5 to 10 minutes. Larger ones can take 30+. If a deploy or crash interrupts a run, calling
POST /prompts/run again resumes it from where it left off.5
Read the results
GET /visibility returns an array of brand-level scores: visibility (mention rate), share of voice, sentiment, average rank, per-platform breakdown. Same data the dashboard renders.What you get back
Supported platforms
To see which platforms are active on your account, call
GET /api/settings/platforms.
Endpoint families
A quick tour of what’s available. Full request and response shapes are in the OpenAPI spec at/api/openapi.json (also rendered as the per-endpoint pages in this section).
- Onboarding.
POST /api/onboard(Server-Sent Events) withaction: analyzeoraction: confirm. - Runs.
POST /api/prompts/runto start,GET /api/prompts/statusto poll,DELETE /api/prompts/runto cancel,GET /api/prompts/resultsfor raw responses. - Metrics.
GET /api/visibility(overall, per-topic, per-attribute),GET /api/visibility/trendsfor time series,GET /api/insights/enginesfor per-platform source behavior,GET /api/insights/topicfor an AI-generated insight paragraph. - Citations.
GET /api/brand-mentions-summaryreturns top cited URLs per topic.GET /api/sourcesreturns top cited domains. - Deliverables.
GET /api/reports/visibilityreturns a client-ready PDF.GET /api/reports/runsreturns run history. - Resources. CRUD endpoints for projects, brands, topics, and prompts.
- Account.
GET /api/me/limits,GET /api/usage,GET /api/settings/platforms. (Note:/api/settings/schedulereturns410 Gone. Scheduling is per-project now. Use/api/projects/{id}/schedule.)