REST API · v1

Dokumentasi API MakeFav

Gawe paket favicon lengkap saka kodemu dhewe, skrip build lan pipeline CI. Siji request ngowahi gambar apa wae dadi favicon.ico, Apple touch icon, ikon Android lan PWA, web manifest lan HTML sing tinggal ditempel.

Ing kaca iki

Wiwitan cepet

API MakeFav minangka REST API HTTPS + JSON sing prasaja. Kabeh endpoint ana ing siji base URL:

https://makefav.com/api/v1
  1. Gawe akun gratis
    Daftar, konfirmasi alamat email lan tetepna langganan newsletter MakeFav aktif – iku mung syarat paket gratis.
  2. Gawe API key
    Bukak kaca API keys ing akunmu lan gawe key pribadi. Key diwiwiti nganggo mf_ lan mung ditampilake sepisan, mula simpen kanthi aman. Kelola API keys
  3. Kirim request pisanan
    Unggah gambar menyang endpoint generate lan simpen file ZIP sing dibalekake:
curl --fail-with-body -sS https://makefav.com/api/v1/generate \
  -H "Authorization: Bearer $MAKEFAV_API_KEY" \
  -F "[email protected]" \
  -F "app_name=My App" \
  -F "theme_color=#2f9e68" \
  -F "radius=20" \
  -o favicons.zip

Unzip favicons.zip, upload the files to your website and paste the HTML code from the end of readme-makefav.txt into the <head> of every page.

Autentikasi

Saben request menyang endpoint sing diproteksi kudu nyakup API key pribadi. Sampeyan bisa nggawe, menehi jeneng lan mbatalake key kapan wae ing kaca akunmu: API keys

Send the key as a bearer token in the Authorization header, or – if your HTTP client makes that awkward – in the X-API-Key header. Both are equivalent.

Authorization: Bearer mf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# or, alternatively
X-API-Key: mf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Key kagolong marang pangguna sing alamat emailé wis dikonfirmasi lan langganan newsletter-é aktif (syarat paket gratis). Yen email durung dikonfirmasi, newsletter dipateni utawa akun diblokir, saben request bakal mbalekake 403 Forbidden.
Perlakukna API key kaya sandi: simpen ing server utawa ing rahasia CI, aja ing kode browser, aplikasi seluler utawa repositori publik. Batalake key sanalika yen bocor.

Missing or invalid keys return 401 Unauthorized. The GET /sizes and GET /openapi.json endpoints do not require a key.

Watesan rate

Kanthi standar saben API key olèh nggawe 100 request saben jam. Saben respons sing wis diautentikasi nuduhake status sampeyan:

HeaderKatrangan
X-RateLimit-LimitJumlah maksimum request sing diidini ing jendela saiki.
X-RateLimit-RemainingSisa request ing jendela saiki.
X-RateLimit-ResetTimestamp Unix (detik, UTC) nalika jendela direset.
HTTP/1.1 200 OK
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 97
X-RateLimit-Reset: 1767225600

When the limit is exceeded the API responds with HTTP 429 and the error code rate_limited. Wait until the time in X-RateLimit-Reset before retrying – do not retry in a tight loop.

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1767225600

{"error": {"code": "rate_limited", "message": "Rate limit exceeded. Try again after the reset time."}}

You can check your current quota at any time with GET /me.

Endpoint

EndpointAuthKatrangan
POST /generateAPI keyGawe paket favicon lengkap.
GET /meAPI keyAkunmu lan status rate-limit saiki.
GET /sizesOra anaDhaptar kabeh file ikon lan ukuran sing digawe generator.
GET /openapi.jsonOra anaSpesifikasi OpenAPI 3.1 sing bisa diwaca mesin.

Gawé paket favicon

POST/generate

Nggawé paket favicon lengkap saka siji gambar sumber. Kirimen gambar kanthi salah siji saka telung cara:

Jinis kontenKolom gambarKatrangan
multipart/form-dataimageUnggah file. Disaranake – pilihan sing paling efisien.
application/jsonimage_base64Base64-encoded image, either raw base64 or a data URL such as data:image/png;base64,iVBOR….
application/jsonimage_urlURL http utawa https publik saka gambar. Server bakal ngundhuh (maks. 10 MB).

