Favicon Generator API
Web Development
Make a favicon from an image, text or an emoji and download favicon.ico, every PNG size, the Apple touch icon, a web manifest and the HTML tags.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
20 requests per minute
Endpoints
1 endpoint available
Overview
Makes a favicon from an uploaded image (a logo, PNG, JPEG or SVG) or from 1 to 3 characters of text, on a coloured or transparent square, rounded square or circle. It uses the same drawing code as the web page and returns the full package as a ZIP, just favicon.ico, or a single PNG.
Outputs
zip(default):favicon.ico(16, 32 and 48 px),favicon-16x16.png,favicon-32x32.png,apple-touch-icon.png(180 px, transparency filled with white),android-chrome-192x192.png,android-chrome-512x512.png,site.webmanifestandfavicon-html.txtwith the <link> tags.ico: justfavicon.ico(image/x-icon) with 16, 32 and 48 px images.png: one PNG atsizepx (16-1024).
Limits and behavior
- Send multipart/form-data. For an image icon, put the image in the
filefield (JPEG, PNG, WebP, GIF, AVIF, TIFF or SVG, up to 20 MB). For a text icon, leavefileout and sendtext. Send one or the other. - Text is drawn in Liberation Sans. The web page uses your device's system font, so letter shapes can differ slightly. Emoji icons are only available on the web page.
- Booleans are the strings
trueorfalse. Colours are hex,#rgbor#rrggbb. - Errors are JSON:
{"success": false, "error": "..."}. Uploads are not stored.
Endpoints
POST
https://opentools.ca/api/v1/tools/favicon-generatorGenerate a favicon package, .ico or PNG from an image or text
Request Body
Content-Type: multipart/form-data
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | Optional | Image to make the icon from (JPEG, PNG, WebP, GIF, AVIF, TIFF or SVG, up to 20 MB). Required unless text is sent. |
| text | string | Optional | 1 to 3 characters for a text icon, e.g. "OT". Required unless file is sent. |
| output | string Enum: zip, ico, png | Optional | What to return. See Outputs.Default: zip |
| size | number | Optional | Pixel size for output=png, 16-1024. Ignored otherwise.Default: 512 |
| background | string | Optional | Hex background colour, or "transparent".Default: #2563eb |
| shape | string Enum: square, rounded, circle | Optional | Icon shape. Outside a rounded square or circle is transparent.Default: rounded |
| padding | number | Optional | Empty space around the image or text, as a fraction of the icon size, 0-0.35.Default: 0.08 |
| fit | string Enum: contain, cover | Optional | Image icons: contain fits the whole image, cover fills the space and crops.Default: contain |
| textColor | string | Optional | Text icons: hex text colour.Default: #ffffff |
| bold | boolean | Optional | Text icons: bold text.Default: true |
| scale | number | Optional | Text icons: text size as a fraction of the space inside the padding, 0.4-1.Default: 0.85 |
| siteName | string | Optional | Site name for site.webmanifest (up to 60 characters). Empty means "My website".Default: "" |
| themeColor | string | Optional | Hex theme colour for site.webmanifest and the theme-color meta tag.Default: #2563eb |
Response Example
The body is the file: a ZIP (Content-Type: application/zip, favicon.zip), an ICO (image/x-icon, favicon.ico) or a PNG (image/png, favicon-<size>x<size>.png). Errors return JSON, for example:
{
"success": false,
"error": "Upload an image in the \"file\" field, or send \"text\" (1 to 3 characters)."
}Error Codes
400
Bad Request - Neither or both of file and text, an invalid option, or an image that could not be read401
Unauthorized - Invalid or missing API key403
Forbidden - API key inactive, expired, or not allowed from this IP413
Payload Too Large - The file is over 20 MB415
Unsupported Media Type - The file is not a supported image type429
Too Many Requests - Rate limit exceeded500
Internal Server ErrorCode Examples
# Full package from a logo
curl -X POST https://opentools.ca/api/v1/tools/favicon-generator \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@logo.svg" \
-F "background=transparent" \
-F "siteName=My Site" \
-o favicon.zip
# Just favicon.ico from text
curl -X POST https://opentools.ca/api/v1/tools/favicon-generator \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "text=OT" \
-F "background=#2563eb" \
-F "shape=circle" \
-F "output=ico" \
-o favicon.icoRather use it in your browser? Open the Favicon Generator