{
  "openapi": "3.1.0",
  "info": {
    "title": "Exchange Rates API",
    "version": "1",
    "summary": "Exchange rates of a base currency",
    "description": "Part of the Forex Reference Suite of IBAN.com. One request returns the exchange rates of the base currency you name against the\n155 other supported currencies, with the time of the latest update (UTC). The rates are updated every 5 minutes. 156 currencies are supported: AED 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/exchange-rates-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": {
    "/rates/": {
      "get": {
        "tags": [
          "Forex Reference Suite"
        ],
        "operationId": "getRatesGet",
        "summary": "Exchange rates of a base currency (GET)",
        "description": "Parameters in the query string.",
        "security": [
          {
            "ApiKeyQuery": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/currency"
          },
          {
            "$ref": "#/components/parameters/format"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Result"
          },
          "400": {
            "$ref": "#/components/responses/MissingParameters"
          }
        }
      },
      "post": {
        "tags": [
          "Forex Reference Suite"
        ],
        "operationId": "getRatesPost",
        "summary": "Exchange rates of a base currency (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",
                    "currency": "USD",
                    "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": {
      "currency": {
        "name": "currency",
        "in": "query",
        "required": true,
        "description": "ISO 4217 code of the base currency, one of the 156 supported currencies. Lower case is accepted.",
        "schema": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        },
        "example": "USD"
      },
      "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: `410` Invalid currency code.\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/RatesResponse"
                },
                {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              ]
            },
            "examples": {
              "usd": {
                "summary": "Rates for USD, first six and last two of 156 entries (recorded 26 Nov 2026)",
                "value": {
                  "base_currency": "USD",
                  "time": "11-26-2026 12:31:09",
                  "timestamp": 1795696269,
                  "rates": {
                    "AED": 3.6725,
                    "AFN": 64.9998,
                    "ALL": 81.8043,
                    "AMD": 359.9391,
                    "AOA": 918.0001,
                    "ARS": 1602.8174,
                    "ZMW": 20.8216,
                    "USD": 1
                  }
                }
              },
              "invalid_currency": {
                "summary": "currency=XXX (recorded 26 Nov 2026)",
                "value": {
                  "error": {
                    "code": "410",
                    "message": "Invalid currency code"
                  }
                }
              },
              "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",
          "currency"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Your personal key, shown under *API Access* in the client area."
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "ISO 4217 code of the base currency, one of the 156 supported currencies. Lower case is accepted."
          },
          "format": {
            "type": "string",
            "enum": [
              "json",
              "xml"
            ],
            "default": "json",
            "description": "Response format: `json` (default when omitted) or `xml`."
          }
        }
      },
      "RatesResponse": {
        "type": "object",
        "required": [
          "base_currency",
          "time",
          "timestamp",
          "rates"
        ],
        "properties": {
          "base_currency": {
            "type": "string",
            "description": "The base currency of the request, in upper case."
          },
          "time": {
            "type": "string",
            "description": "Time of the latest rates update in UTC, `MM-DD-YYYY hh:mm:ss`."
          },
          "timestamp": {
            "type": "integer",
            "description": "The same time as Unix time."
          },
          "rates": {
            "type": "object",
            "description": "One member per supported currency: ISO 4217 code → value of one unit of the base currency in that currency. The base currency itself is the last member, with the value 1.",
            "additionalProperties": {
              "type": "number"
            }
          }
        }
      },
      "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"
              }
            }
          }
        }
      }
    }
  }
}
