Ta strona jest dostępna tylko po angielsku.

AI visibility API

Ask AI answer engines a question and see whether a brand is mentioned and cited, at what position and in what tone, next to which competitors, and which URLs they cite.

How it works

  1. POST /v1/check with a question, a brand and the engines to ask. The price is taken from your balance up front and you get a check id (202).
  2. Poll GET /v1/checks/{id} until it finishes. Each engine answers samples times; failed answers are refunded automatically.
  3. Read the rates per engine. Every rate comes with its sample count, and the mention rate with a Wilson 95% interval.

Base URL https://api.sagbot.app, token as Authorization: Bearer sgb_… (get a token). GET /v1/engines and GET /v1/health need no token.

Engines and prices

You pay per answer: one engine, one sample. A check costs the sum of price × samples over its engines. Without engines, a check asks the five default engines: chatgpt, google_aio, gemini, google_ai_mode and perplexity.

Engine idLabelSurfacePer answer
chatgptChatGPTui$0.035
google_aioGoogle AI Overviewsui$0.035
geminiGeminiui$0.035
google_ai_modeGoogle AI Modeui$0.035
perplexityPerplexityapi$0.035
claudeClaudeapi$0.06
chatgpt_apiChatGPT (API)api$0.06
gemini_apiGemini (API)api$0.06

ui: the answer a logged-out user sees in the product. api: the model through its API, with web search on.

GET /v1/enginesno token

The live catalog, sorted by share of AI referral traffic: id, label, surface (ui: what a logged-out user sees in the product; api: the model through its API with web search on), vendor, price_usd, traffic_rank, default, status (ok, degraded or off) and supports (country, language, citations, fan-out, sponsored).

curl https://api.sagbot.app/v1/engines

Create a check

POST /v1/check202, or 200 for a dry run

FieldTypeDescription
querystring, requiredThe question, 1 to 300 characters
brand.namestring, required1 to 100 characters
brand.domainstringA host such as sagbot.app; citations on it or its subdomains count as cited
brand.aliasesstring[]Other names of the brand, up to 10
competitorsstring[]Up to 10 names, each reported with its own rates
enginesstring[]Distinct engine ids. Default: the five default engines
countrystringISO 3166-1 alpha-2, default US. The list is in openapi.yaml
languagestringISO 639-1, optionally with a region (en, pt-BR). Default en
samplesinteger1 to 5, default 1. More samples give a mention rate with a narrower interval
includestring[]["raw"] adds each answer's text to the result
dry_runbooleantrue returns the price and charges nothing

Send an Idempotency-Key header (1 to 64 characters, your own id for this check) to retry safely: a repeat with the same key returns the same check, id and cost, and is never charged twice. After a 402, top up and use a new key.

curl https://api.sagbot.app/v1/check \
  -H "Authorization: Bearer $SAGBOT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: weekly-2026-11-17-sagbot" \
  -d '{
    "query": "best tool to check if my website is ready for ai agents",
    "brand": { "name": "SagBot", "domain": "sagbot.app" },
    "competitors": ["Acme Audit"],
    "engines": ["chatgpt", "perplexity"],
    "samples": 3
  }'

202: charged and queued. X-Cost-USD and X-Balance-USD show the price and your balance after paying.

{ "id": "chk_0f8e6c1d2b3a49e8a7c6b5d4e3f2a1b0", "status": "queued", "cost_usd": 0.21 }

With "dry_run": true: 200 and the price, line by line.

{
  "cost_usd": 0.21,
  "lines": [
    { "engine": "chatgpt", "samples": 3, "unit_usd": 0.035, "usd": 0.105 },
    { "engine": "perplexity", "samples": 3, "unit_usd": 0.035, "usd": 0.105 }
  ]
}

Get a check

GET /v1/checks/{id}

Poll until status is done, partial (some answers failed and were refunded) or failed; before that it is queued or running and results is null. Only the token's owner can read a check; anyone else gets 404.

