{"openapi":"3.1.0","info":{"title":"Opcit API","version":"1.0.0","summary":"Analyze pages and sites for SEO, AEO, GEO, SXO and AIO.","description":"Analyses run asynchronously: start one, then poll it until it's done.\n\n- Authentication: `Authorization: Bearer <API key>`. Create keys in the dashboard.\n- Limits: 60 requests a minute per key; 3 analyses running at once per account; site analyses up to 500 pages (default 100).\n- Privacy: Opcit doesn't keep what you submit. A result is deleted 10 minutes after you first retrieve it, after 24 hours otherwise, or at once with DELETE.\n- Errors use RFC 9457 problem details; `type` is `https://opcit.ai/docs/errors#<code>`.\n- Ruleset version at publication: 2026.12.1.","contact":{"url":"https://opcit.ai"}},"servers":[{"url":"/v1","description":"The host serving this document"},{"url":"https://api.opcit.ai/v1","description":"Production API host"}],"security":[{"apiKey":[]}],"paths":{"/analyses":{"post":{"operationId":"createAnalysis","summary":"Start an analysis","parameters":[{"name":"wait","in":"query","description":"Page analyses: wait up to this many seconds (0–30) and return the result inline if it finishes in time.","schema":{"type":"integer","minimum":0,"maximum":30,"default":0}},{"name":"detail","in":"query","description":"How much of a finished report to return: `full` (default), `summary` (scores, summary, top fixes), `failing`, `category:<SEO|AEO|GEO|SXO|AIO>` or `metric:<ID>`.","schema":{"type":"string","default":"full","examples":["summary","failing","category:SEO","metric:SEO-001"]}},{"name":"Idempotency-Key","in":"header","description":"Retrying with the same key and body returns the analysis the first request started (24 hours).","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalysisRequest"},"examples":{"page":{"value":{"url":"https://example.com/pricing"}},"site":{"value":{"url":"https://example.com/","mode":"site","maxPages":50}}}}}},"responses":{"200":{"description":"Finished within `wait`","headers":{"RateLimit":{"description":"Remaining requests and seconds until the window resets (IETF RateLimit fields).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The limit and window.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Analysis"}}}},"202":{"description":"Accepted; poll `GET /analyses/{id}`","headers":{"RateLimit":{"description":"Remaining requests and seconds until the window resets (IETF RateLimit fields).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The limit and window.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Accepted"}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"402":{"description":"The account's spend cap is reached for this billing period","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"No active plan","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"A request with this Idempotency-Key is still in progress","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"The target can't be analyzed, or the Idempotency-Key was reused with another body","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or concurrent-analysis limit reached; see Retry-After","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Temporarily unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/analyses/{id}":{"get":{"operationId":"getAnalysis","summary":"Status, progress or result","description":"While running: status and progress. When finished: the report (or the failure). The result is deleted 10 minutes after the first successful retrieval.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"detail","in":"query","description":"How much of a finished report to return: `full` (default), `summary` (scores, summary, top fixes), `failing`, `category:<SEO|AEO|GEO|SXO|AIO>` or `metric:<ID>`.","schema":{"type":"string","default":"full","examples":["summary","failing","category:SEO","metric:SEO-001"]}}],"responses":{"200":{"description":"The analysis","headers":{"RateLimit":{"description":"Remaining requests and seconds until the window resets (IETF RateLimit fields).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The limit and window.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Analysis"}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"No active plan","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Unknown, expired or another account's analysis","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or concurrent-analysis limit reached; see Retry-After","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Temporarily unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"operationId":"deleteAnalysis","summary":"Cancel a running analysis or delete its result now","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"No active plan","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not found","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or concurrent-analysis limit reached; see Retry-After","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Temporarily unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/usage":{"get":{"operationId":"getUsage","summary":"Credits used this billing period","description":"Credits used since the period started, the included credits and the spend cap. Aggregates only.","responses":{"200":{"description":"Usage","headers":{"RateLimit":{"description":"Remaining requests and seconds until the window resets (IETF RateLimit fields).","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The limit and window.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"400":{"description":"Invalid request","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid API key","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"No active plan","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or concurrent-analysis limit reached; see Retry-After","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Internal error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Temporarily unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/metrics":{"get":{"operationId":"listMetrics","summary":"The metric catalog","security":[],"parameters":[{"name":"category","in":"query","schema":{"type":"string","enum":["SEO","AEO","GEO","SXO","AIO"]}},{"name":"phase","in":"query","schema":{"type":"string","enum":["v1","v2","v3","external"]}},{"name":"q","in":"query","description":"Text in the ID, name or description","schema":{"type":"string"}},{"name":"rulesetVersion","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Metrics","content":{"application/json":{"schema":{"type":"object","properties":{"rulesetVersion":{"type":"string"},"count":{"type":"integer"},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/Metric"}}}}}}},"404":{"description":"Unknown ruleset version","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/metrics/{id}":{"get":{"operationId":"getMetric","summary":"One metric with its rubric","security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","examples":["SEO-001"]}},{"name":"rulesetVersion","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"The metric","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}},"404":{"description":"Unknown metric or ruleset version","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An Opcit API key from the dashboard"}},"schemas":{"AnalysisRequest":{"type":"object","properties":{"url":{"description":"Public http(s) URL to analyze. Send `url` or `html`, not both.","type":"string","minLength":1,"maxLength":2048},"html":{"description":"Raw HTML to analyze as one page (2 MB at most). Metrics that need the live page are reported as not assessed.","type":"string","minLength":1,"maxLength":2000000},"mode":{"default":"page","description":"`page` analyzes one page; `site` samples the site from its home page.","type":"string","enum":["page","site"]},"categories":{"description":"Categories to analyze. Default: all five.","minItems":1,"maxItems":5,"type":"array","items":{"type":"string","enum":["SEO","AEO","GEO","SXO","AIO"]}},"maxPages":{"description":"Site analyses: pages to analyze (default 100, at most 500).","type":"integer","minimum":1,"maximum":500},"llm":{"default":true,"description":"Include AI-judged checks (default). `false` runs deterministic checks only.","type":"boolean"}},"additionalProperties":false},"Accepted":{"type":"object","required":["id","status","pollAfterMs"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","done","failed"]},"pollAfterMs":{"type":"integer","description":"Suggested wait before polling"}}},"Analysis":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","done","failed"]},"progress":{"type":"object","properties":{"stage":{"type":"string"},"done":{"type":"integer"},"total":{"type":"integer"}}},"pollAfterMs":{"type":"integer"},"report":{"description":"With `detail=full`, a Report; other details return the corresponding subset.","oneOf":[{"$ref":"#/components/schemas/Report"},{"type":"object"}]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"Report":{"type":"object","properties":{"schemaVersion":{"type":"number","const":1},"rulesetVersion":{"type":"string"},"engineVersion":{"type":"string"},"analyzedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"mode":{"type":"string","enum":["page","site"]},"target":{"type":"object","properties":{"kind":{"type":"string","enum":["url","html"]},"url":{"type":"string"},"finalUrl":{"type":"string"}},"required":["kind"],"additionalProperties":false},"overallScore":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"categories":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","enum":["SEO","AEO","GEO","SXO","AIO"]},"score":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"coverage":{"type":"number","minimum":0,"maximum":1},"assessedWeight":{"type":"number"},"applicableWeight":{"type":"number"},"counts":{"type":"object","properties":{"pass":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fail":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"notApplicable":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"notAssessed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["pass","fail","notApplicable","notAssessed","error"],"additionalProperties":false},"insufficientData":{"type":"boolean"}},"required":["category","score","coverage","assessedWeight","applicableWeight","counts","insufficientData"],"additionalProperties":false}},"metrics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string","enum":["SEO","AEO","GEO","SXO","AIO"]},"status":{"type":"string","enum":["pass","fail","not_applicable","not_assessed","error"]},"score":{"anyOf":[{"type":"integer","minimum":0,"maximum":5},{"type":"null"}]},"passingScore":{"type":"integer","minimum":0,"maximum":5},"weight":{"type":"integer","minimum":1,"maximum":5},"confidence":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}]},"evidence":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":["string","number","boolean"]},"url":{"type":"string"},"selector":{"type":"string"},"quote":{"type":"string","maxLength":500}},"required":["label"],"additionalProperties":false}},"reason":{"type":"string","enum":["needs_owner_data","needs_v2_data","needs_process_evidence","needs_render","render_failed","render_incomplete","needs_psi","needs_llm","needs_site_mode","needs_question_list","language_unsupported","blocked_by_robots","fetch_failed","html_input","tool_unavailable","not_implemented"]},"message":{"type":"string"},"meanScore":{"type":"number","minimum":0,"maximum":5},"pages":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"score":{"type":"integer","minimum":0,"maximum":5}},"required":["url","score"],"additionalProperties":false}}},"required":["id","category","status","score","passingScore","weight","confidence","evidence"],"additionalProperties":false}},"fixPlan":{"type":"array","items":{"type":"object","properties":{"metricId":{"type":"string"},"priority":{"type":"number"},"score":{"type":"integer","minimum":0,"maximum":5},"passingScore":{"type":"integer","minimum":0,"maximum":5},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"impact":{"type":"string","enum":["low","medium","high"]},"effort":{"type":"string","enum":["low","medium","high"]},"note":{"type":"string"},"fixPrompt":{"type":"string"}},"required":["metricId","priority","score","passingScore","weight"],"additionalProperties":false}},"site":{"type":"object","properties":{"urlsDiscovered":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pagesFetchedInCrawl":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"crawlCapped":{"type":"boolean"},"pagesAnalyzed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pagesFailed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pages":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"overallScore":{"type":["number","null"]},"categories":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","enum":["SEO","AEO","GEO","SXO","AIO"]},"score":{"type":["number","null"]}},"required":["category","score"],"additionalProperties":false}}},"required":["url","overallScore","categories"],"additionalProperties":false}}},"required":["urlsDiscovered","pagesFetchedInCrawl","crawlCapped","pagesAnalyzed","pagesFailed","pages"],"additionalProperties":false},"summary":{"type":"object","properties":{"text":{"type":"string"},"model":{"type":"string"}},"required":["text","model"],"additionalProperties":false},"browser":{"type":"object","properties":{"provider":{"type":"string"},"version":{"type":"string"}},"required":["provider","version"],"additionalProperties":false},"durationMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"requestCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["schemaVersion","rulesetVersion","engineVersion","analyzedAt","mode","target","overallScore","categories","metrics","fixPlan","durationMs","requestCount"],"additionalProperties":false},"Usage":{"type":"object","properties":{"plan":{"type":"string"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":["string","null"],"format":"date-time"},"creditsUsed":{"type":"integer"},"includedCredits":{"type":["integer","null"],"description":"null: unlimited plan"},"spendCapCredits":{"type":["integer","null"],"description":"null: no cap"},"capReached":{"type":"boolean"}}},"Metric":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string"},"subcategory":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"weight":{"type":"integer","minimum":1,"maximum":5},"passingScore":{"type":"integer","minimum":0,"maximum":5},"phase":{"type":"string"},"v1Coverage":{"type":"string"},"method":{"type":"string"},"whyImportant":{"type":"string"},"fix":{"type":"string"},"measure":{"type":"string"},"levels":{"type":"object","additionalProperties":{"type":"string"}},"source":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}}}}},"Problem":{"type":"object","required":["type","title","status"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"errors":{"type":"array","items":{"type":"object"}}}}}}}