Overview
Returns the current USD price for a specified cryptocurrency. Requests for the same coin are batched for up to 5 seconds (or flushed early at threshold) to optimize upstream API calls.Endpoint
Authentication
Required: Bearer token authentication Include the JWT token from the login endpoint in the Authorization header:Path Parameters
CoinGecko coin identifier (lowercase letters, numbers, and hyphens)Example:
bitcoin, ethereum, binancecoinRequest Batching
This endpoint implements intelligent request batching:- Requests for the same coin are grouped together
- Batch flushes after 5 seconds (configurable via
BATCH_WINDOW_MS) OR when 3 requests accumulate (configurable viaBATCH_THRESHOLD) - One upstream CoinGecko API call serves all waiting requests
- Results are persisted to PostgreSQL for historical tracking
Response
The cryptocurrency identifierExample:
bitcoinThe currency the price is denominated in (always “usd”)Example:
usdCurrent USD priceExample:
67210.45ISO 8601 timestamp when the price was fetched from upstreamExample:
2026-02-28T03:55:00.000ZExample Request
Example Response
Error Codes
| Status Code | Description |
|---|---|
200 | Price returned successfully |
400 | Invalid coinId format (must be lowercase, numbers, hyphens only) |
401 | Missing or invalid bearer token |
404 | Coin not found in CoinGecko upstream |
429 | Rate limit exceeded (application throttler or upstream provider) |
502 | Upstream request failed |
503 | Backend coordination unavailable (Redis for rate limiter or batching) |
504 | Timed out waiting for batch result (default: 8 seconds) |