Endpoint
Authentication
No authentication required. This is a public endpoint.Request
This endpoint does not require any parameters, headers, or request body.Example Request
Response
The endpoint returns a JSON object containing the current USD to Bolivares exchange rate.Response Fields
The current USD to Bolivares exchange rate as a numeric value (e.g., 36.50 Bs per USD). This rate is retrieved from Redis cache for optimal performance. If Redis is unavailable, the system automatically falls back to the latest rate stored in the database.
Success Response
Status Code:200 OK
Example Responses
Error Responses
Error message describing what went wrong during the request processing.
500 Internal Server Error
Implementation Details
The rate retrieval follows a resilient architecture:-
Redis Cache (Primary): The endpoint first attempts to retrieve the cached exchange rate from Redis using the key
btc:value(note: despite the key name, this stores the USD to Bolivares rate). This provides the fastest response time for frequently accessed data. - Database Fallback (Secondary): If Redis is unavailable, returns an invalid value, or the cached value cannot be parsed as a number, the system automatically queries the database for the latest stored rate.
- Graceful Degradation: If both data sources fail, the endpoint returns a user-friendly message indicating that data is temporarily unavailable, rather than throwing an error.
Use Cases
- Display current exchange rates to users in the application UI
- Calculate transaction amounts for currency exchanges
- Monitor rate fluctuations for analytics and reporting
- Verify pricing before executing trades
- Integration with third-party systems requiring current rate information
Notes
- The rate value is cached in Redis for performance optimization
- No rate limit is enforced on this endpoint as it’s read-only and lightweight
- The rate is updated asynchronously by background processes
- Response times are typically under 10ms when served from Redis cache
- The endpoint does not support query parameters or request body data