Favicon API

The favicon API turns one image into a complete icon package from your own code. It comes with a free account, the paid plans raise its volume, and it runs the same engine on our own servers as the browser tool, so the files you script are the files you would get by hand.

The base URL in these examples is https://faviconize.com.

Favicon API authentication

Favicon API authentication uses a key you create on the dashboard. The key is shown once, at creation, and only a hash of it is stored, so if you lose it nobody can recover it for you and you will need to mint a new one. Send it as a bearer token:

Authorization: Bearer sk_your_key_here

An x-api-key: sk_your_key_here header works too. A missing, unknown, or revoked key returns 401.

Generate a favicon package with the API

POST /api/generate
Content-Type: multipart/form-data

To generate a favicon package with the API, send one image in one call and get one package back. The plan check happens before any pixels are read, so an over-limit request is refused up front and costs you nothing.

FieldRequiredDescription
fileyesThe source image: a PNG, JPG, WebP, or SVG. One image in.
namenoApplication name written into the web manifest.
shortNamenoShort application name written into the web manifest.
themeColornoTheme color for the manifest and the meta tag, as a hex value.
backgroundColornoBackground color for the manifest, as a hex value.
basePathnoPath prefix the head snippet uses to reference the icon files, if you serve them from a subdirectory.
curl -X POST https://faviconize.com/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -F "file=@logo.png" \
  -F "name=Acme" \
  -F "themeColor=#0b5cff"

The response is JSON. It carries the signed download link, what we read from your source, the exact list of files in the package with their measured dimensions, a paste-ready head snippet, and your usage standing. The dimensions are read back from the encoded bytes, so they are a measurement of the output rather than an echo of the request.

{
  "downloadUrl": "https://faviconize.com/api/download/eyJrIjoi...9Q.Ab3d",
  "downloadName": "favicons.zip",
  "expiresInSeconds": 900,
  "deletedAfterHours": 24,
  "source": { "format": "png", "width": 512, "height": 512, "square": true, "vector": false },
  "files": [
    { "name": "favicon.ico", "bytes": 15086, "width": null, "height": null, "layers": 3 },
    { "name": "favicon-16.png", "bytes": 349, "width": 16, "height": 16, "layers": null },
    { "name": "favicon-32.png", "bytes": 591, "width": 32, "height": 32, "layers": null },
    { "name": "apple-touch-icon.png", "bytes": 2696, "width": 180, "height": 180, "layers": null },
    { "name": "icon-192.png", "bytes": 3097, "width": 192, "height": 192, "layers": null },
    { "name": "icon-512.png", "bytes": 8350, "width": 512, "height": 512, "layers": null },
    { "name": "icon-maskable-512.png", "bytes": 7743, "width": 512, "height": 512, "layers": null },
    { "name": "site.webmanifest", "bytes": 477, "width": null, "height": null, "layers": null },
    { "name": "head-snippet.html", "bytes": 346, "width": null, "height": null, "layers": null }
  ],
  "zipBytes": 25701,
  "headSnippet": "<link rel=\"icon\" href=\"/favicon.ico\" sizes=\"48x48\">\n...",
  "warnings": [],
  "metered": true,
  "usage": { "used": 3, "remaining": 97 }
}

An image we cannot decode returns 422 with a sentence you can show a user. When that happens the reserved unit is handed back, so a failed call is not billed. Anything we had to change that you might not expect, such as padding a non-square source, is reported in warnings rather than done silently.

Download the favicon ZIP

GET /api/download/{token}

To download the favicon ZIP, follow the downloadUrl in the response, which already points here. No key is needed on this request: the signed token is the credential, so the link can be handed straight to a browser or a build step that holds no key. It is bound to one package and it expires, currently after 15 minutes.

curl -L -o favicons.zip https://faviconize.com/api/download/$TOKEN

The body is the ZIP, served with a Content-Disposition: attachment header. A package is deleted 24 hours after it is created, under the retention policy, so download promptly or generate again. An expired link returns 410; a link whose package has already been swept returns 410 as well; a token that does not verify returns 403.

Favicon API usage metering

Favicon API usage is metered per image: one image is one package is one unit. The API has no browser session, so every call uploads one image and reserves one unit before the work starts. Calling again with the same key and the same bytes in the same period is the same billable image, and the second call is free.

Favicon API errors

Favicon API errors are always JSON with an error field carrying a sentence you can show a user.

StatusMeaning
400The request was not multipart, or the file field was missing.
401No key, an unknown key, or a revoked key.
403The account is suspended and cannot generate icons.
413The file is over your plan's per-file size limit.
422The upload could not be decoded as a supported image.
429You have used your plan's allowance for the month, or its processing limit, which also counts failed and repeated attempts. The message says which and when it resets.