GET
/v1/faviconGet all available favicons for a URL with size information.
Query Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
url | string | - | The URL to get favicons from | |
size | string | 32 | Preferred icon size (16, 32, 64, 128, 256) |
Try it out
GET /v1/faviconGet favicon for any URL
curl "https://api.katsau.com/v1/favicon?url=https%3A%2F%2Fgithub.com&size=32" \
-H "Authorization: Bearer YOUR_API_KEY"Request Example
curl "https://api.katsau.com/v1/favicon?url=https://github.com" \
-H "Authorization: Bearer ks_live_your_api_key"Response
{
"success": true,
"data": {
"url": "https://github.com",
"icons": [
{
"url": "https://github.githubassets.com/favicons/favicon.svg",
"type": "image/svg+xml",
"sizes": "any",
"source": "link[rel=icon]"
},
{
"url": "https://github.githubassets.com/favicons/favicon.png",
"type": "image/png",
"sizes": "32x32",
"source": "link[rel=icon]"
},
{
"url": "https://github.githubassets.com/apple-touch-icon.png",
"type": "image/png",
"sizes": "180x180",
"source": "link[rel=apple-touch-icon]"
}
],
"best_match": {
"url": "https://github.githubassets.com/favicons/favicon.png",
"size": "32x32"
}
},
"meta": {
"request_id": "req_abc123xyz",
"response_time_ms": 123
}
}Direct Image Redirect
Use /v1/favicon/image to get a redirect directly to the favicon image. This is useful for embedding in <img> tags.
GET /v1/favicon/image?url=https://github.com&api_key=ks_live_xxx HTTP/1.1
Host: api.katsau.com
ā 302 Redirect to: https://github.githubassets.com/favicons/favicon.pngUsage in HTML
<!-- Directly embed favicon -->
<img
src="https://api.katsau.com/v1/favicon/image?url=github.com&api_key=ks_live_xxx"
alt="GitHub favicon"
width="32"
height="32"
/>Best Match Algorithm
When you specify a size parameter, the API returns the icon closest to your requested size. The algorithm:
- Parses all available icon sizes from the page
- SVG icons are preferred for large sizes (they scale perfectly)
- For bitmap icons, the closest size to your request is returned
- If no sized icons are found, falls back to /favicon.ico
Icon Sources
The API looks for icons in the following locations:
| Source | Selector |
|---|---|
| Standard favicon | link[rel="icon"] |
| Shortcut icon | link[rel="shortcut icon"] |
| Apple touch icon | link[rel="apple-touch-icon"] |
| Default fallback | /favicon.ico |