curl https://api.sagbot.app/v1/checks/chk_0f8e6c1d2b3a49e8a7c6b5d4e3f2a1b0 \
  -H "Authorization: Bearer $SAGBOT_TOKEN"
{
  "id": "chk_0f8e6c1d2b3a49e8a7c6b5d4e3f2a1b0",
  "status": "done",
  "created_at": "2026-11-17T09:41:07.000Z",
  "finished_at": "2026-11-17T09:42:31.000Z",
  "cost_usd": 0.21,
  "refunded_usd": 0,
  "request": {
    "query": "best tool to check if my website is ready for ai agents",
    "brand": { "name": "SagBot", "domain": "sagbot.app", "aliases": [] },
    "competitors": ["Acme Audit"],
    "engines": ["chatgpt", "perplexity"],
    "country": "US",
    "language": "en",
    "samples": 3,
    "include": []
  },
  "results": [
    {
      "engine": "chatgpt",
      "surface": "ui",
      "model": "chatgpt",
      "samples": 3,
      "samples_ok": 3,
      "mentioned_rate": 0.67,
      "ci95": [0.21, 0.94],
      "cited_rate": 0.33,
      "avg_position": 1,
      "surface_present_rate": 1,
      "web_search_rate": null,
      "sample_flags": [
        { "sample": 1, "no_web_search": false, "no_citations": false,
          "sentiment": { "brand": "positive", "competitors": [null] } },
        { "sample": 2, "no_web_search": false, "no_citations": false,
          "sentiment": { "brand": "neutral", "competitors": ["neutral"] } },
        { "sample": 3, "no_web_search": false, "no_citations": true, "sentiment": null }
      ],
      "fan_out": ["ai agent readiness checker website"],
      "competitors": [{ "name": "Acme Audit", "mentioned_rate": 0.33, "avg_position": 2 }],
      "sentiment": {
        "brand": { "positive": 1, "neutral": 1, "negative": 0 },
        "competitors": [{ "positive": 0, "neutral": 1, "negative": 0 }]
      },
      "citations": [
        { "url": "https://sagbot.app/", "title": "SagBot", "domain": "sagbot.app", "count": 1, "brand": true }
      ],
      "errors": []
    }
  ]
}

Result fields

One entry per engine in results. Rates are over the answers that succeeded (samples_ok), and null when none did.

FieldDescription
surfaceui or api, as in the engine catalog
modelThe model the supplier reported (or the engine id); null only when no answer succeeded
samples, samples_okAnswers asked for, and answers that came back
mentioned_rateShare of answers that mention the brand (or an alias)
ci95Wilson 95% interval of mentioned_rate
cited_rateShare of answers citing brand.domain
avg_positionMean rank of the brand's first mention among brand and competitors; 1 = first
surface_present_rateShare of answers where the surface appeared at all (Google shows no AI Overview for many queries)
web_search_rateShare of answers where the model searched the web; null when the supplier doesn't say (UI engines)
sample_flagsPer answer: no_web_search and no_citations, so "not cited" is never read as "didn't search"; sentiment: the answer's tone toward the brand and each competitor (below), null when it names none of them or the tone couldn't be read
fan_outThe web searches the engine ran to answer; empty when it doesn't report them
competitorsname, mentioned_rate, avg_position per competitor
sentimentHow the answers talk about the brand and each competitor (request order): counts of positive (recommends or praises), neutral (lists or describes) and negative (criticises or warns against). Only answers whose tone was read count; a missing label is null (unknown), never neutral. Included in the price per answer; absent on older checks
citationsCited URLs, most cited first: url, title, domain, count (answers citing it), brand (on brand.domain)
errorsFailed answers: sample and code (timeout or upstream_error); each was refunded
rawOnly with include: ["raw"]: each answer's text, null for failed ones

AI citations lookup

Find the ChatGPT and Google AI Overviews answers that already cite or mention a page, a domain or a keyword. With several targets, an answer must match every target that isn't excluded, so to compare pages, run one lookup per page. Unlike a check, nothing is asked live: the answers were collected earlier for common questions, so a lookup returns in a few seconds, but the questions aren't yours to choose.

POST /v1/mentions200

FieldTypeDescription
targetsobject[], required1 to 10 targets, each with exactly one of url, domain or keyword. An answer must match all the targets without exclude
targets[].urlstringAn absolute http or https URL of a page, without user:password@ or a port
targets[].include_subpathsbooleanurl only: every page under the URL's path. The URL then has no query string
targets[].domainstringA domain such as sagbot.app, up to 63 characters
targets[].include_subdomainsbooleandomain only: its subdomains too
targets[].keywordstringA brand or product name, 1 to 250 characters, matched as a whole word
targets[].excludebooleanLeave out answers that match this target. At least one target is not excluded
countrystringISO 3166-1 alpha-2, default US; the same list as checks
languagestringISO 639-1, two letters, not case-sensitive, default en
dry_runbooleantrue returns the price and charges nothing

A lookup costs $0.49 from your balance. Your first lookup is free. When nothing is found, a paid lookup gets $0.24 back, so it costs $0.25 (a free one still counts as used). ChatGPT data covers the United States in English only: other countries and languages return Google AI Overviews answers only, and counts.chatgpt is null.

You get up to 100 answers, most-asked questions first (by AI search volume), ChatGPT answers before Google ones: 50 from each for US and en, otherwise 100 from Google AI Overviews. A site hidden by its owner or SagBot is refused (403, not charged) unless you are its verified owner; so is a domain that is a public suffix (such as github.io) and a keyword that is a hidden site's host. The same Idempotency-Key rules as checks apply.

curl https://api.sagbot.app/v1/mentions \
  -H "Authorization: Bearer $SAGBOT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: citations-2026-11-24-blog" \
  -d '{
    "targets": [
      { "url": "https://sagbot.app/blog/", "include_subpaths": true },
      { "domain": "acme-audit.com", "include_subdomains": true }
    ],
    "country": "US",
    "language": "en"
  }'

