Get current exchange rates from a base currency
GET
/exchange-rates
const url = 'http://localhost:8000/api/v1/exchange-rates?base=USD&targets=EUR%2CGBP%2CJPY&target=EUR';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:8000/api/v1/exchange-rates?base=USD&targets=EUR%2CGBP%2CJPY&target=EUR' \ --header 'Authorization: Bearer <token>'Returns rates from the base currency to each requested target, honoring the authenticated user’s manual exchange rates. Targets with no available rate are listed under “unavailable” rather than returned as a rate.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ” base
required
string
Example
USD targets
string
Example
EUR,GBP,JPYComma-separated target currency codes. Use this or “target”.
target
string
Example
EURA single target currency code. Use this or “targets”.
Responses
Section titled “ Responses ”Rates retrieved
Media type application/json
object
data
object
base
string
rates
object
unavailable
Array<string>
Example
{ "data": { "base": "USD", "rates": { "EUR": 0.92, "GBP": 0.79 }, "unavailable": [ "JPY" ] }}Unauthenticated
Validation error