Available only in plans starting from PRO

Convert a specified quantity of an asset to another one.

HTTP Request:

GET /live/conversion

ParameterTypeDescription
“quantity”NumberQuantity of “from” asset to convert
“from”StringListing code of the asset to convert
“to”StringListing code of the target asset of the conversion
“truncate”Boolean(Optional, default: true) Specify if you want to truncate the converted result to the target asset significant decimal places

HTTP Request Example:

GET /live/conversion?quantity=10.5&from=USD&to=EUR

Common Errors:

  • 400, “INVALID_PARAMETER”

Example of successful response:

{
  "success": true,
  "lastUpdate": "2024-08-26T15:07:00.993Z",
  "data": "9.39"
}
FieldTypeDescription
“success”BooleanHTTP Request is successful, if it’s false you have to handle the error
“lastUpdate”DateTimeLatest data update time, depends on your subscription plan
“data”Decimal stringResult of requested asset conversion

⚠️ The decimal values are passed as strings to avoid loss of precision during the data transfer and JSON decode. You could parse them into a floating point value, but we advise you to use something like BigInteger.