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/publicCORS
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, AuthorizationCaching
Public endpoints are cached at Vercel's edge. Each endpoint documents its specific caching behavior, but the general pattern is:
| Endpoint | Fresh | Stale-While-Revalidate |
|---|---|---|
| Metadata | 1 hour | 1 day |
| News | 5 min | Indefinite |
| Auction Events | 1 hour | 1 day |
| Submissions | None | None |
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:
| Code | Meaning |
|---|---|
400 | Bad request — missing or invalid parameters |
404 | Resource not found |
405 | Method not allowed |
409 | Conflict — duplicate resource |
500 | Internal 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