Overview
The FoN API is a RESTful API that allows you to interact with the FoN platform programmatically. All requests should be made to the base URL:Authentication
Most endpoints require authentication. The API supports multiple authentication methods:Bearer Token
Pass a JWT or API token in the
Authorization headerCookie
Session cookie (
auth-token) for browser-based requestsRequest Format
JSON Requests
For endpoints that accept JSON, set theContent-Type header:
Form Data
For file uploads, usemultipart/form-data:
Response Format
All responses are returned as JSON:Error Responses
Errors include a message describing the issue:HTTP Status Codes
| Code | Description |
|---|---|
200 | Success |
304 | Not Modified (cached) |
400 | Bad Request - Invalid input |
401 | Unauthorized - Authentication required |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource doesn’t exist |
413 | Payload Too Large - File exceeds limit |
429 | Too Many Requests - Rate limited |
500 | Internal Server Error |
Rate Limits
The API enforces rate limits to ensure fair usage:| Endpoint Category | Limit | Window |
|---|---|---|
| Authentication | 5 requests | 15 minutes |
| Uploads | 20 requests | 1 hour |
| Voting | 20 requests | 1 hour |
| General | Standard | Rolling window |
429 response with a Retry-After header.
Pagination
List endpoints support pagination via query parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-indexed) |
limit | integer | 12 | Items per page (max 50) |
Caching
The API uses caching to improve performance:| Endpoint | Cache Duration |
|---|---|
/api/uploads | 2 minutes |
/api/items-recent | 5 minutes |
/api/profile | 30 seconds |
/api/image/{id} | 1 year (public) |
ETag header for conditional requests.
OpenAPI Specification
The complete API is documented using OpenAPI 3.1. You can:View OpenAPI Spec
Download the full OpenAPI specification