API - Typefaces

All typeface endpoints are GET requests that return a JSON response. They properly handle CORS requests so you can use fetch from the browser.

List

Retrieve a list of all fonts that we currently track.

curl 'https://components.ai/api/v1/typefaces/list'

Info

Get data for a specific typeface. The response includes urls for CDN links for typeface variants and weights.

# curl 'https://components.ai/api/v1/typefaces/NAME'
curl 'https://components.ai/api/v1/typefaces/recursive'

Three.js FontLoader data

Retrieve font data that can be passed directly to three's FontLoader.

# curl 'https://components.ai/api/v1/typefaces/recursive/VARIANT/WEIGHT'
curl 'https://components.ai/api/v1/typefaces/recursive/normal/400'

Random

Call the typeface generator used in our app directly. It returns the same response as the typeface info endpoint.

curl 'https://components.ai/api/v1/typefaces/random'

Specify a category

When generating typefaces you might want to restrict them to a category. You can do so by setting the category query param.

curl 'https://components.ai/api/v1/typefaces/random?category=serif'

The following categories can be passed:

Additionally, you can combine categories by joining them with |.

curl 'https://components.ai/api/v1/typefaces/random?category=serif|monospace|display'