Install
openclaw skills install favicon-sofavicon.so project API reference — covers the favicon fetch API and image-to-favicon-package convert API. Use when working on API routes, building integrations, debugging favicon fetch/convert behavior, or adding new endpoints to this project.
openclaw skills install favicon-soFetch any website's favicon by domain.
| Method | Path | Description |
|---|---|---|
| GET | /api/favicon?url={domain} | Fetch favicon with full options |
| GET | /{domain} | Short URL, returns favicon image directly |
| Param | Type | Required | Description |
|---|---|---|---|
url | string | yes | Domain or URL (e.g. github.com) |
raw | string | no | Set to "true" for JSON metadata instead of image |
Image mode (default): Returns binary image data with headers:
Content-Type: actual image MIME typeCache-Control: public, max-age=604800Access-Control-Allow-Origin: *JSON mode (raw=true):
{
"url": "https://github.githubassets.com/favicons/favicon.svg",
"format": "image/svg+xml",
"isDefault": false
}
app/api/favicon/route.ts and app/[locale]/[domain]/route.tslib/fetchFavicon.ts — tries HTML parsing, /favicon.ico, Google, DuckDuckGo fallbackslib/utils.ts — normalizeDomain(), isValidDomain()Convert any image into a complete favicon package with all sizes.
| Method | Path | Description |
|---|---|---|
| POST | /api/convert | Upload image, get favicon package |
Content-Type: multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
image | File | yes | Image file (PNG, JPG, WebP, GIF, BMP, TIFF) |
Also accepts raw image bytes with Content-Type: image/* or application/octet-stream.
| Param | Type | Default | Description |
|---|---|---|---|
format | string | — | Set to "json" for base64 JSON output instead of ZIP |
ZIP mode (default):
Returns application/zip containing 10 files:
favicon.ico (multi-resolution: 16, 32, 48, 64, 128)favicon-16x16.png, favicon-32x32.png, favicon-48x48.png, favicon-64x64.png, favicon-128x128.pngapple-touch-icon.png (180×180)android-chrome-192x192.png, android-chrome-512x512.pngsite.webmanifestJSON mode (format=json):
{
"files": {
"favicon-16x16.png": { "size": 1234, "base64": "iVBOR..." },
"favicon.ico": { "size": 5678, "base64": "AAAB..." },
...
}
}
app/api/convert/route.tsjimp (pure JS, Cloudflare Workers compatible)jszipapp/api/ and skip the i18n middleware[locale]/[domain]/route.ts catch-all serves as a short URL for favicon fetchsearch, convert, api, generator, skill, mcp) are excluded from the domain catch-allapp/[locale]/convert/page.tsx) uses WASM (Photon + resvg) for browser-native processingjimp for Node.js/Workers compatibility