<aside> 💱

QuickNode Add-On Documentation

</aside>

Introduction

This documentation outlines the Forex Exchange Rate API for our QuickNode add-on. The API provides a JSON-RPC method to retrieve exchange rates between a base currency and one or more target currencies. Once you install the add-on to your QuickNode endpoint, the forex_getExchangeRate method will be available on your endpoint.

Get Exchange Rates with forex_getExchangeRate

Retrieve exchange rates for a base currency against one or more target currencies.

curl example


  curl https://YOUR_QUICKNODE_ENDPOINT_HERE.com \\
  -X POST \\
  -H "Content-Type: application/json" \\
  --data '{"method":"forex_getExchangeRate","params": ["USD", "[\\"EUR\\", \\"GBP\\", \\"JPY\\", \\"AUD\\", \\"CAD\\"]"],"id":1,"jsonrpc":"2.0"}'

Request Parameters

The request body should be a JSON object with the following properties:

{
  "baseCurrency": "USD",
  "targetCurrencies": ["EUR", "GBP", "JPY"]
}

Response

The API will return a JSON object containing the exchange rates:

{
  "baseCurrency": "USD",
  "rates": {
    "EUR": 0.85,
    "GBP": 0.72,
    "JPY": 110.23
  },
  "timestamp": 1629984000
}