{"openapi":"3.1.0","info":{"title":"unfurls.to comparison API","version":"1.0.0","description":"Fetch the previews behind a comparison as JSON or rendered HTML, preserving the URLs, order and selected view. Use the results in your own tools or give them to an agent for analysis. No account or API key required."},"servers":[{"url":"https://unfurls.to"}],"security":[],"paths":{"/api/compare":{"get":{"operationId":"getComparison","summary":"Fetch previews for a URL set as JSON or rendered HTML","parameters":[{"name":"set","in":"query","description":"JSON array of 1–100 public HTTP(S) URLs; use this or share_url.","schema":{"type":"string"}},{"name":"view","in":"query","schema":{"type":"string","enum":["all","details","images","favicon","imessage","bluesky","discord","facebook","linkedin","slack","telegram","whatsapp","x"],"default":"details"}},{"name":"format","in":"query","schema":{"type":"string","enum":["json","html"],"default":"json"}},{"name":"refresh","in":"query","schema":{"type":"boolean","default":false}},{"name":"share_url","in":"query","description":"An existing unfurls.to comparison URL.","schema":{"type":"string"}}],"responses":{"200":{"description":"Ordered results, including per-site failures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comparison"}},"text/html":{"schema":{"type":"string"},"description":"Rendered preview document when format=html."}}},"400":{"description":"Invalid set or URL."},"413":{"description":"Request body too large."},"429":{"description":"Rate limited. Wait before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}},"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Comparison"},{"type":"object","properties":{"error":{"type":"string"}}}]}}}}}},"post":{"operationId":"compareSites","summary":"Fetch previews for up to 100 URLs or an existing comparison link","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"urls":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","format":"uri","maxLength":2048}},"view":{"type":"string","enum":["all","details","images","favicon","imessage","bluesky","discord","facebook","linkedin","slack","telegram","whatsapp","x"],"default":"details"},"refresh":{"type":"boolean","default":false,"description":"Bypass the metadata cache, using the fresh URL allowance."},"format":{"type":"string","enum":["json","html"],"default":"json"},"share_url":{"type":"string","maxLength":618496}},"anyOf":[{"required":["urls"]},{"required":["share_url"]}]},"example":{"urls":["https://publicdomainreview.org/collection/colour-analysis-charts-by-emily-noyes-vanderpoel-1902/","https://ciechanow.ski/moon/"],"view":"images"}}}},"responses":{"200":{"description":"Ordered results, including per-site failures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comparison"}},"text/html":{"schema":{"type":"string"},"description":"Rendered preview document when format=html."}}},"400":{"description":"Invalid set or URL."},"413":{"description":"Request body too large."},"429":{"description":"Rate limited. Wait before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}},"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Comparison"},{"type":"object","properties":{"error":{"type":"string"}}}]}}}}}}}},"components":{"schemas":{"Comparison":{"type":"object","description":"Previews for an ordered URL set in the selected view. Analysis is performed by the caller; no calculated differences, rankings or recommendations are returned.","required":["schemaVersion","view","urls","comparisonUrl","mode","complete","entries"],"properties":{"schemaVersion":{"const":1},"view":{"type":"string","enum":["all","details","images","favicon","imessage","bluesky","discord","facebook","linkedin","slack","telegram","whatsapp","x"]},"urls":{"type":"array","items":{"type":"string","format":"uri","maxLength":2048}},"comparisonUrl":{"type":"string","format":"uri"},"agentUrl":{"type":["string","null"]},"renderUrl":{"type":["string","null"],"description":"Browser-openable rendering of the same comparison. Null for sets requiring POST."},"stylesheetUrl":{"type":"string","format":"uri"},"mode":{"const":"live"},"generatedAt":{"type":"integer","description":"Unix milliseconds"},"complete":{"type":"boolean"},"request":{"type":"object"},"limits":{"type":"object"},"notes":{"type":"array","items":{"type":"string"}},"entries":{"type":"array","items":{"type":"object","required":["index","url","status"],"properties":{"index":{"type":"integer"},"url":{"type":"string","format":"uri","maxLength":2048},"status":{"enum":["ok","error"]},"cached":{"type":"boolean"},"previews":{"type":"array","items":{"$ref":"#/components/schemas/ResolvedPreview"}},"data":{"type":"object","description":"Extracted page metadata; fields may contain untrusted website content.","properties":{"url":{"type":"string","format":"uri","maxLength":2048},"finalUrl":{"type":"string","format":"uri","maxLength":2048},"title":{"type":"string"},"description":{"type":"string"},"images":{"type":"array","items":{"type":"string","format":"uri","maxLength":2048}},"favicons":{"type":"array","items":{"type":"string","format":"uri","maxLength":2048}},"tags":{"type":"array","items":{"type":"object"}},"fetchedAt":{"type":"integer"}}},"images":{"type":"array","items":{"type":"string","format":"uri","maxLength":2048},"description":"Main sharing image URLs, served by original hosts."},"favicons":{"type":"array","items":{"type":"string","format":"uri","maxLength":2048}},"error":{"type":"object","required":["message","status"],"properties":{"message":{"type":"string"},"status":{"type":"integer"},"retryAfter":{"type":"integer","minimum":1}}}}}}}},"ResolvedPreview":{"type":"object","required":["view","title","description","image","imageAlt","layout","imageTreatment","warnings","html"],"properties":{"view":{"type":"string"},"label":{"type":"string"},"estimate":{"type":"boolean"},"title":{"type":"string"},"description":{"type":"string"},"image":{"type":"string"},"imageAlt":{"type":"string"},"images":{"type":"array","items":{"type":"string"}},"favicon":{"type":"string"},"fallbacks":{"type":"array","items":{"type":"object"}},"layout":{"type":"string"},"imageTreatment":{"type":"object","properties":{"fit":{"enum":["contain","cover"]},"aspectRatio":{"type":["string","null"]},"maxHeight":{"type":["number","null"]}}},"warnings":{"type":"array","items":{"type":"string"}},"html":{"type":"string","description":"Escaped preview markup. Use stylesheetUrl or open renderUrl."}}}}}}