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 API Keys
From the dashboard sidebar, open API Keys.
3
Add a key
Click Create API key.
4
Choose scope and expiry
Give the key a name, choose Personal or Organization scope, and pick an expiry. Organization keys are available to workspace owners and admins.
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.GET /api/prompts/runslists a project’s run history (paginated, sortable, filterable);GET /api/prompts/runs/{runId}returns one run’s metadata and per-platform breakdown. - 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/runsreturns completed run history.GET /api/reports/visibility?projectId=...&runId=...returns a client-ready PDF for one selected run. - 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.)
?runId= to GET /api/visibility, GET /api/sources, GET /api/insights/engines, GET /api/insights/topic, GET /api/prompts/results, and GET /api/brand-mentions-summary to pin the response to a specific historical run — take the id from GET /api/prompts/runs.
For example, fetch a completed run from the history endpoint, then reuse its ID when reading citations:
404, except GET /api/prompts/results?allowIncompleteRun=1: that mode reads partial results from an owned run in any status and returns an empty array for unknown or other-project run IDs.