Favicon generator API
Turn a PNG, JPEG or SVG logo, or a letter, into a full favicon set: favicon.ico, PNG and maskable icons, apple-touch-icon, site.webmanifest and HTML.
Send a logo as an image (PNG, JPEG or SVG via multipart file, raw body, file_base64 or url), as SVG markup in svg, or just text (1–3 characters, e.g. your initial) with background, color and shape (square, rounded, circle) to draw a letter icon. You get the files a website needs today: favicon.ico with 16, 32 and 48 px images (32-bit BMP inside, read by every browser and Windows), favicon-96x96.png, favicon.svg when the source is vector (sanitised and optimised), apple-touch-icon.png 180 px on an opaque background, android-chrome-192x192.png and -512x512.png, a maskable-icon-512x512.png with the logo inside the 80% safe zone, site.webmanifest, and the <link> / <meta> tags to paste into <head>.
Non-square images are centred (fit=contain) or centre-cropped (fit=cover); padding (percent) adds a margin. SVG sources are drawn at every size by our renderer, so small icons stay sharp. name, short_name, theme_color, background_color, display and the URL path of the files go into the manifest and the HTML.
The JSON response holds every file as a data URI; format=zip returns a ZIP with all files and favicon-snippet.html. Nothing is stored.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
file | body | file | no | Logo (PNG, JPEG or SVG): multipart, raw body or file_base64. | |
svg | body | string | no | SVG markup instead of a file. | |
url | query|body | string | no | Public URL of the logo. | |
text | query|body | string | no | Letter icon: 1–3 characters (used when no image is sent). | |
background | query|body | string | no | #2563eb | Letter icon background colour. |
color | query|body | string | no | #ffffff | Letter colour. |
shape | query|body | string | no | rounded | Letter icon shape: square, rounded or circle. |
fit | query|body | string | no | contain | contain (centre a non-square image) or cover (centre crop). |
padding | query|body | number | no | 0 | Margin around the logo, percent of the icon size (0–40). |
name | query|body | string | no | App name for the manifest. | |
short_name | query|body | string | no | Short name (home screen label). | |
theme_color | query|body | string | no | #ffffff | Theme colour (manifest + <meta name="theme-color">). |
background_color | query|body | string | no | #ffffff | Splash / maskable background colour. |
apple_background | query|body | string | no | Background of apple-touch-icon (default: background_color). | |
path | query|body | string | no | / | URL folder of the files in the HTML and manifest. |
format | query|body | string | no | json | json (data URIs) or zip. |
Example
curl -X POST "https://apibox.io.vn/v1/favicon" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"A","background":"#2563eb","name":"APIBox Demo","short_name":"Demo","theme_color":"#2563eb"}'const res = await fetch('https://apibox.io.vn/v1/favicon', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"text": "A",
"background": "#2563eb",
"name": "APIBox Demo",
"short_name": "Demo",
"theme_color": "#2563eb"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/favicon",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"text": "A", "background": "#2563eb", "name": "APIBox Demo", "short_name": "Demo", "theme_color": "#2563eb"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/favicon');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"text":"A","background":"#2563eb","name":"APIBox Demo","short_name":"Demo","theme_color":"#2563eb"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"source": "text",
"html": "<link rel=\"icon\" type=\"image/png\" href=\"/favicon-96x96.png\" sizes=\"96x96\">\n<link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\">\n<link rel=\"shortcut icon\" href=\"/favicon.ico\">\n<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/apple-touch-icon.png\">\n<meta name=\"apple-mobile-web-app-title\" content=\"Demo\">\n<link rel=\"manifest\" href=\"/site.webmanifest\">\n<meta name=\"theme-color\" content=\"#2563eb\">",
"manifest": {
"name": "APIBox Demo",
"short_name": "Demo",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "/maskable-icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#2563eb",
"background_color": "#ffffff",
"display": "standalone"
},
"files": [
{
"name": "favicon.ico",
"type": "image/x-icon",
"width": 48,
"height": 48,
"bytes": 15086,
"data_uri": "data:image/x-icon;base64,AAABAAMAEBAAAAEAIABoBAAANgAAACAgAAABACAAqBAAAJ4EAAAwMAAAAQAgAKglAABGFQAAKAAAABAAAAAgAAAAAQAgAAA…"
},
{
"name": "favicon-96x96.png",
"type": "image/png",
"width": 96,
"height": 96,
"bytes": 1573,
"data_uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4…"
},
{
"name": "favicon.svg",
"type": "image/svg+xml",
"bytes": 289,
"data_uri": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cmVjdCB3aW…"
},
{
"name": "apple-touch-icon.png",
"type": "image/png",
"width": 180,
"height": 180,
"bytes": 3125,
"data_uri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAIAAACyr5Fl…"
},
{
"name": "android-chrome-192x192.png",
"type": "image/png",
"width": 192,
"height": 192,
"bytes": 3311,
"data_uri": "data:image/png;base64,…"
},
{
"name": "android-chrome-512x512.png",
"type": "image/png",
"width": 512,
"height": 512,
"bytes": 10018,
"data_uri": "data:image/png;base64,…"
},
{
"name": "maskable-icon-512x512.png",
"type": "image/png",
"width": 512,
"height": 512,
"bytes": 8552,
"data_uri": "data:image/png;base64,…"
},
{
"name": "site.webmanifest",
"type": "application/manifest+json",
"bytes": 511,
"data_uri": "data:application/manifest+json;base64,ewogICJuYW1lIjogIkFQSUJveCBEZW1vIiwKICAic2hvcnRfbmFtZSI6ICJEZW1vIiwK…"
}
],
"warnings": []
}
Use cases
- Favicon set for a new website or landing page in one call
- Site builders and CMS that let customers upload a logo
- Letter icons for internal tools and staging sites
- PWA icons and manifest for an existing web app
FAQ
Which files do I really need?
favicon.ico at the site root, the SVG or 96 px PNG for modern browsers, apple-touch-icon.png for iOS and the manifest with 192 / 512 px icons for Android and PWAs. The returned HTML references all of them.
What size should the source be?
A square SVG is best. For PNG / JPEG use at least 512×512 px; smaller sources work but the large icons will look soft, and a warning is returned.
What is the maskable icon?
Android crops app icons to a circle or squircle. The maskable icon keeps the logo within the central 80% on a solid background so nothing important is cut off.
Related APIs
QR Code Generator
Generate QR codes as PNG or SVG with one GET request: URLs, text, WiFi logins, vCards, e-mail, SMS, phone and geo links. Custom colours, size and ECC.
|||Barcode Generator
Create Code 128 barcodes for labels, SKUs and shipping with a single request. SVG with human-readable text or PNG, custom height, width and colours.
▭Placeholder Image
Get placeholder images of any size for mockups and tests: /v1/placeholder/600x400.png. SVG with custom text and colours, or a solid-colour PNG.