max bo

🌱 favicon.garden

favicon.garden is a favicon API and cache. It is free, open-source and has no rate limits.

You can load the favicon of a website by prepending the URL with https://favicon.garden/:

<img src="proxy.php?url=https%3A%2F%2Ffavicon.garden%2Fgoogle.com" class='favicon' />

renders , where .favicon is defined as

.favicon {
  display: inline;
  vertical-align: middle;
  width: 1.7ch;
  height: 1.7ch;
}

favicon.icon chases redirects and assumes https:// if no protocol is provided.

https://favicon.garden/google.com
https://favicon.garden/www.google.com
https://favicon.garden/https://google.com

favicon.garden was inspired by Gwern's use of link icons, and InvertOrNot (which itself was also inspired by Gwern).

favicon.garden is backed by Cloudflare Workers.

Wait, can't I just append /favicon.ico to the domain I want the favicon of?

Sometimes. You can if the URL you're interested in getting the favicon for doesn't have a path or query, but if it does, you're going to have to track down the correct <link rel="icon" href="proxy.php?url=https%3A%2F%2Ffavicon.garden%2F..."> in the HTML! That's a lot of busy work if you're writing a long article with lots of links!

Additionally, in articles I've written where I've used a lot of favicons, a surprising number of them don't load, or load slowly, because of DNS lookup load. favicon.garden smooths out these issues.

Wait, can't I just prepend the magic gstatic domain?

The what? Oh, you mean like prepending https://t0.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&size=64&url= to the URL <img src="proxy.php?url=https%3A%2F%2Ft0.gstatic.com%2FfaviconV2%3Fclient%3DSOCIAL%26type%3DFAVICON%26fallback_opts%3DTYPE%2CSIZE%2CURL%26size%3D64%26url%3Dhttps%3A%2F%2Fwww.google.com" class='favicon' /> such that it renders ? Oh yeah that works too. I didn't realize that was a thing until I finished this project. It doesn't chase redirects though.

Tester

Prior art

Great minds think alike. Frans Allen built the closed-source favicone 2 years prior