Skip to main content

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:
https://api.fucksornot.com

Authentication

Most endpoints require authentication. The API supports multiple authentication methods:

Bearer Token

Pass a JWT or API token in the Authorization header

Cookie

Session cookie (auth-token) for browser-based requests
# Using Bearer token
curl https://api.fucksornot.com/api/profile \
  -H "Authorization: Bearer YOUR_TOKEN"

Request Format

JSON Requests

For endpoints that accept JSON, set the Content-Type header:
curl -X POST https://api.fucksornot.com/api/auth \
  -H "Content-Type: application/json" \
  -d '{"action": "login", "email": "...", "password": "..."}'

Form Data

For file uploads, use multipart/form-data:
curl -X POST https://api.fucksornot.com/api/upload \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "upload_type=image" \
  -F "description=My upload" \
  -F "file=@image.jpg"

Response Format

All responses are returned as JSON:
{
  "data": { ... },
  "error": null
}

Error Responses

Errors include a message describing the issue:
{
  "error": "unauthorized",
  "message": "Invalid or expired token"
}

HTTP Status Codes

CodeDescription
200Success
304Not Modified (cached)
400Bad Request - Invalid input
401Unauthorized - Authentication required
403Forbidden - Insufficient permissions
404Not Found - Resource doesn’t exist
413Payload Too Large - File exceeds limit
429Too Many Requests - Rate limited
500Internal Server Error

Rate Limits

The API enforces rate limits to ensure fair usage:
Endpoint CategoryLimitWindow
Authentication5 requests15 minutes
Uploads20 requests1 hour
Voting20 requests1 hour
GeneralStandardRolling window
When rate limited, you’ll receive a 429 response with a Retry-After header.

Pagination

List endpoints support pagination via query parameters:
ParameterTypeDefaultDescription
pageinteger1Page number (1-indexed)
limitinteger12Items per page (max 50)
curl "https://api.fucksornot.com/api/uploads?page=2&limit=20"
Response includes pagination info:
{
  "uploads": [...],
  "page": 2,
  "limit": 20
}

Caching

The API uses caching to improve performance:
EndpointCache Duration
/api/uploads2 minutes
/api/items-recent5 minutes
/api/profile30 seconds
/api/image/{id}1 year (public)
Use the 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

Endpoints