Fetch Favicon for any domain/ URL with this easy trick
Did you know?
If you're building a project that involves displaying favicons (like a bookmark manager, browser extension, or custom dashboard), Google provides a simple and reliable solution to fetch them!
Using Google’s Favicon API
Google's Favicon API lets you retrieve the favicon for any domain by using this URL pattern:
https://www.google.com/s2/favicons?domain=example.com
Just replace example.com
with the target domain, and you’ll receive a 16x16 pixel favicon.
Need a Larger Favicon?
For a 32x32 pixel version, you can add the sz
parameter:
https://www.google.com/s2/favicons?sz=32&domain=example.com
While Google doesn’t officially document every available size, sz=32
is widely used for higher resolution.
Why Use Google’s API?
- Simple Integration: Just plug in the domain name.
- Reliable: Since it’s powered by Google, uptime is dependable.
- Efficient for Prototyping: Perfect for quickly adding favicons without downloading files.
Whether you’re building a minimalist browser extension or need favicons in your web app, this API is a handy tool to add visual appeal to links. Give it a try!