GET /api/r/[name]
Retrieve a font pairing or individual font configuration from the registry.Path Parameters
The registry item name. Can be a pairing name (e.g.,
minimal, brutalist) or font name (e.g., inter, roboto).The .json extension is optional and will be automatically stripped if provided.Resolution Logic
The API searches for registry items in the following order:- Pairings directory with exact name:
/registry/pairings/{name}.json - Pairings directory without
pairing-prefix:/registry/pairings/{name-without-prefix}.json - Fonts directory:
/registry/fonts/{name}.json
/api/r/minimal→ findspairings/minimal.json/api/r/pairing-minimal→ findspairings/minimal.json/api/r/inter→ findsfonts/inter.json
Query Parameters
Override CSS properties for specific HTML elements in font pairings. Query parameters are ignored for individual font requests.Parameter Format
Parameters follow the pattern:{selector}-{property}={value}
Supported Selectors:
h1,h2,h3,h4,h5,h6— Heading levelsbody— Body textcode— Inline codepre— Code blocks
Font size (e.g.,
2rem, 18px, 1.5em)Font weight (e.g.,
400, 700, bold)Font family (e.g.,
Inter, var(--font-custom))Line height (e.g.,
1.6, 1.8, 2)Aliases: line-heightLetter spacing (e.g.,
-0.02em, 0.05em)Aliases: letter-spacingExample Query Parameters
- Set H1 font size to
3rem - Set H1 font weight to
800 - Set body line height to
1.8
Response
Returns either a pairing schema or font schema depending on the requested item.
Cache Headers
Without Query Parameters
With Query Parameters
Examples
Fetch Default Pairing
Fetch with Overrides
Fetch Individual Font
Error Handling
Implementation Details
The endpoint is implemented in Next.js as a dynamic route handler: Source:app/api/r/[name]/route.ts:8
Key behaviors:
- Strips
.jsonextension if provided in the URL - Searches pairings directory first, then fonts directory
- Handles
pairing-prefix automatically - Applies CSS overrides from query parameters only to matching selectors
- Returns 404 if no matching registry item is found
See Also
Pairing Schema
Detailed schema for font pairing responses
Font Schema
Schema for individual font configurations