API reference

Base URL: https://api.onlyfonts.ai

All read endpoints are public — no API key required. Responses are JSON. Search endpoints are rate limited to 30 requests per minute per IP.

browse fonts

GET /v1/fonts

Query parameters:

parametertypenotes
categorystringserif, sans-serif, monospace, display, handwriting
licensestringfilter by license id (e.g. ofl)
sourcestringfilter by catalog source
is_variablebooleanvariable fonts only / static only
sortstringfamily (default), created_at, variant_count
orderstringasc (default), desc
limitnumbermax 100, default 50
offsetnumberpagination offset
curl 'https://api.onlyfonts.ai/v1/fonts?category=monospace&is_variable=true&limit=10'

font detail

GET /v1/fonts/{slug}

Returns full metadata: family, category, designer, license, variants, variable axes, mood/era/formality tags, language coverage, quality metrics, similar fonts, and pairing suggestions.

GET /v1/fonts/{slug}/variants
GET /v1/fonts/{slug}/pairings

Variants lists each weight/style with file sizes. Pairings returns scored heading/body combinations.

POST /v1/search

Body:

{ "query": "warm serif for a bakery", "limit": 10, "lang": "uk", "is_variable": true }
  • query — natural-language description; matched against ML embeddings of every font’s visual appearance, not keywords
  • lang — optional ISO 639 language filter
  • is_variable — optional
  • limit — max 50

Returns ranked fonts with similarity scores.

identify a font from an image

Two steps — get an upload URL, upload the image, then search by its key:

GET /v1/search/upload-url

returns a presigned PUT URL and an r2_key. PUT your screenshot to the URL, then:

POST /v1/search
{ "r2_key": "<key from upload-url>", "limit": 10 }

Returns the closest-looking fonts in the catalog.

typography suggestions

POST /v1/suggest

Body (at least one field):

{ "project": "developer documentation site", "mood": "calm, technical", "content_type": "docs" }

Returns ranked font suggestions for the described project, scored against mood and use-case tags.

errors and limits

  • errors return JSON: { "error": "message" } with appropriate status codes
  • search endpoints: 30 requests/minute per IP (429 when exceeded)
  • for high-volume or commercial API use, contact support@onlyfonts.ai