# Favicon API - full description
> Free HTTP API that turns a name into an image URL ready for `
`: the favicon of a web site, the avatar of an email address, the logo of a sports team, the icon of a fiat or crypto currency, the flag of a country, or the logo of a company, brand or mobile app. No API key, no sign-up.
Base URL: `https://favicon.intami.pl`. OpenAPI 3 specification: `https://favicon.intami.pl/open-api.yaml`. Short summary: `https://favicon.intami.pl/llms.txt`.
## How to use it
- Every endpoint is a GET (HEAD also works). The answer is an image (`200`) or a redirect to one (`301`), so the request URL can be put directly into `
`, Markdown `` or any client that follows redirects (`curl -L`).
- To get only the image URL without downloading it, do not follow redirects and read the `Location` header of the `301`.
- Common query parameters:
- `preferredSize` - wanted size in pixels, 1-1024, default 64. The closest available size is returned (the size itself or a scalable SVG, otherwise the nearest larger one, otherwise the largest one).
- `fallback` - absolute http(s) URL (URL-encoded) of an image to redirect to (`302`) when nothing is found. Not used by `/avatar`, which always returns an image.
- Status codes: `200` image, `301` redirect to the image, `302` redirect to `fallback`, `304` when `If-None-Match` matches the `ETag`, `400` invalid parameter, `404` nothing found, `502` an upstream icon source failed (only `/currency`, `/flag` and `/logo`).
- Responses are cached by the service (a week for found items, a day for missing ones) and have `Cache-Control: public, max-age=86400, stale-while-revalidate=86400`.
- There is no request limit and no key. Please cache results on your side for repeated use.
- Names (teams, currencies, brands) are compared without case, accents and characters other than letters and digits: `los-angeles-lakers` = `Los Angeles Lakers` = `los_angeles_lakers`. Use `-` instead of spaces or URL-encode them (`%20`).
## Favicon of a web site
`GET /favicon/{domain}[?preferredSize=][&fallback=]`
- `domain`: a domain name only (`wikipedia.org`, `www.github.com`, international names allowed); no scheme, path, port or IP address.
- Finds icons like a browser: icons declared in the head of the main page, otherwise `/favicon.svg`, `/favicon.png`, `/apple-touch-icon.png`, `/favicon.ico`, otherwise the BIMI logo of the domain. Only icons that really serve an image are used.
- `301` to the icon, `302` to `fallback`, `404` when there is none, `400` for an invalid domain.
- Examples: `https://favicon.intami.pl/favicon/github.com`, `https://favicon.intami.pl/favicon/wikipedia.org?preferredSize=32`.
## Avatar of an email address
`GET /avatar/{email}[?preferredSize=][&color=color|mono]` (the same as `GET /favicon/{email}`)
- Sources, first one with an image wins: Gravatar, Libravatar (also federated servers of the email domain), the BIMI logo of the email domain. Otherwise an SVG with the initials of the address is generated (always the same for the same address); `color=mono` gives a black background instead of a color chosen by the address.
- Always `200` with the image itself (PNG, JPEG, GIF, WebP or a safe SVG), no redirect; `400` for an invalid address, size or color.
- Examples: `https://favicon.intami.pl/avatar/john.smith@example.com`, `https://favicon.intami.pl/avatar/john.smith@example.com?preferredSize=32&color=mono`.
## Logo of a sports team
`GET /{sport}/{team}[?preferredSize=][&fallback=]`
- `sport`: `basketball`, `baseball`, `football` (American football), `soccer`, `hockey`, `rugby`, `volleyball`, `handball`. Another value gives `404`.
- `team`: full name, short name or abbreviation, at most 100 characters (`lakers`, `los-angeles-lakers`, `LAL`). Names are mostly in English (`bayern-munich`, `dinamo-zagreb`).
- Teams of these leagues are matched first (ESPN): NBA, WNBA, MLB, NFL, NHL; top soccer leagues of England (also the Championship), Spain, Germany, Italy, France, Netherlands, Portugal, Belgium, Turkey, Scotland, Austria, Switzerland, Greece, Denmark, Norway, Sweden, MLS, USL Championship, Brazil, Argentina, Mexico, Chile, Colombia, Uruguay, Peru, Ecuador, Paraguay, Venezuela, Bolivia; rugby Premiership, United Rugby Championship, Super Rugby Pacific, Top 14, Six Nations, Rugby World Cup. The full name wins, then a short name, then the abbreviation; when names repeat, the earlier league in this list wins.
- Other teams are searched by name in ESPN (e.g. European cup teams: `legia`, `lech`), then (also all volleyball and handball teams) in TheSportsDB; use the full name (`sir-safety-perugia`, `thw-kiel`). This search may miss teams whose name is shared with a team of another sport.
- `301` to the logo, `302` to `fallback`, `404` when there is no such team, `400` for an invalid name, size or fallback.
- Examples: `https://favicon.intami.pl/basketball/lakers`, `https://favicon.intami.pl/soccer/real-madrid?preferredSize=32`, `https://favicon.intami.pl/hockey/edmonton-oilers`, `https://favicon.intami.pl/volleyball/sir-safety-perugia`.
## Icon of a currency
`GET /currency/{name}[?preferredSize=][&withNetwork=true][&fallback=]`
- `name`: an ISO 4217 code or English name of a fiat currency (`EUR`, `GBP`, `USD`, `euro`, `pound-sterling`, `us-dollar`, `yen`; shown as its symbol - `€`, `£`, `$`, the code when there is none - in a colored circle with the small round flag of its country in the bottom-right corner) or a crypto currency by symbol (`BTC`, `USDT`), id (`bitcoin`, `tether`) or name (`wrapped-bitcoin`); at most 64 characters. Fiat codes and names are checked first (the Peruvian sol is `Peruvian Sol`, `sol` is Solana).
- `withNetwork=true` (crypto only, ignored for fiat): the same icon with the small icon of the token's default network in the bottom-right corner (`BTC` - Bitcoin, `ETH` and `USDT` - Ethereum, `BNB` - BNB Smart Chain). Tokens without a known network get the plain icon.
- Always an SVG made by the service: `200`, `image/svg+xml`, `width`/`height` = `preferredSize`. `404` for an unknown currency (`302` to `fallback` when given), `400` for an invalid name, size, `withNetwork` or fallback, `502` when the icon source fails.
- Examples: `https://favicon.intami.pl/currency/EUR`, `https://favicon.intami.pl/currency/btc?withNetwork=true`, `https://favicon.intami.pl/currency/tether?preferredSize=32`.
## Flag of a country
`GET /flag/{country}[?preferredSize=][&fallback=]`
- `country`: ISO 3166-1 alpha-2 (`DE`), alpha-3 (`DEU`) or numeric (`276`) code, case-insensitive; also `EU` (European Union) and `UN` (United Nations); or the English name of the country (`germany`, `united-states`, `usa`, `ivory-coast`; also `england`, `scotland`, `wales`, `northern-ireland`), at most 64 characters, compared like other names.
- Always an SVG of a rectangular 4:3 flag (flag-icons, MIT): `200`, `image/svg+xml`, `width` = `preferredSize`, `height` = 3/4 of it (64×48 by default). For a round flag use CSS: `width:48px; height:48px; border-radius:50%; object-fit:cover`. `404` for a code that is not a country, an unknown name or a country without a flag (`302` to `fallback` when given), `400` for an empty or too long country, an invalid size or fallback, `502` when the flag source fails.
- Examples: `https://favicon.intami.pl/flag/DE`, `https://favicon.intami.pl/flag/jpn?preferredSize=32`, `https://favicon.intami.pl/flag/840`, `https://favicon.intami.pl/flag/united-kingdom`.
## Logo of a company, brand or app
`GET /logo/{name}[?preferredSize=][&fallback=]`
- `name`: name of a company, brand, product or mobile app, at most 100 characters (`github`, `spotify`, `heineken`, `calm`).
- Sources in this order, the first one that knows the name wins (brands before apps, there is no parameter to choose):
1. Simple Icons: `200` with an SVG of the brand icon in its brand color.
2. Wikidata: `301` to the logo of the company (Wikimedia Commons; often a wordmark, not square; sizes rounded up to standard thumbnail widths).
3. Wikidata: `301` to the favicon of its official website.
4. App Store: `301` to the app icon.
5. Google Play: `301` to the app icon.
- `404` when nothing is found (`302` to `fallback` when given), `400` for an invalid name, size or fallback, `502` when the Simple Icons source fails.
- Logos are trademarks of their owners; follow their brand guidelines.
- Examples: `https://favicon.intami.pl/logo/github`, `https://favicon.intami.pl/logo/heineken?preferredSize=128`, `https://favicon.intami.pl/logo/calm`.
## JavaScript library
`https://favicon.intami.pl/favicon.js` sets `src` of every `
` (a domain, any URL of a site, or an email address, also `mailto:`) to its favicon or avatar and adds the class `favicon-found` or `favicon-missing`. Optional attributes: `data-preferred-size`, `data-color`.
```html
```
## Contact
favicon-api@intami.pl