200: X-Cost-USD is what you paid after any refund; X-Balance-USD your balance after paying.

{
  "id": "mnt_5b0c6f1e2d3a4b5c6d7e8f9a0b1c2d3e",
  "created_at": "2026-11-24T12:00:00.000Z",
  "cost_usd": 0.49,
  "free": false,
  "refunded_usd": 0,
  "request": {
    "targets": [
      { "url": "https://sagbot.app/blog/", "include_subpaths": true },
      { "domain": "acme-audit.com", "include_subdomains": true }
    ],
    "country": "US",
    "language": "en"
  },
  "counts": {
    "chatgpt": { "returned": 12, "total": 12 },
    "google_aio": { "returned": 50, "total": 214 },
    "by_target": [9, 55]
  },
  "mentions": [
    {
      "platform": "chatgpt",
      "question": "how do I check if my website is ready for ai agents",
      "answer": "A few tools check this for you …",
      "cited_urls": ["https://sagbot.app/blog/ai-agent-readiness"],
      "matched_targets": [0],
      "ai_search_volume": 320,
      "first_seen": "2026-10-02",
      "last_seen": "2026-11-20"
    }
  ]
}
FieldDescription
cost_usd, free, refunded_usdThe price taken (0 for the free lookup) and the refund when nothing was found
counts.chatgpt, counts.google_aioreturned answers and the total that matched; returned under total means the list was cut. null when not asked
counts.by_targetPer target, in request order: how many returned answers match it (0 for excluded targets)
mentions[].platformchatgpt or google_aio, the engine ids of checks
mentions[].question, answerThe question asked and the full answer (Markdown)
mentions[].cited_urlsThe URLs the answer cites
mentions[].matched_targetsIndexes into request.targets this answer matches, computed by SagBot: a cited URL equal to the target (or under its path with include_subpaths), a cited domain (or subdomain), or the keyword in the question or answer
mentions[].ai_search_volumeHow often the question is asked of AI; null when unknown
mentions[].first_seen, last_seenDates (YYYY-MM-DD) the answer was first and last seen, or null

With "dry_run": true: 200 and what this lookup would cost; free: true while your first lookup is unused.

{ "cost_usd": 0, "free": true }

GET /v1/mentions/{id}

The stored lookup, same body as the 200 above. Only the token's owner can read it; anyone else gets 404.

curl https://api.sagbot.app/v1/mentions/mnt_5b0c6f1e2d3a4b5c6d7e8f9a0b1c2d3e \
  -H "Authorization: Bearer $SAGBOT_TOKEN"

Usage and balance

GET /v1/usage?days=30

What you spent on AI visibility per day and engine; refunded answers are not counted. days is 1 to 90, default 30. AI citations lookups aren't included.

curl "https://api.sagbot.app/v1/usage?days=30" -H "Authorization: Bearer $SAGBOT_TOKEN"

{
  "days": 30,
  "total_usd": 0.21,
  "rows": [
    { "day": "2026-11-17", "engine": "chatgpt", "samples": 3, "usd": 0.105 },
    { "day": "2026-11-17", "engine": "perplexity", "samples": 3, "usd": 0.105 }
  ]
}

GET /v1/balancefree

Your prepaid balance, also in X-Balance-USD. Never charged: read it before a paid check or lookup. The MCP tool get_balance does the same.

curl https://api.sagbot.app/v1/balance -H "Authorization: Bearer $SAGBOT_TOKEN"

{ "balance_usd": 9.89 }

Engine health

GET /v1/healthno token

Success rate and p95 latency (successful answers only) per engine over the last 24 hours, one entry per engine. Cached for 60 seconds.

curl https://api.sagbot.app/v1/health

{
  "window_hours": 24,
  "engines": [
    { "engine": "chatgpt", "status": "ok", "success_rate": 0.98, "p95_ms": 41000 }
  ]
}

Errors and limits

Errors use the shared shape { "error": { "code", "message", "request_id" } }, plus top_up_url on a 402.

StatuscodeWhen
400invalid_requestBad body, parameter or Idempotency-Key, or a lookup url with user:password@ or a port; the message says which
401unauthorizedMissing, unknown or revoked token
402insufficient_balanceThe check or lookup costs more than your balance; top up at top_up_url and retry with a new Idempotency-Key
403site_hiddenA lookup target is on a site hidden by its owner or SagBot and you aren't its verified owner, or is a public suffix such as github.io; not charged
404not_foundUnknown check or lookup id, or one that isn't yours
409in_progressA lookup with the same Idempotency-Key is still running; retry in a few seconds
413body_too_largeBody over 16 KB
429rate_limitedToo many requests, or too many lookups on your account; wait a minute
502upstream_failedThe lookup couldn't read the AI answers; nothing charged (refunded, or the free lookup given back). Retry with a new Idempotency-Key

Limits: 10 paid checks a minute per token (dry runs don't count), 10 lookups a minute per account, and 60 authenticated requests a minute per IP address.