Free favicon APIs, and when you need more than a URL

The two free favicon URLs most apps use are Google's (www.google.com/s2/favicons?domain=example.com&sz=64) and DuckDuckGo's (icons.duckduckgo.com/ip3/example.com.ico). Both work without a key but are undocumented, so they can change, and they often return a small or generic icon. Our Favicon and Logo API reads the site's own link tags and web app manifest, picks the largest real icon and returns it with its true format and pixel size, as base64 up to 200 KB, for $0.003.

Try it free Favicon & Logo API — best icon as base64, $0.003 · $0.003 / call

The free URLs

For a list of bookmarks or a sidebar of links, these are the right answer. They're fast, cached and cost nothing.

<!-- Google: sz asks for a size; small sites often only have 16 or 32 px -->
<img src="https://www.google.com/s2/favicons?domain=github.com&sz=64" width="32" height="32" alt="">

<!-- DuckDuckGo: returns an .ico -->
<img src="https://icons.duckduckgo.com/ip3/github.com.ico" width="32" height="32" alt="">

Where the free URLs fall short

Finding the best icon yourself

Sites declare icons in several places: link rel icon with sizes, apple-touch-icon (usually 180 px), mask-icon, the icons array in the web app manifest, and the old /favicon.ico at the root. The best one is usually the largest PNG or an SVG. Our API collects all of them, plus og:image and twitter:image, ranks real icons above social images, downloads the best candidates in order and reads the actual format and pixel size from the file, so a file called icon-512.png that's really 32 px is reported as 32 px.

import base64

r = pay_session.post("https://iamai.markets/api/x402/services/U1QDkKFxlYKW",
                     json={"url": "https://github.com"})
best = r.json()["result"]["best"]
print(best["format"], best["width"], best["height"], best["kind"])
if best["base64"]:
    ext = best["format"] if best["format"] != "jpeg" else "jpg"
    open(f"icon.{ext}", "wb").write(base64.b64decode(best["base64"]))

# $0.003 per site via x402 (USDC on Base)

Compared

If no icon downloads, the call is refused and not charged. Logos belong to their owners, so check your right to show them.

Google s2 / DuckDuckGoFavicon API (iamai.markets)
PriceFree$0.003 per site
KeyNoneNone; pay per call with x402
SizeWhat the service cachedLargest real icon the site declares
Format and size reportedNoYes, read from the file
All declared icons listedNoYes, with sizes and types
Icons set by JavaScriptDependsNot seen

The product

Questions

Is the Google favicon API official?

It's widely used but not documented as a public product, so treat it as best effort.

How do I get a high-resolution logo for a website?

Look for apple-touch-icon or manifest icons, which are often 180 to 512 px, or use an API that ranks them by size.

Can I get the icon as SVG?

Yes, when the site declares one. Our API reports the format as svg and returns the file as base64.

Related

Updated 2026-12-02