Skip to content

Get exchange rates

You can check which currency pairs Gravv supports and retrieve current exchange rates before executing trades.

Check supported currency pairs

Use the Get all currency pair rates endpoint to see all available currency pairs:

curl --request GET \
     --url https://api.gravv.xyz/v1/fx/rates \
     --header 'Api-Key: <Api Key>' \
     --header 'accept: application/json'

You will receive a response showing available currency pairs:

{
  "data": [
    {
      "ask_rate": 13.7741,
      "bid_rate": 13.7741,
      "currency_pair": "BWP/USD",
      "from_currency": "BWP",
      "from_currency_name": null,
      "timestamp": "2026-03-23T12:50:32.082350079+01:00",
      "to_currency": "USD",
      "to_currency_name": null
    },
    {
      "ask_rate": 18.4025,
      "bid_rate": 18.4025,
      "currency_pair": "USD/ZAR",
      "from_currency": "USD",
      "from_currency_name": null,
      "timestamp": "2026-03-23T12:50:32.450793659+01:00",
      "to_currency": "ZAR",
      "to_currency_name": null
    }
  ],
  "error": null
}

Request an exchange rate

Use the Get FX Quote endpoint to get a current exchange rate for a specific currency pair. Include your Api-Key and the x-tenant-id header. Also, include the trade direction in your request body:

curl --request POST \
     --url https://api.gravv.xyz/v1/fx/rate \
     --header 'Api-Key: <Api Key>' \
     --header 'Idempotency-Key: 979879887678789_attempt_1' \
     --header 'x-tenant-id: <tenant id>' \
     --header 'content-type: application/json' \
     --data '
{
  "from_currency": "USD",
  "to_currency": "ZAR",
  "amount": 10,
  "direction": "BUY"
}
'

The response includes a rate quote with an expiration time. Save the quote_id as you will use it later to execute the trade:

{
  "data": {
    "amount": 10,
    "direction": "BUY",
    "expires_at": "2026-03-23T12:45:28.424260688+01:00",
    "from_currency": "USD",
    "quote_id": "QT-M2hPM9qt",
    "rate": 17.715,
    "receivable_amount": 177.15,
    "to_currency": "ZAR"
  },
  "error": null
}