Skip to main content

Introduction

The Fonttrio Registry API provides programmatic access to curated font pairings and individual font configurations. The API serves JSON files from the registry that can be directly integrated into your projects.

Base URL

https://www.fonttrio.xyz/api/r/
All API endpoints are relative to this base URL.

Authentication

No authentication is required. The API is publicly accessible and free to use.

Rate Limiting

There are no explicit rate limits, but please be respectful of the service. The API is designed for:
  • Build-time fetching of font configurations
  • Client-side dynamic loading of font pairings
  • CLI tools and automation scripts

Caching

The API implements intelligent caching behavior:

Static Requests (No Query Parameters)

  • Cache-Control: public, max-age=86400, s-maxage=86400
  • Cached for 24 hours by browsers and CDNs
  • Ideal for production deployments

Dynamic Requests (With Query Parameters)

  • Cache-Control: no-cache
  • Not cached to ensure parameter overrides are always applied
  • Used for customizing font styles on-the-fly

Common Use Cases

1. Fetch a Font Pairing

Retrieve a complete font pairing configuration with heading, body, and mono fonts:
const response = await fetch('https://www.fonttrio.xyz/api/r/minimal');
const pairing = await response.json();

2. Fetch an Individual Font

Get configuration for a single font:
const response = await fetch('https://www.fonttrio.xyz/api/r/inter');
const font = await response.json();

3. Customize Typography On-The-Fly

Override specific CSS properties using query parameters:
const response = await fetch(
  'https://www.fonttrio.xyz/api/r/minimal?h1-size=3rem&body-lh=1.8'
);
const customPairing = await response.json();

4. Build-Time Integration

Use in Next.js or other frameworks during build:
import { NextResponse } from 'next/server';

export async function GET() {
  const pairing = await fetch('https://www.fonttrio.xyz/api/r/brutalist')
    .then(res => res.json());
  
  return NextResponse.json(pairing);
}

Response Format

All API responses return JSON with either:

Error Handling

The API returns standard HTTP status codes:
Status CodeDescription
200Successful request
404Registry item not found
500Server error

Error Response Format

{
  "error": "Registry item \"invalid-name\" not found"
}

Next Steps

Endpoints

Explore all available API endpoints and parameters

Pairing Schema

Learn the structure of font pairing responses

Font Schema

Understand individual font configuration format

Build docs developers (and LLMs) love