About
Favicone is a super convenient API service that allows you to easily
retrieve and serve favicons from any website. With its user-friendly
URL structure, Favicone makes the process a piece of cake – just use
something like https://favicone.com/:domain
.
The magic happens behind the scenes as Favicone cleverly searches for the favicon link within the website's HTML or directly from the favicon.ico file. It's all about efficiency and simplicity!
You can use Favicone in your app or website to enhance the visual appeal of your app and ensure your users enjoy a seamless favicon experience.
Example
Get the favicon of a domain:
Result:
Image resizing is available using the ?s=:size parameter (max is 256):
Result:
Return the JSON data with ?json parameter:
Result:
{
"hasIcon": true,
"icon": "https://icons.favicone.com/i/www.google.com/favicon.ico",
"format": "ico"
}
The Problems
Obtaining a favicon from a website can be a challenging task due to the inconsistent locations where the favicon.ico file or favicon references may be found. The following are common sources where a favicon can be located:
- favicon.ico file: Traditionally, websites have placed the favicon.ico file at the root directory of the website. However, this is not always the case, and the favicon.ico file may be located in different directories or have a different file name.
-
HTML code: Websites often define a favicon link in their HTML code
using the
<link>
` tag with therel="icon"
attribute. Thehref
attribute specifies the URL of the favicon. However, the favicon link can have different variations, such asrel="shortcut icon"
,rel="apple-touch-icon"
, or other custom variations. - Web manifest file: Modern websites using progressive web app (PWA) technologies may define a web manifest file (manifest.json) that includes information about the website's icons, including the favicon. The web manifest file can specify different sizes and formats for the icons.
These variations in favicon locations and references make it challenging to reliably fetch the favicon for a given website. Favicone aims to address these challenges by searching for the favicon in multiple sources, including the favicon.ico file, HTML code, and web manifest files.