📚 API Documentation

Complete guide to using the Favicon API. Learn how to fetch, resize, and convert website favicons with our simple REST API. Perfect for developers building dashboards, analytics platforms, link previews, and any application requiring website icons.

📋 API Reference

Endpoint

GET /[&size=&format=&response=&default=]

Parameters

Parameter Type Required Description
domain string Yes The website domain (e.g., github.com)
size number No Desired image size in pixels (16-512)
format string No Output format: png, jpg, or webp
response string No Response format: image (default) or json
default string No Fallback image URL when favicon not found

Examples

Get favicon as image:
curl "http://favicon.btoven.net/github.com"
Get favicon metadata as JSON:
curl "http://favicon.btoven.net/github.com&response=json"
Resize favicon to 64x64:
curl "http://favicon.btoven.net/github.com&size=64"
Convert to PNG:
curl "http://favicon.btoven.net/github.com&format=png&size=128"
With custom fallback:
curl "http://favicon.btoven.net/example.com&default=https://mysite.com/fallback.png"

Response Format (JSON)

{ "url": "http://favicon.btoven.net/github.com&size=128", "sourceUrl": "https://github.githubassets.com/favicons/favicon.svg", "width": 128, "height": 128, "format": "png", "bytes": 4521, "source": "html" }

HTTP Headers

Header Description
Content-Type Image format (image/png, image/jpeg, etc.)
Cache-Control 7-day cache for successful requests
Access-Control-Allow-Origin CORS support (configurable)

Use Cases

💻 HTML
Favicon
📜 JavaScript
const domain = 'example.com'; const faviconUrl = `http://favicon.btoven.net/${domain}&size=64`;
[NOTE] For detailed deployment instructions, configuration options, and troubleshooting, refer to the docs/ folder in the repository.