How to get larger favicon from Google's api?

天大地大妈咪最大 提交于 2019-12-21 09:03:13

问题


Is it possible to get a larger version of the favicon from the Google's api or from somewhere else?

This is the url. http://www.google.com/s2/favicons?domain=google.com

I searched for an alternative api on ProgrammableWeb and Google but many of them don't exist anymore and the one I found that actually seems to work isn't free. (http://grabicon.com/)

I need the icon for a VB.NET project that has a list of websites with icons. But 16x16 icons are too small for that.


回答1:


Favicons are specified either as part of the HTML page, the HTTP response to a request for a page, or simply by being hosted at a default location.

That's true for all sites. There's plenty of browser extensions that can help you figure out the favicons a page send, if you don't manage by hand. For example, right clicking in firefox, "Page Info", "Media", "sort by type"->"Icon" should show all icons that a browser can find. It's not usual to have Icons larger than 32x32, and google might not be an exception.

Also be aware that the .ico format can contain multiple Icon sizes that not all tools show. So saving that .ico on your computer and inspecting it with a tool known to deal with all sizes contained in a single file might help.

Last word of advice: You're dealing with the logo, the very core of their brand, of a multi-billion dollar company. You might want to check with their policy of using that logo in your project. Probably it's OK (for example, browser don't seem to get in trouble for having a google logo for their google search box), but I'd still take care not to raise the impression that you're association a product of your own making with their logo.




回答2:


Editted: The below answer is no longer valid, but the code is freely available on github:

Github -> Favicons for all!

Original answer

You can also try Statvoo's Favicon API, e.g.

https://api.statvoo.com/favicon/?url=google.com

https://api.statvoo.com/favicon/?url=stackoverflow.com

etc..

They also have quite a few other API's you can use if you look around. Most of which are free and have been around for years.




回答3:


According to https://news.ycombinator.com/item?id=17190599:

Unless that endpoint can also return other resolutions, Favicon Kit offers more: https://api.faviconkit.com/twitter.com/144 https://api.faviconkit.com/twitter.com/16

(Though, I will say, the URIs returned for Twitter and the image sizes don't actually align in those cases. The first is actually 192ˣ192 pixels, and the second is 32ˣ32 pixels. That seems odd. Maybe they should have endpoints like domain/large, domain/medium, domain/small?)




回答4:


Here's some Favicon Fetchers I have found

  • Free Favicon-Service by AllesEDV.at - https://f1.allesedv.com/stackoverflow.com
  • Google Favicon Snatcher - https://www.google.com/s2/favicons?domain=stackoverflow.com
  • Favicon Grabber - http://favicongrabber.com/api/grab/stackoverflow.com

For Favicon Grabber it will return as JSON list of icon URLs.

Alternatively you can load the main page of the site and figure it out from there: https://stackoverflow.com/a/1990487/



来源:https://stackoverflow.com/questions/38599939/how-to-get-larger-favicon-from-googles-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!