Favicon CDN
Free global CDN for website favicons
REST Countries finds the icon for any public domain name and serves it from a free global CDN. One stable HTTPS URL per domain, across 330+ edge nodes, with no account or API key required.
How to generate CDN URLs
The URL is the same shape every time, so you can build it in your own code from a domain you already have. The generator below is only there to check the result before you use it.
Take the domain
Remove everything except the domain, so https://stripe.com/pricing becomes stripe.com.
Add it to the base URL
Put the domain at the end of https://favicon.restcountries.com/v1. That is the whole URL.
Use it as an image
Use the URL in an image tag or a CSS background, at whatever size your layout needs.
Generate a favicon URL
Enter a domain or paste a full web address. As soon as it looks like a domain, the preview, CDN URL, and snippets below update from it.
Drop-in snippets
Copy the current favicon URL as an HTML image or a CSS background. Both snippets follow the generator, so they always match the domain you entered.
<img src="https://favicon.restcountries.com/v1/stripe.com" alt="stripe.com favicon" width="32" height="32">
.favicon {
width: 32px;
height: 32px;
background-image: url("https://favicon.restcountries.com/v1/stripe.com");
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
}
Example URLs
The same URL shape for every domain. The last row is a name that will never have an icon, so you can see what happens when there is nothing to show.
What you get back
You always get an image back, which is what makes
the URL safe to use directly in an img tag.
There is no error body to handle and nothing to
branch on.
- A real icon is cached for seven days. Sites almost never change their favicon, so there is no reason to ask again sooner.
- A domain with no icon gets a plain globe instead, cached for an hour, so a site that adds one later starts showing it the same day.
- Something that is not a domain gets the same globe, cached for a week, since a typo is never going to start working.
- Query parameters are ignored. Nothing you add to the URL changes what comes back, so everyone shares one cached copy per domain.
Icons come back around 64px, but the exact size varies from site to site. Set the size you want in your own CSS rather than assuming a fixed one.
How delivery works
Requests are served from Cloudflare, so a domain's icon is fetched once no matter how many sites ask for it.
Delivery is cookie free and GDPR compliant. The CDN can be used anonymously, without a REST Countries account, and with no tracking added to icon requests.
Cloudflare edge
Visitors are routed to nearby Cloudflare edge nodes, where one cached copy per domain serves every caller.
Cached by domain
Each domain gets one cached copy, kept for up to seven days, and everyone asking for it gets that same copy.
Always an image
A domain with no icon gets a plain globe instead, so you always get something the browser can render.
Terms of Use
Favicons are the logos and trademarks of the sites they belong to. REST Countries does not own them and grants no rights over them. The CDN is a delivery convenience, not a license.
Use them the way a browser does, to identify the site they represent, in link lists, search results, integration pickers, and similar places. Do not use them to imply endorsement by, or affiliation with, the site an icon belongs to. If a site publishes brand guidelines, follow those.
Attribution to REST Countries is not required, but we ask that public-facing uses link back to restcountries.com when practical.
Help shape the Favicon CDN
The CDN is meant to grow around real use cases. Tell REST Countries what would help: a different icon size, a way to supply your own placeholder, or a domain whose icon keeps coming back wrong.
We cannot promise every request will be built, but the roadmap is collaborative: practical requests make it easier to prioritize what gets added next.