{"openapi":"3.1.0","info":{"title":"Link Intelligence API","version":"0.1.0","description":"URL in, link-health verdict out. Detects soft-404s (alive | moved | parked | out_of_stock | dead), finds replacements within allowedDomains, and returns a full evidence trace you can audit and reproduce."},"servers":[{"url":"https://li-api.mkotsollari.workers.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your li_live_… API key."}},"schemas":{"Classification":{"type":"string","enum":["alive","moved","parked","out_of_stock","dead"]},"Evidence":{"type":"object","description":"Full \"show your work\" trace — fetch, extracted page, signals, decision.","properties":{"engineVersion":{"type":"string"},"fetch":{"type":"object","properties":{"requestedUrl":{"type":"string"},"finalUrl":{"type":"string"},"httpStatus":{"type":"integer"},"redirected":{"type":"boolean"},"durationMs":{"type":"integer"},"error":{"type":"string"}}},"page":{"type":"object","properties":{"title":{"type":["string","null"]},"canonical":{"type":["string","null"]},"contentHash":{"type":["string","null"]},"bodyExcerpt":{"type":"string"}}},"signals":{"type":"object","additionalProperties":true},"decision":{"type":"object","properties":{"method":{"type":"string","enum":["heuristic","llm_tiebreak"]},"confidence":{"type":"number"},"reachable":{"type":"boolean"}}},"raw":{"description":"Full raw fetch payload — only when includeRaw=true."}}},"CheckResult":{"type":"object","properties":{"url":{"type":"string"},"finalUrl":{"type":"string"},"status":{"$ref":"#/components/schemas/Classification"},"confidence":{"type":"number"},"method":{"type":"string","enum":["heuristic","llm_tiebreak"]},"reachable":{"type":"boolean"},"signals":{"type":"object","additionalProperties":true},"evidence":{"$ref":"#/components/schemas/Evidence"}}},"HealResult":{"allOf":[{"$ref":"#/components/schemas/CheckResult"},{"type":"object","properties":{"healed":{"type":"boolean"},"href":{"type":"string"},"hrefSource":{"type":"string","enum":["replacement","fallback","original"]},"replacement":{"type":"string"},"resolveConfidence":{"type":"number"},"coverage":{"type":"object","additionalProperties":true}}}]},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}},"paths":{"/v1/check":{"post":{"summary":"Classify a single URL","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"includeRaw":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Verdict + evidence","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckResult"}}}},"401":{"description":"Missing/invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/heal":{"post":{"summary":"Classify + find a replacement within allowedDomains","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","allowedDomains"],"properties":{"url":{"type":"string","format":"uri"},"allowedDomains":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":20},"context":{"type":"string"},"fallbackUrl":{"type":"string","format":"uri"},"minConfidence":{"type":"number","minimum":0,"maximum":1},"includeRaw":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Verdict + replacement (fail-open cascade) + evidence","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealResult"}}}}}}},"/v1/batch":{"post":{"summary":"Classify many URLs in one call","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["urls"],"properties":{"urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":50},"includeRaw":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Per-URL results","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"ok":{"type":"boolean"},"result":{"$ref":"#/components/schemas/CheckResult"},"error":{"type":"string"}}}}}}}}}}}},"/v1/capabilities":{"get":{"summary":"What this deployment supports (features, classifications)","responses":{"200":{"description":"Capabilities"}}}}}}