Docs · API

API v1

On this pageLumvi API v1QuickstartAuthenticationEndpointsChoosing a period and engineCounts and ratesReading every answer (pagination)CSVGoogle Sheets and Looker StudioErrorsLimitsChanges

Lumvi API v1

Pull your AI visibility data into your own dashboards, spreadsheets and reports. REST, JSON by default, CSV on request. Read-only.

Available on Pro and Enterprise plans.

Quickstart

  1. In Lumvi, open Settings → API keys → create a key. It is shown once; store it safely.
  2. List your projects:
curl https://app.lumvi.ai/v1/projects \
  -H "Authorization: Bearer lumvi_xxxx"
  1. Use a project id from the result to read its metrics:
curl "https://app.lumvi.ai/v1/projects/PROJECT_ID/metrics" \
  -H "Authorization: Bearer lumvi_xxxx"

Base URL: https://app.lumvi.ai/v1

Authentication

Send your key as a Bearer token. Never put a key in a URL.

Authorization: Bearer lumvi_xxxx
  • Keys are created by members of your workspace in Settings.
  • A key acts as the person who created it: it sees the projects they see.
  • The same key works for the MCP connector.
  • Revoke a key in Settings and it stops working at once.

Endpoints

All are GET. Add ?format=csv to any of them for CSV.

Endpoint Returns
/v1/projects Your projects
/v1/projects/:id/metrics Visibility, share of voice and citations, per engine
/v1/projects/:id/competitors Competitors and their share of voice
/v1/projects/:id/prompts Your questions with results (always the last 30 days)
/v1/projects/:id/answers The raw feed of AI answers, newest first
/v1/projects/:id/sources Domains cited in answers
/v1/projects/:id/sentiment Sentiment by engine and by attribute

Choosing a period and engine

metrics, competitors, sources and sentiment accept from, to and engine.

  • from and to are dates as YYYY-MM-DD. Send both or neither. With neither, you get the last 30 days.
  • engine is one of openai, gemini, perplexity, google_ai_mode, anthropic. Leave it out for all engines. A window can span at most 366 days; longer returns range_too_large.

Counts and rates

Every ratio comes with its counts, so you can check the maths. Example:

{ "mentioned": 12, "total": 40, "rate": 0.3 }

rate is null when total is 0.

Reading every answer (pagination)

/answers returns pages. Pass limit (default 50, max 100) and since (a date or ISO datetime). Each page includes next_cursor; pass it back as cursor to get the next page. next_cursor is null on the last page. In CSV, the next cursor comes in the x-next-cursor response header. Treat the cursor as opaque.

curl "https://app.lumvi.ai/v1/projects/PROJECT_ID/answers?limit=100" \
  -H "Authorization: Bearer lumvi_xxxx"

CSV

Add ?format=csv. Column names are the JSON field path joined with _ (for example visibility_rate). The header row is always present, even with no data.

Google Sheets and Looker Studio

Sheets’ IMPORTDATA and Looker Studio’s URL connector can’t send an Authorization header, and a key must never go in a URL. Use a small Apps Script that fetches the CSV with your key, writes it into a sheet tab, and refreshes daily. Looker Studio then reads the sheet.

  1. Find your project’s id: run the first Quickstart call (GET /v1/projects) and copy the id of the project you want.
  2. In the sheet, open Extensions → Apps Script. Replace everything in the editor with the code below, paste your id into PROJECT_ID, and save.
  3. In the editor’s left sidebar, click the gear icon (Project Settings). At the bottom, under Script Properties, click Add script property: name LUMVI_API_KEY, value your key. Save. This keeps the key out of the code.
  4. Back in the editor (the <> icon), choose importLumvi in the function menu and click Run. Google asks you to authorize the script the first time. The sheet gets one tab per endpoint.
  5. To refresh daily, open Triggers (the clock icon), add a trigger for importLumvi, and choose a time-driven, daily schedule.
const BASE = 'https://app.lumvi.ai/v1';
const PROJECT_ID = 'paste-project-id-here';
// One tab per endpoint: metrics, competitors, prompts, sources, sentiment
const ENDPOINTS = ['metrics', 'competitors'];

function importLumvi() {
  const key = PropertiesService.getScriptProperties().getProperty('LUMVI_API_KEY');
  const book = SpreadsheetApp.getActive();
  for (const name of ENDPOINTS) {
    const res = UrlFetchApp.fetch(`${BASE}/projects/${PROJECT_ID}/${name}?format=csv`, {
      headers: { Authorization: `Bearer ${key}` },
      muteHttpExceptions: true,
    });
    if (res.getResponseCode() !== 200) {
      throw new Error(`${name}: ${res.getResponseCode()} ${res.getContentText()}`);
    }
    const rows = Utilities.parseCsv(res.getContentText().replace(/^\uFEFF/, ''));
    const sheet = book.getSheetByName(name) || book.insertSheet(name);
    sheet.clearContents();
    sheet.getRange(1, 1, rows.length, rows[0].length).setValues(rows);
  }
}

Each refresh uses one call per endpoint from your 60-per-minute limit.

Errors

Every error has the same shape:

{ "code": "unauthorized", "message": "…", "details": {} }
Status code Meaning
401 unauthorized Key missing, wrong or revoked
403 plan_required Your plan doesn’t include the API
403 forbidden That project isn’t one you can access (or doesn’t exist; we don’t say which)
400 invalid_cursor Pass back a next_cursor as you got it
400 invalid_date since isn’t a real date
400 range_too_large The period is over 366 days
429 rate_limited Slow down and retry

Limits

60 calls per minute per key, shared with the MCP connector. The count resets every minute. On 429, wait up to a minute and retry.

Changes

We may add fields to responses. Write your code to ignore fields it doesn’t know.