Currency Converter API

Part of the Forex Reference Suite. One request converts an amount from one currency into another at the latest rate and returns the rate that was used, the result and the time of the rate. The rates are updated every 5 minutes. Any two of the 156 supported currencies can be combined.

Endpoint

GEThttps://api.iban.com/clients/api/currency/convert/?api_key=YOUR_API_KEY&format=json&from=USD&to=EUR&amount=120
POSThttps://api.iban.com/clients/api/currency/convert/
  • HTTPS, GET or POST. With POST the parameters are sent form-encoded in the body.
  • The answer is JSON by default; format=xml returns the same data as XML.
  • Call the API from your server and keep the key out of browser code: a key sent in a URL is written to access logs.

Request

ParameterRequiredValueDescription
api_keyyesstringYour personal key, shown under API Access.
fromyesstring, 3 lettersISO 4217 code of the currency to convert from, for example USD. Lower case is accepted.
toyesstring, 3 lettersISO 4217 code of the currency to convert to, for example EUR. Lower case is accepted.
amountyesnumberThe amount to convert, in the from currency; decimals with a point (12.50) are accepted.
formatnojson or xmlFormat of the answer. JSON when omitted.

Example request

Replace YOUR_API_KEY with the key from API Access.

curl "https://api.iban.com/clients/api/currency/convert/?api_key=YOUR_API_KEY&format=json&from=USD&to=EUR&amount=120"

Response

The answer to the example request, recorded on 26 November 2026:

{
   "time": "11-26-2026 12:31:09",
   "timestamp": 1795696269,
   "from": "USD",
   "to": "EUR",
   "amount": "120",
   "rate": 0.91145,
   "convert_result": 109.374
}
FieldTypeDescription
timestringTime of the rate that was used in UTC, MM-DD-YYYY hh:mm:ss. The rates are updated every 5 minutes.
timestampnumberThe same time as Unix time.
fromstringThe source currency of the request, in upper case.
tostringThe target currency of the request, in upper case.
amountstringThe amount of the request as it was sent, as a string ("120", "12.50").
ratenumberThe exchange rate used: the value of one unit of from in to.
convert_resultnumberamount multiplied by rate.
XML

With format=xml the root element is result and the fields are child elements with the same names (in the order time, timestamp, from, to, rate, amount, convert_result). An error element is always present; in a successful answer its code and message are empty:

<?xml version="1.0"?>
<result>
   <time>11-26-2026 12:31:09</time>
   <timestamp>1795696269</timestamp>
   <from>USD</from>
   <to>EUR</to>
   <rate>0.91145</rate>
   <amount>120</amount>
   <convert_result>109.374</convert_result>
   <error>
      <code/>
      <message/>
   </error>
</result>

When the request is refused the data elements are empty and error is filled:

<?xml version="1.0"?>
<result>
   <time/>
   <timestamp/>
   <from/>
   <to/>
   <rate/>
   <amount/>
   <convert_result/>
   <error>
      <code>401</code>
      <message>API Key is invalid</message>
   </error>
</result>

Error codes

A refused request is answered with an error object instead of the data. code is a string:

{"error":{"code":"401","message":"API Key is invalid"}}
CodeTypeMessageWhat to do
401AccountAPI Key is invalidCheck the key under API Access.
402AccountSubscription expiredRenew the Forex Reference Suite service under My Services.
403AccountYou have no access to this APIThe Forex Reference Suite service is not on the account.
405AccountIP Address not allowedAdd the address of your server to the access list of the key.
406AccountNo queries availableThe query balance is used up; refill the service.
407InputFROM currency not supportedSend a supported ISO 4217 code as from.
408InputTO currency not supportedSend a supported ISO 4217 code as to.
409InputInvalid amountSend a number as amount.

A request without the required parameters is not answered with an error object: it is refused with an HTTP error status (400 Bad Request), so send every required parameter. 500 (“Internal Server Error. Contact Support.”) is a problem on our side: retry later and contact support if it persists.

Checking your balance

The services endpoint lists every service on your account with its remaining queries and expiry date, and does not use a query. This API belongs to the service Forex Reference Suite.

GEThttps://api.iban.com/clients/api/v4/services/?api_key=YOUR_API_KEY&format=json

Related: Exchange Rates API, the other API of the Forex Reference Suite.