API documentation for SlowPokeAPI.
http://localhost:8080
API key authentication is optional and controlled via configuration.
Include the API key in the X-API-Key header:
curl -H "X-API-Key: your-api-key" http://localhost:8080/v1/latest/USDThe following endpoints are accessible without authentication:
GET /health- Health checkGET /healthz- Liveness probeGET /readyz- Readiness probeGET /livez- Liveness probeGET /metrics- Prometheus metricsGET /swagger-ui- Swagger UI documentationGET /api-docs/openapi.json- OpenAPI specification
Rate limiting behavior depends on configuration.
| Header | Description |
|---|---|
X-RateLimit-Limit |
Maximum requests allowed |
X-RateLimit-Remaining |
Remaining requests |
X-RateLimit-Reset |
Seconds until reset |
Retry-After |
Seconds to wait (on 429) |
Check current quota status:
GET /v1/quotaResponse:
{
"api_key": "***...abcd",
"limit": 100,
"remaining": 95,
"reset_seconds": 3600
}List all supported currencies.
Parameters: None
Response:
{
"AED": "United Arab Emirates Dirham",
"AFN": "Afghan Afghani",
"EUR": "Euro",
"GBP": "British Pound Sterling",
"USD": "United States Dollar"
}List currencies in minimal format.
Response: Same as /v1/currencies but typically cached.
Get latest exchange rates for a base currency.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| base_code | path | string | Yes | 3-letter currency code (e.g., USD, EUR, BTC) |
Response:
{
"result": "success",
"documentation": "https://github.com/e6qu/slowpokeapi",
"time_last_update_unix": 1704067200,
"time_last_update_utc": "2024-01-01T00:00:00Z",
"time_next_update_unix": 1704153600,
"time_next_update_utc": "2024-01-02T00:00:00Z",
"base_code": "USD",
"conversion_rates": {
"EUR": 0.9234,
"GBP": 0.7891,
"JPY": 148.50
},
"data_source": {
"source": "frankfurter",
"last_retrieved": "2024-01-01T00:00:00Z",
"last_cached": null,
"upstream_request": {
"endpoint": "https://api.frankfurter.app/latest?from=USD"
}
}
}Convert between two currencies.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| base_code | path | string | Yes | Source currency code |
| target_code | path | string | Yes | Target currency code |
| amount | query | number | No | Amount to convert |
Response (without amount):
{
"result": "success",
"documentation": "https://github.com/e6qu/slowpokeapi",
"time_last_update_unix": 1704067200,
"time_last_update_utc": "2024-01-01T00:00:00Z",
"time_next_update_unix": 1704153600,
"time_next_update_utc": "2024-01-02T00:00:00Z",
"base_code": "USD",
"target_code": "EUR",
"conversion_rate": 0.9234,
"data_source": {
"source": "frankfurter",
"last_retrieved": "2024-01-01T00:00:00Z",
"last_cached": null,
"upstream_request": {
"endpoint": "https://api.frankfurter.app/latest?from=USD"
}
}
}Response (with amount):
{
"result": "success",
"documentation": "https://github.com/e6qu/slowpokeapi",
"time_last_update_unix": 1704067200,
"time_last_update_utc": "2024-01-01T00:00:00Z",
"time_next_update_unix": 1704153600,
"time_next_update_utc": "2024-01-02T00:00:00Z",
"base_code": "USD",
"target_code": "EUR",
"conversion_rate": 0.9234,
"conversion_result": 92.34,
"data_source": {
"source": "frankfurter",
"last_retrieved": "2024-01-01T00:00:00Z",
"last_cached": null,
"upstream_request": {
"endpoint": "https://api.frankfurter.app/latest?from=USD"
}
}
}Get historical exchange rates for a specific date.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| base_code | path | string | Yes | Base currency code |
| year | path | integer | Yes | 4-digit year |
| month | path | integer | Yes | Month (1-12) |
| day | path | integer | Yes | Day (1-31) |
Notes:
- Minimum date: 1999-01-04 (Frankfurter API limitation)
- Future dates are rejected
- Crypto and metal currencies are not supported
Response:
{
"result": "success",
"documentation": "https://github.com/e6qu/slowpokeapi",
"year": 2023,
"month": 12,
"day": 25,
"base_code": "USD",
"conversion_rates": {
"EUR": 0.9123,
"GBP": 0.7845,
"JPY": 149.20
},
"data_source": {
"source": "frankfurter",
"last_retrieved": "2024-01-01T00:00:00Z",
"last_cached": null,
"upstream_request": {
"endpoint": "https://api.frankfurter.app/2023-12-25?from=USD"
}
}
}Get exchange rate with additional metadata for the target currency.
Parameters:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| base_code | path | string | Yes | Base currency code |
| target_code | path | string | Yes | Target currency code |
Response:
{
"result": "success",
"time_last_update_unix": 1704067200,
"time_last_update_utc": "2024-01-01T00:00:00Z",
"base_code": "USD",
"target_code": "EUR",
"conversion_rate": 0.9234,
"target_data": {
"code": "EUR",
"locale": "de-DE",
"two_letter_country_code": "DE",
"currency_name": "Euro",
"currency_name_short": "Euro",
"display_symbol": "€",
"flag_url": "https://flagcdn.com/w640/eu.png"
},
"data_source": {
"source": "frankfurter",
"last_retrieved": "2024-01-01T00:00:00Z",
"last_cached": null,
"upstream_request": {
"endpoint": "https://api.frankfurter.app/latest?from=USD"
}
}
}Deep health check endpoint.
Parameters: None
Response (200 OK):
{
"status": "healthy",
"version": "0.1.0",
"uptime_seconds": 3600,
"checks": {
"database": {
"status": "pass",
"message": "SQLite connection healthy",
"latency_ms": 2
}
}
}Response (503 Service Unavailable):
{
"status": "unhealthy",
"version": "0.1.0",
"uptime_seconds": 3600,
"checks": {
"database": {
"status": "fail",
"message": "Database connection failed",
"latency_ms": 5000
}
}
}Liveness probe. Returns "ok" if the service is running.
Parameters: None
Response (200 OK):
ok
Readiness probe.
Parameters: None
Response (200 OK):
ok
Response (503):
not ready
Liveness probe (alternative). Returns "ok" if the service is running.
Parameters: None
Response: Same as /healthz
Prometheus metrics endpoint.
Parameters: None
Response: Plain text in Prometheus exposition format
# HELP slowpokeapi_requests_total Total number of HTTP requests
# TYPE slowpokeapi_requests_total counter
slowpokeapi_requests_total{method="GET",status="200",path="/v1/latest/USD"} 42
# HELP slowpokeapi_request_duration_seconds HTTP request duration
# TYPE slowpokeapi_request_duration_seconds histogram
slowpokeapi_request_duration_seconds_bucket{le="0.1"} 35
...
Errors follow this format:
{
"result": "error",
"error_type": "invalid-currency",
"message": "Invalid currency code: XYZ"
}| Error Type | HTTP Status | Description |
|---|---|---|
malformed-request |
400 | Invalid request format |
invalid-currency |
400 | Invalid currency code |
invalid-date |
400 | Invalid date format |
not-found |
404 | Resource not found |
quota-reached |
429 | Rate limit exceeded |
invalid-key |
401 | Invalid API key |
Common codes: USD, EUR, GBP, JPY, CAD, AUD, CHF, CNY, SEK, NZD
Supported: BTC, ETH, BNB, XRP, ADA, SOL, DOT, DOGE, AVAX, MATIC, LINK, UNI, LTC, BCH, XLM
| Code | Name |
|---|---|
| XAU | Gold |
| XAG | Silver |
| XPT | Platinum |
| XPD | Palladium |
Interactive API documentation is available at:
http://localhost:8080/swagger-ui
OpenAPI JSON specification:
http://localhost:8080/api-docs/openapi.json