Welcome to the Font Converter API
A powerful RESTful API for converting font files between various formats including TTF, OTF, WOFF, WOFF2, EOT, SVG, and UFO.
🚀 Quick Start
Get up and running with the API in minutes
📚 OpenAPI 3.0
Full OpenAPI specification available
âš¡ Real-time Updates
Server-Sent Events for live progress
Quick Start
1. Check Service Status
Verify that the service is healthy and all dependencies are available:
curl https://onlinefontconverter.com/api/status
2. Submit a Conversion Job
Upload font files and specify target formats:
curl -X POST https://onlinefontconverter.com/api/convert \
-F "[email protected]" \
-F "targetFormats=WOFF,WOFF2" \
-F "output=zip"
3. Check Job Status
Monitor the conversion progress using the job ID:
curl https://onlinefontconverter.com/api/jobs/{jobId}
4. Download Results
Once complete, download the converted fonts:
curl -O https://onlinefontconverter.com/api/jobs/{jobId}/download
Key Features
Multi-Format Support
- Input: TTF, OTF, WOFF, WOFF2, EOT, SVG, UFO
- Output: TTF, OTF, WOFF, WOFF2, EOT, SVG
- Intelligent format detection
Batch Processing
- Convert multiple files at once
- Up to 20 files per batch
- ZIP or TAR archive output
Real-time Progress
- Server-Sent Events (SSE) for live updates
- Detailed conversion status per file
- Progress percentage tracking
Production Ready
- Automatic rate limiting
- File size validation
- Prometheus metrics endpoint
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/status | Service health and dependency status |
| GET | /api/formats | Supported formats and conversion matrix |
| POST | /api/convert | Submit conversion job |
| GET | /api/jobs/{id} | Get job status and progress |
| GET | /api/jobs/{id}/events | SSE stream for real-time updates |
| GET | /api/jobs/{id}/conversions | Detailed conversion information |
| GET | /api/jobs/{id}/download | Download conversion results |
Rate Limits & Configuration
File Limits
- Max file size: 25 MB
- Max batch size: 50 MB
- Max files per batch: 20 files
Concurrency & Retention
- Max concurrent jobs per IP: 5 jobs
- Archive retention: 1 hour
- Metadata retention: 24 hours
Code Examples
JavaScript (Fetch API)
// Submit conversion job
const formData = new FormData();
formData.append('files', fileInput.files[0]);
formData.append('targetFormats', 'WOFF,WOFF2');
formData.append('output', 'zip');
const response = await fetch('/api/convert', {
method: 'POST',
body: formData
});
const { jobId, eventsUrl } = await response.json();
// Monitor progress with SSE
const eventSource = new EventSource(eventsUrl);
eventSource.onmessage = (event) => {
const progress = JSON.parse(event.data);
console.log(`Progress: ${progress.processingPct}%`);
};
Python
import requests
# Submit conversion job
files = {'files': open('myfont.ttf', 'rb')}
data = {'targetFormats': 'WOFF,WOFF2', 'output': 'zip'}
response = requests.post('https://onlinefontconverter.com/api/convert',
files=files, data=data)
job = response.json()
# Poll for completion
while True:
status = requests.get(f"https://onlinefontconverter.com/api/jobs/{job['jobId']}")
job_data = status.json()
if job_data['status'] == 'COMPLETE':
break
time.sleep(1)
# Download results
with open('converted.zip', 'wb') as f:
result = requests.get(job_data['downloadUrl'])
f.write(result.content)