Format input sing didhukung: PNG, JPG, WebP, AVIF, GIF, BMP, SVG lan ICO. Ukuran file maksimal: 10 MB.

Parameter

Kabeh parameter iku opsional. Kirimen minangka kolom formulir (multipart) utawa properti JSON. Nilai sing ora valid bakal bali menyang default.

JenengJinis / rentangDefaultKatrangan
app_namestring, maks. 60 karakterMy WebsiteJeneng situs web utawa aplikasimu, digunakake ing manifest.json lan kaca conto.
short_namestring, maks. 24 karakter12 karakter pisanan saka app_nameJeneng cendhak sing katon ing ngisor ikon ing layar utama Android.
theme_color#rrggbb#ffffffWarna UI browser (meta tag theme-color lan manifest).
tile_color#rrggbbpadha karo theme_colorWarna latar ubin Start Windows.
backgroundtransparent | #rrggbbtransparentLatar saka ikon browser, Android lan Windows.
apple_background#rrggbb#ffffffLatar saka ikon Apple touch lan ikon maskable (iOS ora ndhukung transparansi). Diabaikan yen background iku warna – warna kasebut sing digunakake.
paddinginteger, 0–40 (%)0Ruang kosong ing sakubenge gambar, minangka persentase saka ukuran ikon.
radiusinteger, 0–50 (%)0Sudhut bunder. 50 nggawe bunderan. Ora ditrapake ing ikon Apple, amarga iOS mbunderake dhewe.
zoominteger, 50–400 (%)100Skala gambar ing njero ikon. Nilai ing ndhuwur 100 bakal motong gambar.
offset_x, offset_yangka, -1 nganti 10Nggeser gambar horisontal / vertikal, minangka pecahan saka ukuran ikon.
pathstring/Folder ing servermu panggonane ikon. Digunakake ing cuplikan HTML, manifest lan browserconfig.
displaystandalone | fullscreen | minimal-ui | browserstandaloneMode tampilan PWA sing ditulis ing manifest.
pixelatedauto | 1 | 0autoSkala nearest-neighbour sing landhep kanggo pixel art. auto ngaktifake kanggo sumber 64 px utawa luwih cilik.
maskable1 | 01Uga gawé maskable-icon-512x512.png kanthi padding safe-zone kanggo ikon adaptif Android.
ico_sizesdhaptar dipisahake koma saka 16, 24, 32, 48, 64, 128, 25616,32,48Ukuran sing disematake ing favicon.ico.
groupsdhaptar dipisahake koma saka favicon, apple, android, msfavicon,apple,android,msSet ikon sing digawe: favicon browser, ikon Apple touch, ikon Android / PWA lan ubin Windows.
formatzip | jsonzipFormat respons – deleng ing ngisor.

Respons

format=zip
Binary ZIP archive with Content-Type: application/zip and Content-Disposition: attachment. Default.
format=json
JSON object with the package id (32 hex characters), the html snippet for your <head> and a files array; each file has name, mime, size (bytes) and base64 contents.

Conto request – multipart, respons ZIP

curl --fail-with-body -sS https://makefav.com/api/v1/generate \
  -H "Authorization: Bearer $MAKEFAV_API_KEY" \
  -F "[email protected]" \
  -F "app_name=My App" \
  -F "theme_color=#2f9e68" \
  -F "radius=20" \
  -o favicons.zip
HTTP/1.1 200 OK
Content-Type: application/zip
Content-Disposition: attachment
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
X-RateLimit-Reset: 1767225600

<binary ZIP data>

Conto request – JSON nganggo URL gambar, respons JSON

