Fonte Identification API
Identifye fonts soti nan letterform traits oswa yon imaj, matche kont yon livri nan gratis open-source fonts. Gratis pou moun sou sit sa a - sa a API se pou programmatic ak gwoup itilize.
Endpoint
POST https://fonts.free/api/identify/
De modes. Envoke asistan an repons kòm JSON, oswa yon imaj kòm fòma multipart done. Ajoute? top=N (1-48) pou defini konbyen matche vini tounen.
1. Pa letterform tradiksyon
curl -X POST "https://fonts.free/api/identify/?top=8" \
-H "Content-Type: application/json" \
-d '{"answers": {"serif": ["none"], "contrast": ["low"], "a": ["double"]}}'
2. Soti nan yon imaj (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"])
Reponn
{
"ok": true,
"mode": "wizard",
"matches": [
{"slug": "roboto", "family": "Roboto",
"url": "https://fonts.free/fonts/roboto/",
"css": "…", "score": 3}
]
}
Auth
San yon kle, pwent bout la travay men li limite pa IP - bon pou eseye li. Yon kle ogmante limit ou kont yon kwota chak mwa. Envoye li kòm yon header oswa paramèt kesyon:
-H "X-Api-Key: your_key" # or ?key=your_key
Plan
Pa gen bouton ki nesesè pou itilize limyè. Great pou prototip ak zouti ti-volume.
Pou aplikasyon pou pwodiksyon ak idantifikasyon batch. Korespondans priyorite.
High-throughput oswa embedded itilize. Priyorite matche.
Tipe lib pa bezwen okenn kle - jis rele pwent fen, li se rate-limited pou IP. Abònman sou paj la pri pou yon kle ak yon quote menyèl pi wo. chak matche API retounen se yon font lib, open-licensed, konsa pa gen anyen pou lisans downstream.