API pengenalan huruf
Ngaidentipikasi fonta ti ciri-ciri huruf atawa gambar, dicocogkeun ka pustaka fonta gratis open-source. Bebas pikeun manusa dina situs ieu - API ieu pikeun program sareng panggunaan bulk.
Tampilan
POST https://fonts.free/api/identify/
Dua mode. Kirim jawaban asistén salaku JSON, atawa gambar salaku data formulir multipart. Tambahkeun?top=N (1-48) pikeun netepkeun sabaraha pasualan anu bakal balik.
1. Kanthi ciri-ciri letterform
curl -X POST "https://fonts.free/api/identify/?top=8" \
-H "Content-Type: application/json" \
-d '{"answers": {"serif": ["none"], "contrast": ["low"], "a": ["double"]}}'
2. Saka gambar (beta)
curl -X POST "https://fonts.free/api/identify/" \
-F "image=@sample.png"
Python
import requests
H = {"X-Api-Key": "your_key"}
# by traits
r = requests.post("https://fonts.free/api/identify/?top=8", headers=H,
json={"answers": {"serif": ["none"], "contrast": ["low"]}})
# from an image
r = requests.post("https://fonts.free/api/identify/", headers=H,
files={"image": open("sample.png", "rb")})
for m in r.json()["matches"]:
print(m["family"], m["score"], m["url"])
Jawaban
{
"ok": true,
"mode": "wizard",
"matches": [
{"slug": "roboto", "family": "Roboto",
"url": "https://fonts.free/fonts/roboto/",
"css": "…", "score": 3}
]
}
Autentikasi lan watesan
Tanpa kunci titik akhir bisa digunakaké nanging watesan kecepatan saben IP - becik kanggo nyoba. Kunci nambah watesan sampeyan marang quota sawulan. Kirim minangka bagéan mburi utawa parameter pitakonan:
-H "X-Api-Key: your_key" # or ?key=your_key
Plans
Teu aya tombol anu diperlukeun pikeun panggunaan sedeng. Apik pikeun prototipe sareng alat volume rendah.
Kanggo aplikasi produksi lan identifikasi batches. Prioritas match.
High-throughput utawa embedded panggunaan. Prioritas match.
Lapisan bébas teu butuh konci - ngan ngahubungi titik akhir, éta dibatasi ku laju per IP. Langganan dina halaman harga pikeun konci kuota bulanan anu langkung luhur. Satiap parios anu dipulangkeun API nyaéta fonta bébas, lisénsi terbuka, janten teu aya anu kedah lisénsi di handapeun.