curl --fail-with-body -sS https://makefav.com/api/v1/generate \
  -H "Authorization: Bearer $MAKEFAV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://example.com/logo.png",
    "app_name": "My App",
    "theme_color": "#2f9e68",
    "radius": 20,
    "groups": "favicon,apple,android",
    "format": "json"
  }'
{
  "id": "9f86d081884c7d659a2feaa0c55ad015",
  "html": "<link rel=\"apple-touch-icon\" sizes=\"57x57\" href=\"/apple-icon-57x57.png\">\n…\n<meta name=\"theme-color\" content=\"#2f9e68\">",
  "files": [
    {"name": "favicon.ico", "mime": "image/x-icon", "size": 15086, "base64": "AAABAAMAEBAAAAEAIABoBAAANgAAACAg…"},
    {"name": "favicon-16x16.png", "mime": "image/png", "size": 612, "base64": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQ…"},
    {"name": "manifest.json", "mime": "application/json", "size": 1094, "base64": "ewogICAgIm5hbWUiOiAiTXkgQXBwIiwK…"}
  ]
}

Njupuk akunmu

GET/me

Ngasilake pangguna sing duwé API key lan status rate-limit saiki. Migunani kanggo mriksa key. Butuh autentikasi; tanpa parameter.

Conto request

curl -sS https://makefav.com/api/v1/me \
  -H "Authorization: Bearer $MAKEFAV_API_KEY"

Conto respons

{
  "id": 1,
  "email": "[email protected]",
  "name": "Jane Doe",
  "rate_limit": {"limit": 100, "remaining": 97, "reset": 1767225600}
}

Dhaptar ukuran ikon

GET/sizes

Returns every icon file the generator can produce, with its pixel size and group. No authentication and no parameters. The group value matches the groups parameter of POST /generate.

Conto request

curl -sS https://makefav.com/api/v1/sizes

Conto respons

{
  "files": [
    {"name": "favicon-16x16.png", "size": 16, "group": "favicon"},
    {"name": "favicon-32x32.png", "size": 32, "group": "favicon"},
    {"name": "apple-touch-icon.png", "size": 180, "group": "apple"},
    {"name": "android-icon-192x192.png", "size": 192, "group": "android"},
    {"name": "ms-icon-144x144.png", "size": 144, "group": "ms"}
  ]
}

Spesifikasi OpenAPI

GET/openapi.json

Ngasilake deskripsi OpenAPI 3.1 saka API iki. Tanpa autentikasi. Impor menyang Postman, Insomnia utawa Swagger UI, utawa gunakake kanggo nggawe klien bertipe kanggo basamu.

curl -sS https://makefav.com/api/v1/openapi.json -o makefav-openapi.json

Kesalahan

Successful requests return HTTP 200. Every error returns a JSON body with a stable, machine-readable code and a human-readable message. Always branch on the code, not on the message text.

HTTP/1.1 422 Unprocessable Content
Content-Type: application/json

{
  "error": {
    "code": "invalid_image",
    "message": "The uploaded file could not be decoded as an image."
  }
}
Status HTTPKode kesalahanTeges
400bad_requestRequest-e cacat, contone ora ana gambar sing dikirim utawa isi JSON ora valid.
401unauthorizedAPI key ora ana utawa ora valid.
403forbiddenEmail pemilik key durung dikonfirmasi, langganan newsletter dipateni, utawa akun diblokir.
413file_too_largeGambar luwih gedhe tinimbang 10 MB.
415unsupported_typeJinis file utawa jinis konten request ora didhukung.
422invalid_imageFile ora bisa didekode dadi gambar, utawa URL gambar ora bisa diundhuh.
429rate_limitedRequest kakehan. Enteni nganti X-RateLimit-Reset.
500server_errorAna masalah ing sisi kita. Cobanen maneh mengko; hubungi dhukungan yen isih kedadean.

File output

With all groups enabled, a package contains the files below. Files from disabled groups are left out.

FileUkuranGrup
favicon.ico16, 32, 48 (bisa dikonfigurasi)mesthi ana
favicon-16x16.png16 × 16favicon
favicon-32x32.png32 × 32favicon
favicon-96x96.png96 × 96favicon
apple-icon-57x57.png57 × 57apple
apple-icon-60x60.png60 × 60apple
apple-icon-72x72.png72 × 72apple
apple-icon-76x76.png76 × 76apple
apple-icon-114x114.png114 × 114apple
apple-icon-120x120.png120 × 120apple
apple-icon-144x144.png144 × 144apple
apple-icon-152x152.png152 × 152apple
apple-icon-180x180.png180 × 180apple
apple-icon.png192 × 192apple
apple-icon-precomposed.png192 × 192apple
apple-touch-icon.png180 × 180apple
android-icon-36x36.png36 × 36android
android-icon-48x48.png48 × 48android
android-icon-72x72.png72 × 72android
android-icon-96x96.png96 × 96android
android-icon-144x144.png144 × 144android
android-icon-192x192.png192 × 192android
android-icon-512x512.png512 × 512android
web-app-manifest-192x192.png192 × 192android
web-app-manifest-512x512.png512 × 512android
maskable-icon-512x512.png512 × 512android
ms-icon-70x70.png70 × 70ms
ms-icon-144x144.png144 × 144ms
ms-icon-150x150.png150 × 150ms
ms-icon-310x310.png310 × 310ms

File tambahan

FileKalebuKatrangan
favicon.svgMung kanggo input SVG tanpa crop, zoom, padding, sudhut utawa latarSalinan SVG sing wis disanitasi kanggo browser sing ndhukung favicon vektor.
manifest.json, site.webmanifestandroidManifest aplikasi web kanggo Android lan PWA sing bisa diinstal (rong salinan padha).
browserconfig.xmlmsKonfigurasi ubin Windows kanthi warna ubinmu.
readme-makefav.txtmesthi anaPandhuan instalasi kanthi kode HTML kanggo <head> ing pungkasan.

Conto kode

Each example uploads logo.png with a few options and saves favicons.zip, handling API errors. Set the environment variable MAKEFAV_API_KEY to your API key first.

Unggah multipart:

# Multipart upload (recommended). --fail-with-body exits non-zero on HTTP errors
# and still saves the JSON error body, so you can inspect it.
curl --fail-with-body -sS https://makefav.com/api/v1/generate \
  -H "Authorization: Bearer $MAKEFAV_API_KEY" \
  -F "[email protected]" \
  -F "app_name=My App" \
  -F "theme_color=#2f9e68" \
  -F "radius=20" \
  -o favicons.zip \
  || { echo "Request failed:"; cat favicons.zip; rm -f favicons.zip; exit 1; }

Isi JSON kanthi gambar sing dienkode base64 (butuh jq):

# JSON body with a base64-encoded image (built with jq to avoid argument length limits)
base64 < logo.png | tr -d '\n' > logo.b64
jq -n --rawfile img logo.b64 \
  '{image_base64: $img, app_name: "My App", theme_color: "#2f9e68", radius: 20}' \
| curl --fail-with-body -sS https://makefav.com/api/v1/generate \
    -H "Authorization: Bearer $MAKEFAV_API_KEY" \
    -H "Content-Type: application/json" \
    --data-binary @- \
    -o favicons.zip \
  || { echo "Request failed:"; cat favicons.zip; rm -f favicons.zip; exit 1; }

Panggunaan HTML

Upload all files to the folder you set with path, then paste the snippet into the <head> of every page. It is included at the end of readme-makefav.txt in the package and, with format=json, returned in the html field. Example for the options used in the code examples above:

<head>
  <meta charset="utf-8">
  <title>My App</title>

  <link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
  <link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
  <link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
  <link rel="icon" href="/favicon.ico" sizes="any">
  <link rel="manifest" href="/manifest.json">
  <meta name="msapplication-TileColor" content="#2f9e68">
  <meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
  <meta name="msapplication-config" content="/browserconfig.xml">
  <meta name="theme-color" content="#2f9e68">
</head>

Sawise deploy, busak cache browser utawa bukak situs ing jendhela pribadi – browser nyimpen favicon ing cache kanthi kuwat.

Catetan owah-owahan

v1

  • Rilis publik pisanan API REST MakeFav.
  • Endpoints POST /generate, GET /me, GET /sizes and GET /openapi.json.
  • Format respons ZIP lan JSON, input gambar multipart, base64 lan URL.
  • API key pribadi kanthi 100 request saben jam.

Versi 1 stabil: kita mung nambahake parameter lan kolom opsional. Owah-owahan sing ngrusak bakal dirilis minangka versi anyar kanthi pawartos sadurunge.

Dhukungan

Pitakon, laporan bug utawa butuh rate limit sing luwih dhuwur? Kita bungah bisa mbantu. Tulung sertakna wektu request lan kode kesalahan ing pesenmu – aja nganti API key-mu.