-26
Did you know that Google provides a free API to retrieve the favicon for any website?
(programming.dev)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
Why would you ever want to route your request like this through a third party especially an ad company? To get the favicon of a site you just request
www.example.com/favicon.ico
.It doesn’t have to be an
*.ico
file. So you might need to try different file extensions./favicon.ico
is the only "default" URL./favicon.ico
is usually not an actual "icon" type anymore but PNG or JPG (but with the same URL). Other than that you need to load the HTML and check forLink
headers or<link rel=icon>
elements. While URLs like/favicon.png
may be popular they aren't part of any actual protocol.