Errors
Both endpoints use plain HTTP status codes, and every error comes with a small JSON body telling you what went wrong.
Status codes
Section titled “Status codes”| Status | Meaning | Body |
|---|---|---|
200 | Success — the logo image (img.anylogo.dev) or the company JSON (api.anylogo.dev). | Image or JSON |
400 | The domain is malformed — for example a full URL, a path, or something that isn’t a domain at all. | {"error":"invalid domain"} |
404 | No logo is available for the domain (logo endpoint), or the site could not be reached (company endpoint). | JSON with an error field |
# 400 — malformed domain (both endpoints){ "error": "invalid domain" }
# 404 on img.anylogo.dev — no logo available{ "error": "no logo found", "domain": "example.com" }
# 404 on api.anylogo.dev — the site could not be reached{ "error": "site unreachable" }404s aren’t forever
Section titled “404s aren’t forever”A miss is re-checked periodically — roughly weekly. If a logo or company record becomes available later, the exact same URL starts returning it. You don’t need to do anything: keep the URL in place and it heals itself.
Caching
Section titled “Caching”Successful logo responses are cached for a day in the browser and a week at the edge (Cache-Control: public, max-age=86400, s-maxage=604800). Error responses are not cached long-term, so once a domain starts resolving, you see the result promptly.
Handling misses in the browser
Section titled “Handling misses in the browser”Because the logo endpoint returns a real HTTP 404, an img tag pointing at a missing logo fires its onerror handler — the natural place to swap in initials or a placeholder.
<!-- graceful fallback in the browser: a 404 fires onerror --><img src="https://img.anylogo.dev/example.com" onerror="this.replaceWith(myPlaceholder())">