Get any website favicon using free Google API

Author Mileta Dulovic
Author

Mileta Dulovic

API

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

Replace DOMAIN with any website that you want. When you specify the SIZE, image of that size will be returned if website owner uploaded the favicon of the size you requested. Otherwise, it will return default one.


If you are displaying links to other websites, you can use this to make it more engaging for user, as it will have image instead of just plain link.

Playground

const App = () => {
  return (
    <img
      src="https://www.google.com/s2/favicons?domain=https://google.com&sz=128"
    />
  )
}

export default App