Skip to content
REST API

API Reference

Direct HTTP access to all Baseline Labs features. Authenticate with your API key and call from any language.

Base URL
https://baselinelabs.ai/api/

Authenticate with X-API-Key: bl_your_key header on every request.

Studies
GET /api/geo/search/saves

List all your studies.

{
  "saves": [
    { "id": 42, "name": "My Brand", "url": "https://mybrand.com" }
  ]
}
POST /api/geo/search/saves

Create a new study.

{ "name": "My Brand", "url": "https://mybrand.com" }
Search
POST /api/geo/search/search

Run one or more searches across Google, GPT, Perplexity, Gemini, Google AI Mode, Claude, and DeepSeek. Costs credits. Runs synchronously and returns results directly - there's nothing to poll.

{
  "searches": [
    { "query": "best project management tools", "save_id": 42, "search_type": "google" }
  ]
}

Response:

{
  "results": [ { "query_id": 501, "position": 3, "results": [] } ],
  "errors": []
}

Each result carries a query_id you can fetch again later.

GET /api/geo/search/query/{query_id}

Fetch a single stored search result by query_id.

Visibility Reports
GET /api/geo/reports/templates

List your report templates.

POST /api/geo/reports

Run a visibility report from a template. Costs credits.

{ "template_id": 12, "save_id": 42 }
GET /api/geo/reports/{report_id}

Get report results including per-query rankings.

Brand Mentions
POST /api/geo/mentions/scans

Create a brand mention scan. Costs credits.

{
  "save_id": 42,
  "profile": {
    "business_name": "My Brand",
    "business_description": "SaaS project management tool",
    "products": "all",
    "industry": "Software"
  }
}
GET /api/geo/mentions/scans/{scan_id}

Get scan details, profile, and results.

Site & Answer Audits

Six audits share one shape, each under its own prefix: /api/geo/site_pulse, /api/geo/schema_audit, /api/geo/reputation_audit, /api/geo/ai_vision, /api/geo/fanout and /api/geo/active_competitors. Substitute the prefix for {audit} below. All six need a paid plan.

POST /api/geo/{audit}/templates

Create a reusable template - the study, the URL and the settings every scan runs with.

{ "save_id": 42, "name": "Weekly crawl", "url": "https://mybrand.com" }
POST /api/geo/{audit}

Run a scan from a template. Costs credits.

{ "template_id": 7, "save_id": 42 }

Fan-out and Active Competitors also take their queries inline - send queries with save_id, plus platforms (Fan-out) or engines (Active Competitors), and leave template_id out.

GET /api/geo/{audit}?save_id={id}

List a study's scans. GET /api/geo/{audit}/{scan_id} returns one in full. Site Pulse, Schema Audit and AI Vision also expose /{scan_id}/findings for the finding rows on their own.

GET /api/geo/{audit}/templates/{template_id}/overview

Every scan a template has ever run, as a time series - the same data the trend charts read.

Content Tool
POST /api/geo/content_tool

Score one page against the queries you want it to win, and get back anchored before/after patches with sources. Costs credits. Send either a url or pasted content - exactly one, since pasting is how you reach drafts and pages behind bot protection.

{
  "save_id": 42,
  "url": "https://mybrand.com/pricing",
  "queries": ["best project management tools"]
}
GET /api/geo/content_tool/{job_id}

Fetch a run: its score, factors and patches. GET /api/geo/content_tool?save_id={id} lists runs, and /factors returns the factor definitions the score is built from.

Competitors & Product Strategy
GET /api/geo/competitors/overview?save_id={id}

The whole competitive picture for a study in one call: the brand card, tracked rivals with share of voice and sentiment, and the candidates audits have proposed but you have not yet accepted.

POST /api/geo/competitors

Add a competitor by hand - tracked immediately, unlike a discovered candidate. PATCH /api/geo/competitors/{competitor_id} moves one between tracked, candidate and rejected; PATCH /bulk does it in one call.

{ "save_id": 42, "name": "Rival Co", "domain": "rival.com" }
GET /api/geo/competitors/strategy?save_id={id}

Product Strategy: your dossier and your featured rivals' side by side - USP, positioning, pricing, tone of voice, target customer - with every claim carrying the page it was read from. POST /api/geo/competitors/brand-dossier/refresh rebuilds your own; POST /api/geo/competitors/{competitor_id}/dossier/refresh rebuilds a rival's.

Schema.org
POST /api/geo/schema/generate

Generate schema.org JSON-LD for any URL. Synchronous - the JSON-LD is returned directly in the response.

{ "url": "https://example.com/page" }

Response:

{
  "url": "https://example.com/page",
  "schema_data": { "@context": "https://schema.org", "@type": "..." },
  "cached": true,
  "inference_ms": 0,
  "total_ms": 210
}
CSV Export & Looker Studio

Every audit and data view has a CSV export alongside its JSON and PDF options - use it to pull data into a spreadsheet, or wire it straight into a Looker Studio report so agencies can build client decks off live data.

GET /api/geo/reports/templates/{template_id}/export.csv

Keyword ranking trend for a visibility template - every tracked keyword, every run, with its average position that run.

GET /api/geo/brand_reports/templates/{template_id}/export.csv

Mention-volume and sentiment trend for a brand template - one row per scan.

GET /api/geo/backlinks/save/{save_id}/export.csv

Every inbound backlink for a study's primary site.

GET /api/geo/{audit}/{run_id}/export

Single-run CSV export, available on every audit (Visibility Reports, Brand Mentions, Site Pulse, Schema Audit, AI Vision, Fan-out, Reputation) - e.g. /api/geo/reports/501/export. /export/json is the JSON equivalent.

Looker Studio recipe: these are authenticated endpoints (X-API-Key), and Looker Studio's built-in CSV connector only fetches public URLs, so the direct-URL route doesn't work for it. Two options:

1. Community connector: use Looker Studio's "Generic URL" or a
   custom Apps Script connector that adds the X-API-Key header,
   then points at any export.csv URL above.

2. Publish-then-connect: run the export locally (curl with your
   key), drop the CSV into Google Sheets, and connect Looker
   Studio to the Sheet instead. Re-run + re-upload on a schedule
   for a "live enough" client report without exposing your API
   key in a public URL.

Example authenticated fetch:

curl -H "X-API-Key: bl_your_key" \
  "https://baselinelabs.ai/api/geo/reports/templates/12/export.csv" \
  -o keywords.csv
Error Responses

All errors return JSON with a detail field.

401 Bad or missing API key
402 Insufficient credits
429 Rate limited
404 Resource not found
George
Online
0%