Google's Favicon API

thecopy2 pts0 comments

Google favicon API endpoints. Customize favicon retrieval by changing domain and size parameters. · GitHub

/" data-turbo-transient="true" />

Skip to content

-->

Search Gists

Search Gists

Sign in

Sign up

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

Instantly share code, notes, and snippets.

iuzn/Google Favicon API Cheat Sheet.md

Created<br>October 20, 2025 20:34

Show Gist options

Download ZIP

Star

(3)

You must be signed in to star a gist

Fork

(0)

You must be signed in to fork a gist

Embed

Select an option

Embed<br>Embed this gist in your website.

Share<br>Copy sharable link for this gist.

Clone via HTTPS<br>Clone using the web URL.

No results found

Learn more about clone URLs

Clone this repository at &lt;script src=&quot;https://gist.github.com/iuzn/bbd4df2823bd69643a8553d6967f68eb.js&quot;&gt;&lt;/script&gt;

" readonly="readonly" data-autoselect="true" data-target="primer-text-field.inputElement " aria-describedby="validation-f3c8a7ec-ceb2-4670-b8b3-758850043741" class="form-control FormControl-monospace FormControl-input FormControl-small rounded-left-0 rounded-right-0 border-right-0" type="text" name="gist-share-url-sized-down" />

Save iuzn/bbd4df2823bd69643a8553d6967f68eb to your computer and use it in GitHub Desktop.

Embed

Select an option

Embed<br>Embed this gist in your website.

Share<br>Copy sharable link for this gist.

Clone via HTTPS<br>Clone using the web URL.

No results found

Learn more about clone URLs

Clone this repository at &lt;script src=&quot;https://gist.github.com/iuzn/bbd4df2823bd69643a8553d6967f68eb.js&quot;&gt;&lt;/script&gt;

" readonly="readonly" data-autoselect="true" data-target="primer-text-field.inputElement " aria-describedby="validation-f9a70d98-0995-4516-ba44-b2d79066014e" class="form-control FormControl-monospace FormControl-input FormControl-small rounded-left-0 rounded-right-0 border-right-0" type="text" name="gist-share-url-original" />

Save iuzn/bbd4df2823bd69643a8553d6967f68eb to your computer and use it in GitHub Desktop.

Download ZIP

Google favicon API endpoints. Customize favicon retrieval by changing domain and size parameters.

Raw

Google Favicon API Cheat Sheet.md

Google Favicon API Cheat Sheet

Fetch a website’s favicon easily using Google’s public endpoints:

Basic Endpoint

https://www.google.com/s2/favicons?domain=DOMAIN

DOMAIN : The domain name (e.g., stackoverflow.com)

Returns: The default favicon (PNG, usually 16px)

Custom Size Endpoint

https://www.google.com/s2/favicons?domain=DOMAIN&sz=SIZE

sz (optional): Requested PNG size. Accepts values like 16, 32, 64, 128 (default: 16px)

Example:<br>https://www.google.com/s2/favicons?domain=twitter.com&sz=64

Fetch Favicon by Site URL

You can provide the full site URL, not just the domain:

https://www.google.com/s2/favicons?domain=https://www.notion.so

Advanced: S2 Static Favicon Endpoint

For specific integrations, Google uses a slightly different endpoint in its services:

https://www.google.com/s2/favicons?sz=SIZE&domain_url=SITE_URL

domain_url : Full website address

Example:<br>https://www.google.com/s2/favicons?sz=32&domain_url=https://github.com

Notes

The favicon returned is always in PNG format.

If the domain does not have a favicon, Google may return a blank or fallback icon.

These endpoints are not officially documented by Google, but are widely used in browser extensions, apps, and web tools.

Reliable for most public sites, but results may vary for uncommon domains.

Quick Usage Examples

// 16x16 PNG favicon for Stack Overflow<br>https://www.google.com/s2/favicons?domain=stackoverflow.com

// 128x128 PNG favicon for Notion<br>https://www.google.com/s2/favicons?domain=notion.so&sz=128

// 32x32 PNG favicon for GitHub (using domain_url)<br>https://www.google.com/s2/favicons?sz=32&domain_url=https://github.com

Feel free to copy and use these endpoints in web projects, browser extensions, and scripts!

Sign up for free<br>to join this conversation on GitHub .<br>Already have an account?<br>Sign in to comment

You can’t perform that action at this time.

google favicon https domain gist github

Related Articles