Get the icon of any website by domain. No API key, no signup, no attribution.
<img src="https://logoapi.sh/icon/github.com" alt="" width="32" height="32">- URL pattern:
https://logoapi.sh/icon/{domain} - Order: a clean SVG icon if the brand is in our catalog, else the site's own favicon (ICO, PNG or SVG), else a letter tile.
- Clean miss: add
?fallback=404to get HTTP 404 instead of the tile, so your own placeholder shows. - Which one you got: the
X-Logo-Fallbackresponse header saysfaviconortile. No header means a catalog icon. - Dark mode:
https://logoapi.sh/dark/icon/{domain}for catalog icons. - Limits: free up to 2M requests a month per site. CDN,
Access-Control-Allow-Origin: *.
| Domain | Result |
|---|---|
github.com |
catalog SVG icon |
news.ycombinator.com |
site favicon |
jvns.ca (small blog) |
site favicon (ICO) |
allbirds.com (Shopify store) |
site favicon (PNG) |
| a dead or unknown domain | letter tile, or 404 with ?fallback=404 |
npm i favicon-apiconst { faviconUrl } = require('favicon-api');
faviconUrl('https://www.github.com/logoapi'); // https://logoapi.sh/icon/github.com
faviconUrl('jvns.ca', { fallback: '404' }); // ...icon/jvns.ca?fallback=404
faviconUrl('stripe.com', { dark: true }); // ...dark/icon/stripe.comIt only builds URLs. No network calls, no dependencies.
<!doctype html>
<ul id="list"></ul>
<script>
const links = ["https://github.com", "https://news.ycombinator.com", "https://jvns.ca", "https://allbirds.com"];
for (const url of links) {
const host = new URL(url).hostname.replace(/^www\./, "");
const li = document.createElement("li");
const img = new Image(16, 16);
img.alt = "";
img.src = `https://logoapi.sh/icon/${host}?fallback=404`;
img.onerror = () => { img.replaceWith(document.createTextNode(host[0].toUpperCase() + " ")); };
li.append(img, " ", url);
document.getElementById("list").append(li);
}
</script>More: logoapi.sh/favicon. Company logos, stock tickers and crypto: logoapi/logo-api, logoapi/crypto-logos.
Code and docs: MIT. Icons belong to their sites and are trademarks of their owners. Owners can ask for a change or removal at https://logoapi.sh/claim.