{
  "openapi": "3.1.0",
  "info": {
    "title": "Currency Converter API",
    "version": "1",
    "summary": "Convert an amount between two currencies",
    "description": "Part of the Forex Reference Suite of IBAN.com. One request converts an amount from one currency into another at the latest rate and\nreturns the rate used, the result and the time of the rate (UTC). The rates are updated every 5 minutes. Any two of the 156 supported currencies can be combined:\nAED AFN ALL AMD AOA ARS AUD AWG AZN BAM BBD BDT BHD BIF BMD BND BOB BRL BSD BTN BWP BYN BZD CAD CDF CHF CLF CLP CNY COP CRC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRU MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLE SOS SRD SSP STN SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD UYU UZS VES VND VUV WST XAF XCD XCG XDR XOF XPF YER ZAR ZMW.\n\nFull documentation: https://developer.iban.com/currency-converter-api\n\nExamples marked \"recorded\" are answers of api.iban.com on 26 Nov 2026.\n",
    "termsOfService": "https://www.iban.com/terms",
    "license": {
      "name": "Proprietary — IBAN.com Terms & Conditions",
      "url": "https://www.iban.com/terms"
    },
    "contact": {
      "name": "IBAN.com support",
      "url": "https://clients.iban.com/support"
    }
  },
  "servers": [
    {
      "url": "https://api.iban.com/clients/api/currency",
      "description": "Production."
    }
  ],
  "tags": [
    {
      "name": "Forex Reference Suite",
      "description": "Exchange rates and currency conversion."
    }
  ],
  "paths": {
    "/convert/": {
      "get": {
        "tags": [
          "Forex Reference Suite"
        ],
        "operationId": "convertGet",
        "summary": "Convert an amount between two currencies (GET)",
        "description": "Parameters in the query string.",
        "security": [
          {
            "ApiKeyQuery": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/amount"
          },
          {
            "$ref": "#/components/parameters/format"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Result"
          },
          "400": {
            "$ref": "#/components/responses/MissingParameters"
          }
        }
      },
      "post": {
        "tags": [
          "Forex Reference Suite"
        ],
        "operationId": "convertPost",
        "summary": "Convert an amount between two currencies (POST)",
        "description": "Parameters form-encoded in the body, the key as the field `api_key`.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Request"
              },
              "examples": {
                "example": {
                  "summary": "The example request of the documentation",
                  "value": {
                    "api_key": "YOUR_API_KEY",
                    "from": "USD",
                    "to": "EUR",
                    "amount": "120",
                    "format": "json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Result"
          },
          "400": {
            "$ref": "#/components/responses/MissingParameters"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key",
        "description": "Your personal key, shown under *API Access* in the client area, as the `api_key` parameter. On a POST request it is a field of the form body instead. An unknown key is answered with `{\"error\":{\"code\":\"401\",\"message\":\"API Key is invalid\"}}`."
      }
    },
    "parameters": {
      "from": {
        "name": "from",
        "in": "query",
        "required": true,
        "description": "ISO 4217 code of the currency to convert from. Lower case is accepted.",
        "schema": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "example": "USD"
      },
      "to": {
        "name": "to",
        "in": "query",
        "required": true,
        "description": "ISO 4217 code of the currency to convert to. Lower case is accepted.",
        "schema": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "example": "EUR"
      },
      "amount": {
        "name": "amount",
        "in": "query",
        "required": true,
        "description": "The amount to convert, in the `from` currency; decimals with a point are accepted.",
        "schema": {
          "type": "string",
          "pattern": "^[0-9]+(\\.[0-9]+)?$"
        },
        "example": "120"
      },
      "format": {
        "name": "format",
        "in": "query",
        "required": false,
        "description": "Response format: `json` (default when omitted) or `xml`.",
        "schema": {
          "type": "string",
          "enum": [
            "json",
            "xml"
          ],
          "default": "json"
        },
        "example": "json"
      }
    },
    "responses": {
      "Result": {
        "description": "The request was processed. A successful answer carries the data; a refused request carries only an `error` object\n(`code` as a string, `message`). Account errors: `401` API Key is invalid, `402` Subscription expired, `403` You have no access to this API, `405` IP Address not allowed, `406` No queries available. Input errors: `407` FROM currency not supported, `408` TO currency not supported, `409` Invalid amount.\nWith `format=xml` the same data is returned as XML (root `result`; an `error` element is always present, empty on success).\n",
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ConversionResponse"
                },
                {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              ]
            },
            "examples": {
              "usd_eur": {
                "summary": "120 USD to EUR (recorded 26 Nov 2026)",
                "value": {
                  "time": "11-26-2026 12:31:09",
                  "timestamp": 1795696269,
                  "from": "USD",
                  "to": "EUR",
                  "amount": "120",
                  "rate": 0.91145,
                  "convert_result": 109.374
                }
              },
              "usd_gbp": {
                "summary": "12.50 USD to GBP, sent in lower case (recorded 26 Nov 2026)",
                "value": {
                  "time": "11-26-2026 12:31:09",
                  "timestamp": 1795696269,
                  "from": "USD",
                  "to": "GBP",
                  "amount": "12.50",
                  "rate": 0.762975,
                  "convert_result": 9.53719
                }
              },
              "from_unsupported": {
                "summary": "from=XXX (recorded 26 Nov 2026)",
                "value": {
                  "error": {
                    "code": "407",
                    "message": "FROM currency not supported"
                  }
                }
              },
              "to_unsupported": {
                "summary": "to=XXX (recorded 26 Nov 2026)",
                "value": {
                  "error": {
                    "code": "408",
                    "message": "TO currency not supported"
                  }
                }
              },
              "invalid_amount": {
                "summary": "amount=abc (recorded 26 Nov 2026)",
                "value": {
                  "error": {
                    "code": "409",
                    "message": "Invalid amount"
                  }
                }
              },
              "unknown_key": {
                "summary": "Unknown key (recorded 26 Nov 2026)",
                "value": {
                  "error": {
                    "code": "401",
                    "message": "API Key is invalid"
                  }
                }
              },
              "no_access": {
                "summary": "Key without access to this API (recorded 26 Nov 2026)",
                "value": {
                  "error": {
                    "code": "403",
                    "message": "You have no access to this API"
                  }
                }
              }
            }
          },
          "application/xml": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "MissingParameters": {
        "description": "A required parameter is missing. The request is refused with an HTTP error status instead of an `error` object (status and body not recorded; 400 as documented)."
      }
    },
    "schemas": {
      "Request": {
        "type": "object",
        "required": [
          "api_key",
          "from",
          "to",
          "amount"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Your personal key, shown under *API Access* in the client area."
          },
          "from": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "ISO 4217 code of the currency to convert from. Lower case is accepted."
          },
          "to": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "ISO 4217 code of the currency to convert to. Lower case is accepted."
          },
          "amount": {
            "type": "string",
            "pattern": "^[0-9]+(\\.[0-9]+)?$",
            "description": "The amount to convert, in the `from` currency; decimals with a point are accepted."
          },
          "format": {
            "type": "string",
            "enum": [
              "json",
              "xml"
            ],
            "default": "json",
            "description": "Response format: `json` (default when omitted) or `xml`."
          }
        }
      },
      "ConversionResponse": {
        "type": "object",
        "required": [
          "time",
          "timestamp",
          "from",
          "to",
          "amount",
          "rate",
          "convert_result"
        ],
        "properties": {
          "time": {
            "type": "string",
            "description": "Time of the rate used in UTC, `MM-DD-YYYY hh:mm:ss`."
          },
          "timestamp": {
            "type": "integer",
            "description": "The same time as Unix time."
          },
          "from": {
            "type": "string",
            "description": "Source currency, upper case."
          },
          "to": {
            "type": "string",
            "description": "Target currency, upper case."
          },
          "amount": {
            "type": "string",
            "description": "The amount as it was sent, as a string."
          },
          "rate": {
            "type": "number",
            "description": "Value of one unit of `from` in `to`."
          },
          "convert_result": {
            "type": "number",
            "description": "`amount` × `rate`."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Error code as a string."
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
