API Documentation
Base URL: https://fonts.realmaker.de
Authentication
All API endpoints (except registration) require an API key. Three methods are supported:
# Option 1: X-API-Key Header (recommended)
curl -H "X-API-Key: rf_abc123..." https://fonts.realmaker.de/v1/fonts
# Option 2: Authorization Bearer Header
curl -H "Authorization: Bearer rf_abc123..." https://fonts.realmaker.de/v1/fonts
# Option 3: Query Parameter
curl "https://fonts.realmaker.de/v1/fonts?api_key=rf_abc123..."
Endpoints
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /v1/register | Create new account | No |
| GET | /v1/fonts | Search and filter fonts | Yes |
| GET | /v1/css | Generate CSS code | Yes |
| GET | /v1/font/{family}/{variant} | Download font file | Yes |
| GET | /v1/account | Account info and usage | Yes |
| POST | /mcp | MCP JSON-RPC 2.0 endpoint | Per Tool |
POST /v1/register
Creates a new account and returns the API key. Email and password are optional – without them, an anonymous API key is generated.
Request
POST /v1/register
Content-Type: application/json
// Minimal (anonymous API key):
{ }
// With email (key recovery possible):
{
"email": "user@example.com",
"password": "secure-password"
}
Response (201)
{
"error": false,
"message": "Registration successful. Save your API key - it will not be shown again!",
"api_key": "rf_a1b2c3d4e5f6...",
"api_key_prefix": "rf_a1b2",
"tier": "free",
"daily_limit": 100
}
GET /v1/fonts
Searches the font catalog with optional filters.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| search | string | - | Search term for font name |
| category | string | - | serif, sans-serif, display, handwriting, monospace |
| subset | string | - | e.g. latin, latin-ext, cyrillic |
| sort | string | popularity | popularity, alpha, date |
| page | int | 1 | Page |
| per_page | int | 20 | Results per page (max 100) |
Response
{
"error": false,
"fonts": [
{
"id": 1,
"family": "Roboto",
"category": "sans-serif",
"subsets": ["latin", "latin-ext", "cyrillic"],
"popularity": 1601,
"variant_count": 12,
"variants": [
{"weight": 400, "style": "normal", "format": "woff2", "available": true}
]
}
],
"pagination": {
"page": 1,
"per_page": 20,
"total": 1601,
"total_pages": 81
}
}
GET /v1/css
Generates @font-face CSS code. Most important endpoint for integration.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| family | string | Yes | Font-Family name (e.g. "Roboto", "Open+Sans") |
| weights | string | No | Comma-separated: "400,700,900" |
| styles | string | No | Comma-separated: "normal,italic" |
| format | string | No | woff2 (default), woff, ttf |
Response (text/css)
/* Generated by realmaker LocalFonts - DSGVO-konform */
/* Font: Roboto */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('https://deinedomain.de/v1/font/roboto/400-normal.woff2') format('woff2');
}
HTML Embedding
<link rel="stylesheet"
href="https://deinedomain.de/v1/css?family=Roboto&weights=400,700&api_key=rf_...">
GET /v1/font/{family}/{variant}
Returns the actual font file (binary). Usually referenced automatically by the CSS.
URL Format
/v1/font/{family-slug}/{weight}-{style}.{format}
Examples:
/v1/font/roboto/400-normal.woff2
/v1/font/open-sans/700-italic.woff2
/v1/font/playfair-display/900-normal.ttf
Response: Binary font file with Cache-Control: public, max-age=31536000, immutable
GET /v1/account
Shows account information and current usage.
{
"error": false,
"account": {
"email": "user@example.com",
"tier": "free",
"created_at": "2026-01-15 10:30:00"
},
"usage": {
"requests_today": 42,
"daily_limit": 100,
"remaining": 58
}
}
MCP Integration – Setup
Connect
Run this command once in your terminal. Recommended: API key as header – then it doesn't need to be specified for every tool call:
# Recommended: API key as header (configure once)claude mcp add-json rm-localfonts '{"type":"http","url":"https://fonts.realmaker.de/mcp","headers":{"X-API-Key":"rf_DEIN_KEY"}}'
# Alternative: Without header (API key per tool call)claude mcp add-json rm-localfonts '{"type":"http","url":"https://fonts.realmaker.de/mcp"}'
After that, Claude can automatically access the LocalFonts tools.
Show Tools
After setup, you can check the available tools in your browser:
# Get tools info (GET endpoint)curl https://fonts.realmaker.de/mcp
Prerequisites
- A LocalFonts API key (register for free on the homepage)
- Claude Code CLI installed
- API key via
X-API-Keyheader (recommended) or as tool argument
MCP Protocol
realmaker LocalFonts implements the MCP HTTP Transport Protocol (JSON-RPC 2.0).
Endpoint
POST https://fonts.realmaker.de/mcp
Content-Type: application/json
Session Management
The server returns an Mcp-Session-Id header on initialize. This must be sent with all subsequent requests.
Supported Methods
| Method | Description |
|---|---|
| initialize | Start session, get server capabilities |
| notifications/initialized | Client confirms initialization |
| tools/list | List available tools |
| tools/call | Execute a tool |
| ping | Check connection |
Example: Initialize
# Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"clientInfo": { "name": "claude-code", "version": "1.0" }
}
}
# Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2024-11-05",
"capabilities": { "tools": { "listChanged": false } },
"serverInfo": { "name": "rm-localfonts", "version": "1.1.0" }
}
}
# + Header: Mcp-Session-Id: abc123...
MCP Tools
All tools require a valid API key (via X-API-Key header or api_key argument).
search_fonts
Searches the font catalog.
{
"method": "tools/call",
"params": {
"name": "search_fonts",
"arguments": {
"query": "Roboto",
"category": "sans-serif",
"limit": 5
}
}
}
Note: api_key only required if no X-API-Key header was configured.
get_font_css
Generates @font-face CSS code. With local_paths: true, local file paths are used instead of CDN URLs.
# CDN-URLs (default)
{
"method": "tools/call",
"params": {
"name": "get_font_css",
"arguments": {
"family": "Open Sans",
"weights": "400,700",
"styles": "normal,italic"
}
}
}
# Local file paths (for fully local hosting){
"method": "tools/call",
"params": {
"name": "get_font_css",
"arguments": {
"family": "Open Sans",
"weights": "400,700",
"local_paths": true
}
}
}
download_font
Returns download URLs for all font files. For fully local font hosting.
{
"method": "tools/call",
"params": {
"name": "download_font",
"arguments": {
"family": "Roboto",
"weights": "400,700"
}
}
}
install_font
All-in-one tool for local font hosting. Returns download commands and ready @font-face CSS in a single call.
{
"method": "tools/call",
"params": {
"name": "install_font",
"arguments": {
"family": "Inter",
"weights": "400,600,700",
"fonts_dir": "assets/fonts",
"css_path": "assets/css"
}
}
}
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
| family | string | - | Font name (required) |
| weights | string | all | Comma-separated: "400,700" |
| styles | string | all | "normal", "italic" or "normal,italic" |
| format | string | woff2 | woff2, woff, ttf |
| fonts_dir | string | fonts | Target directory for font files |
| css_path | string | - | CSS directory (for relative path calculation) |
Response contains:
mkdir+curlcommands for copy-paste- Ready @font-face CSS with correct relative paths
- HTML embedding instructions
Simple:
install_font → delivers everything in one callManual:
download_font → get_font_css with local_paths: true → save CSS fileget_font_link
Returns a ready HTML <link> tag (CDN variant).
{
"method": "tools/call",
"params": {
"name": "get_font_link",
"arguments": {
"family": "Roboto",
"weights": "400,700"
}
}
}
list_popular_fonts
Lists the most popular Google Fonts.
{
"method": "tools/call",
"params": {
"name": "list_popular_fonts",
"arguments": {
"limit": 10
}
}
}
End session
DELETE https://fonts.realmaker.de/mcp
Mcp-Session-Id: abc123...
Rate Limits
| Tier | Requests/Day |
|---|---|
| Free | 100 |
| Pro | 10.000 |
| Enterprise | Unlimited |
Rate limit headers on every response:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1709000400
When exceeded: HTTP 429 with Retry-After header.
MCP requests also count against the rate limit of the used API key.
Error Handling
{
"error": true,
"message": "Error description",
"status": 400
}
| Code | Meaning |
|---|---|
| 400 | Invalid parameters |
| 401 | Missing or invalid API key |
| 404 | Font/variant not found |
| 409 | Email already registered |
| 422 | Validation error |
| 429 | Rate limit exceeded |
| 502 | Font download from Google failed |
Practical Examples
AI Agent: Create website with fonts
# 1. Generate API keycurl -X POST https://fonts.realmaker.de/v1/register \
-H "Content-Type: application/json" \
-d '{}'
# 2. Search for fontscurl -H "X-API-Key: rf_..." \
"https://fonts.realmaker.de/v1/fonts?search=sans&category=sans-serif&per_page=5"
# 3. Embed CSS in HTML# <link rel="stylesheet"
# href="https://deinedomain.de/v1/css?family=Roboto&weights=400,700&api_key=rf_...">
Claude Code: MCP Workflow
# 1. Connect MCP server (once, with API key)claude mcp add-json rm-localfonts '{"type":"http","url":"https://fonts.realmaker.de/mcp","headers":{"X-API-Key":"rf_DEIN_KEY"}}'
# 2. Simply ask in chat:
"Download Google Font 'Inter' in 400 and 700 locally."
# Claude automatically uses install_font:
# → A single tool call# → Returns curl commands for downloading# → Returns ready @font-face CSS# → Claude executes everything and embeds it
PHP: Self-host font files
// Download font file and save locally$ch = curl_init('https://fonts.realmaker.de/v1/font/roboto/400-normal.woff2');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-API-Key: rf_...']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$fontData = curl_exec($ch);
file_put_contents('fonts/roboto-400.woff2', $fontData);