Skip to content

API Reference

The affini.ag public API provides read-only access to vehicle data, auction events, news, and community submissions.

Base URL

https://app.affini.ag/api/public

CORS

All public endpoints return permissive CORS headers:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization

Caching

Public endpoints are cached at Vercel's edge. Each endpoint documents its specific caching behavior, but the general pattern is:

EndpointFreshStale-While-Revalidate
Metadata1 hour1 day
News5 minIndefinite
Auction Events1 hour1 day
SubmissionsNoneNone

Response Format

All endpoints return JSON with Content-Type: application/json (except the news proxy, which returns XML).

Error Responses

Errors follow a consistent shape:

json
{
  "error": "Human-readable error message"
}

Common HTTP status codes:

CodeMeaning
400Bad request — missing or invalid parameters
404Resource not found
405Method not allowed
409Conflict — duplicate resource
500Internal server error

Endpoints

  • Metadata — Vehicle catalog with specs, traits, projections, and news
  • News — Google News RSS proxy for vehicle-related articles
  • Auction Events — Upcoming collector car auctions
  • Submissions — Community vehicle suggestions and voting