Get favicons from any domain using a hidden google API

Get favicons from any domain using a hidden google API


1 min read

Did you know?

Google offers a secret URL that can automatically pull the favicon image of any domain. Cherries on the cake, we can ask for different sizes and the images returned are in PNG format (not ICO), meaning they will render correctly in all browsers using the <img> tag.

The API works using a simple GET:${domain}&sz=${size}

The query parameters are:

  • domain: mandatory, the domain you are interested in,

  • sz: optional, a size hint such as 256.

In case the right size is not found, it will return the default one, usually 16x16.

128x128 (nothing found for 512x512, so returns a 16x16 PNG)

16x16 fallback (yep, sometimes the quality is far from optimal)

stackoverflow 128x128

UPDATE: similar services

Privacy-friendly search engine DuckDuckGo also has one similar to Google one:

Another service called Icon Horse has some additional features:

Finally, there is also The call looks like:

The response is a JSON with all the available icons (use ?pretty=true for nice json formatting):

  "domain": "",
  "icons": [
      "sizes": "192x192",
      "src": ",f_png,fl_progressive,q_80,w_192/https:/"

However, I got some gateway timeouts... Trying currently returns:

{"error":"General API error."}