Skip to content

API Reference

The Coffer backend exposes a REST API at /api/v1. When running locally, interactive API documentation is available via Swagger UI at http://localhost:8080/swagger-ui.html.

GET /api/v1/coins?page=0&size=20&sort=createdAt,desc

Query parameters for filtering:

ParameterTypeDescription
pageintegerPage number (0-indexed)
sizeintegerPage size (default: 20)
sortstringSort field and direction
searchstringSearch by title
countrystringFilter by ISO 3166-1 country code
metalTypestringGOLD, SILVER, PLATINUM, NICKEL
gradestringGOOD through PROOF
typestringBULLION, COMMEMORATIVE_CIRCULATION, etc.
yearFromintegerMinimum year
yearTointegerMaximum year
POST /api/v1/coins
Content-Type: application/json
{
"title": "American Gold Eagle 1 oz",
"year": 2024,
"countryCode": "US",
"currency": "USD",
"denomination": 50,
"metalType": "GOLD",
"weight": 31.1,
"purity": 917,
"grade": "UNCIRCULATED",
"type": "BULLION",
"numistaId": "12345",
"quantity": 1
}
PUT /api/v1/coins/{id}
Content-Type: application/json

Same body format as create.

DELETE /api/v1/coins/{id}
GET /api/v1/coins/{id}/valuation?timeframe=1d

Returns historical metal and collector valuations for a specific coin.

TimeframeResolution
1h5-minute intervals
1d5-minute intervals
1wDaily
1mDaily
1yDaily
maxDaily
GET /api/v1/portfolio/valuation?timeframe=1d

Returns aggregate portfolio value over time.

GET /api/v1/catalog/search?query=gold+eagle

Searches the Numista catalog. Returns matching coin types with thumbnails.

GET /api/v1/catalog/types/{typeId}

Returns full details for a Numista coin type, including issues, images, and physical properties.

FieldConstraint
countryCodeExactly 2 characters (ISO 3166-1)
currencyExactly 3 characters (ISO 4217)
year1–2100
purity1–1000 (representing 0.1%–100%)
weightGreater than 0
quantityMinimum 1 (default: 1)
numistaIdMax 50 characters

GOLD, SILVER, PLATINUM, NICKEL

GOOD, VERY_GOOD, FINE, VERY_FINE, EXTREMELY_FINE, ABOUT_UNCIRCULATED, UNCIRCULATED, PROOF

BULLION, COMMEMORATIVE_CIRCULATION, STANDARD_CIRCULATION, COMMEMORATIVE_NON_CIRCULATION, OTHER