{
  "openapi": "3.0.3",
  "info": {
    "title": "Exchange Rates API — ECB History & Conversion",
    "version": "0.1.0",
    "description": "Callable Labs public endpoint reference. Obtain the base URL and credentials from the marketplace listing. Availability can differ by marketplace."
  },
  "paths": {
    "/v1/latest": {
      "get": {
        "tags": [
          "Rates"
        ],
        "summary": "Get latest reference rates",
        "description": "The most recent publication for every currency, or just `symbols`, per one `base`.",
        "operationId": "Get latest reference rates",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rates"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed. Verify the RapidAPI subscription and generated request headers."
          },
          "413": {
            "description": "The request body exceeds the configured gateway or endpoint limit."
          },
          "422": {
            "description": "Invalid parameters: `invalid_request`, `unknown_currency`, `currency_unavailable`, `date_out_of_range`, `range_too_large`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "The subscriber's rate limit or monthly request allowance was exceeded."
          },
          "502": {
            "description": "The origin service is temporarily unavailable."
          },
          "503": {
            "description": "`rates_unavailable`: no reference rates loaded yet; honour `Retry-After`",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3,
              "description": "Base currency (ISO 4217). Default `EUR`.",
              "default": "EUR",
              "title": "Base"
            },
            "description": "Base currency (ISO 4217). Default `EUR`.",
            "example": "USD"
          },
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 400,
              "nullable": true,
              "title": "Symbols",
              "description": "Comma-separated currencies to return, e.g. `USD,GBP,JPY`. Default: all available."
            },
            "description": "Comma-separated currencies to return, e.g. `USD,GBP,JPY`. Default: all available.",
            "example": "EUR,GBP,AED"
          }
        ]
      }
    },
    "/v1/historical/{date}": {
      "get": {
        "tags": [
          "Rates"
        ],
        "summary": "Get historical reference rates",
        "description": "The publication on `date`, or the last one before it when `date` was a weekend or TARGET\nholiday (`requested_date` then says so). Retired currencies answer for their own years.",
        "operationId": "Get historical reference rates",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rates"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed. Verify the RapidAPI subscription and generated request headers."
          },
          "413": {
            "description": "The request body exceeds the configured gateway or endpoint limit."
          },
          "422": {
            "description": "Invalid parameters: `invalid_request`, `unknown_currency`, `currency_unavailable`, `date_out_of_range`, `range_too_large`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "The subscriber's rate limit or monthly request allowance was exceeded."
          },
          "502": {
            "description": "The origin service is temporarily unavailable."
          },
          "503": {
            "description": "`rates_unavailable`: no reference rates loaded yet; honour `Retry-After`",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "description": "ISO date from 1999-01-04",
              "title": "Date",
              "example": "2024-03-15"
            },
            "description": "ISO date from 1999-01-04",
            "example": "2024-03-16"
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3,
              "description": "Base currency (ISO 4217). Default `EUR`.",
              "default": "EUR",
              "title": "Base"
            },
            "description": "Base currency (ISO 4217). Default `EUR`."
          },
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 400,
              "nullable": true,
              "title": "Symbols",
              "description": "Comma-separated currencies to return, e.g. `USD,GBP,JPY`. Default: all available."
            },
            "description": "Comma-separated currencies to return, e.g. `USD,GBP,JPY`. Default: all available.",
            "example": "USD"
          }
        ]
      }
    },
    "/v1/convert": {
      "get": {
        "tags": [
          "Rates"
        ],
        "summary": "Convert currency",
        "description": "`amount` of `from` in `to`, at the latest rates or on `date`.",
        "operationId": "Convert currency",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversion"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed. Verify the RapidAPI subscription and generated request headers."
          },
          "413": {
            "description": "The request body exceeds the configured gateway or endpoint limit."
          },
          "422": {
            "description": "Invalid parameters: `invalid_request`, `unknown_currency`, `currency_unavailable`, `date_out_of_range`, `range_too_large`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "The subscriber's rate limit or monthly request allowance was exceeded."
          },
          "502": {
            "description": "The origin service is temporarily unavailable."
          },
          "503": {
            "description": "`rates_unavailable`: no reference rates loaded yet; honour `Retry-After`",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3,
              "description": "ISO 4217 code",
              "title": "From",
              "example": "USD"
            },
            "description": "ISO 4217 code",
            "example": "USD"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3,
              "description": "ISO 4217 code",
              "title": "To",
              "example": "EUR"
            },
            "description": "ISO 4217 code",
            "example": "JPY"
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 1000000000000000,
              "description": "Amount in `from`",
              "default": 1,
              "title": "Amount",
              "example": 100,
              "minimum": 0,
              "exclusiveMinimum": true
            },
            "description": "Amount in `from`",
            "example": 250
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "nullable": true,
              "title": "Date",
              "description": "Use that day's rates; default latest",
              "example": "2026-10-06"
            },
            "description": "Use that day's rates; default latest",
            "example": "2026-10-06"
          }
        ]
      }
    },
    "/v1/timeseries": {
      "get": {
        "tags": [
          "Rates"
        ],
        "summary": "Get a daily time series",
        "description": "Every publication from `start` to `end` (up to 366 days). Currencies without a rate on a\ngiven day are left out of that day.",
        "operationId": "Get a daily time series",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimeSeries"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed. Verify the RapidAPI subscription and generated request headers."
          },
          "413": {
            "description": "The request body exceeds the configured gateway or endpoint limit."
          },
          "422": {
            "description": "Invalid parameters: `invalid_request`, `unknown_currency`, `currency_unavailable`, `date_out_of_range`, `range_too_large`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "The subscriber's rate limit or monthly request allowance was exceeded."
          },
          "502": {
            "description": "The origin service is temporarily unavailable."
          },
          "503": {
            "description": "`rates_unavailable`: no reference rates loaded yet; honour `Retry-After`",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before retrying"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "description": "First day, included",
              "title": "Start",
              "example": "2026-09-01"
            },
            "description": "First day, included",
            "example": "2026-09-01"
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "description": "Last day, included",
              "title": "End",
              "example": "2026-09-30"
            },
            "description": "Last day, included",
            "example": "2026-09-30"
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 3,
              "description": "Base currency (ISO 4217). Default `EUR`.",
              "default": "EUR",
              "title": "Base"
            },
            "description": "Base currency (ISO 4217). Default `EUR`.",
            "example": "USD"
          },
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 400,
              "nullable": true,
              "title": "Symbols",
              "description": "Comma-separated currencies to return, e.g. `USD,GBP,JPY`. Default: all available."
            },
            "description": "Comma-separated currencies to return, e.g. `USD,GBP,JPY`. Default: all available.",
            "example": "EUR"
          }
        ]
      }
    },
    "/v1/currencies": {
      "get": {
        "tags": [
          "Reference"
        ],
        "summary": "List currencies",
        "description": "Every currency with its name, whether it is an ECB reference rate or a fixed parity, and the\nfirst and last day it has a rate (retired currencies such as HRK or BGN stop).",
        "operationId": "List currencies",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrencyList"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed. Verify the RapidAPI subscription and generated request headers."
          },
          "413": {
            "description": "The request body exceeds the configured gateway or endpoint limit."
          },
          "422": {
            "description": "Invalid parameters: `invalid_request`, `unknown_currency`, `currency_unavailable`, `date_out_of_range`, `range_too_large`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "The subscriber's rate limit or monthly request allowance was exceeded."
          },
          "502": {
            "description": "The origin service is temporarily unavailable."
          },
          "503": {
            "description": "`rates_unavailable`: no reference rates loaded yet; honour `Retry-After`",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Rates": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source",
            "example": "European Central Bank euro foreign exchange reference rates; fixed-parity currencies derived from their official pegs"
          },
          "notice": {
            "type": "string",
            "title": "Notice",
            "example": "Reference rates for information, published around 16:00 CET on TARGET business days; not for trading."
          },
          "pegged": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Pegged",
            "description": "Currencies in this answer derived from a fixed official parity rather than an ECB rate",
            "example": [
              "AED"
            ]
          },
          "base": {
            "type": "string",
            "title": "Base",
            "example": "USD"
          },
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date",
            "description": "Publication date of the rates used",
            "example": "2026-10-06"
          },
          "requested_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "title": "Requested Date",
            "description": "The date asked for, when it had no publication (weekend or TARGET holiday)",
            "example": null
          },
          "rates": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Rates",
            "description": "Units of each currency per one `base`, 8 significant digits",
            "example": {
              "AED": 3.6725,
              "EUR": 0.88738131,
              "GBP": 0.75321678
            }
          }
        },
        "type": "object",
        "required": [
          "source",
          "notice",
          "pegged",
          "base",
          "date",
          "rates"
        ],
        "title": "Rates"
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "detail"
        ],
        "properties": {
          "detail": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable failure code"
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation"
              },
              "errors": {
                "type": "array",
                "description": "Per-field or per-line detail when there is more than one thing to fix",
                "items": {
                  "type": "object",
                  "properties": {
                    "loc": {
                      "type": "string",
                      "description": "Field path, e.g. `body.scale`"
                    },
                    "line": {
                      "type": "integer"
                    },
                    "column": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "additionalProperties": true
          }
        }
      },
      "Conversion": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source",
            "example": "European Central Bank euro foreign exchange reference rates; fixed-parity currencies derived from their official pegs"
          },
          "notice": {
            "type": "string",
            "title": "Notice",
            "example": "Reference rates for information, published around 16:00 CET on TARGET business days; not for trading."
          },
          "pegged": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Pegged",
            "description": "Currencies in this answer derived from a fixed official parity rather than an ECB rate",
            "example": [
              "AED"
            ]
          },
          "from": {
            "type": "string",
            "title": "From",
            "example": "USD"
          },
          "to": {
            "type": "string",
            "title": "To",
            "example": "EUR"
          },
          "amount": {
            "type": "number",
            "title": "Amount",
            "example": 100
          },
          "rate": {
            "type": "number",
            "title": "Rate",
            "example": 0.88738131
          },
          "result": {
            "type": "number",
            "title": "Result",
            "description": "`amount` × `rate`, 6 decimal places",
            "example": 88.738131
          },
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date",
            "example": "2026-10-06"
          },
          "requested_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "title": "Requested Date",
            "example": null
          }
        },
        "type": "object",
        "required": [
          "source",
          "notice",
          "pegged",
          "from",
          "to",
          "amount",
          "rate",
          "result",
          "date"
        ],
        "title": "Conversion"
      },
      "TimeSeries": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source",
            "example": "European Central Bank euro foreign exchange reference rates; fixed-parity currencies derived from their official pegs"
          },
          "notice": {
            "type": "string",
            "title": "Notice",
            "example": "Reference rates for information, published around 16:00 CET on TARGET business days; not for trading."
          },
          "pegged": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Pegged",
            "description": "Currencies in this answer derived from a fixed official parity rather than an ECB rate",
            "example": [
              "AED"
            ]
          },
          "base": {
            "type": "string",
            "title": "Base",
            "example": "USD"
          },
          "start": {
            "type": "string",
            "format": "date",
            "title": "Start",
            "example": "2026-09-01"
          },
          "end": {
            "type": "string",
            "format": "date",
            "title": "End",
            "example": "2026-09-30"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Publication days in the range",
            "example": 22
          },
          "rates": {
            "additionalProperties": {
              "additionalProperties": {
                "type": "number"
              },
              "type": "object"
            },
            "type": "object",
            "title": "Rates",
            "description": "Publication date → currency → rate (weekends and TARGET holidays have no entry)",
            "example": {
              "2026-09-30": {
                "EUR": 0.8912,
                "GBP": 0.7466
              }
            }
          }
        },
        "type": "object",
        "required": [
          "source",
          "notice",
          "pegged",
          "base",
          "start",
          "end",
          "count",
          "rates"
        ],
        "title": "TimeSeries"
      },
      "CurrencyList": {
        "properties": {
          "latest": {
            "type": "string",
            "format": "date",
            "title": "Latest",
            "description": "Latest publication",
            "example": "2026-10-06"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "example": 66
          },
          "currencies": {
            "items": {
              "$ref": "#/components/schemas/CurrencyOut"
            },
            "type": "array",
            "title": "Currencies"
          }
        },
        "type": "object",
        "required": [
          "latest",
          "count",
          "currencies"
        ],
        "title": "CurrencyList"
      },
      "CurrencyOut": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code",
            "example": "AED"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "example": "UAE dirham"
          },
          "kind": {
            "type": "string",
            "title": "Kind",
            "description": "`ecb` (ECB reference rate), `peg` (fixed parity) or `euro`",
            "example": "peg"
          },
          "parity": {
            "type": "string",
            "nullable": true,
            "title": "Parity",
            "description": "The official parity, for pegged currencies",
            "example": "3.6725 per USD (fixed)"
          },
          "first_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "title": "First Date",
            "example": "1999-01-04"
          },
          "last_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "title": "Last Date",
            "description": "Last day with a rate (a retired currency stops)",
            "example": "2026-10-06"
          },
          "current": {
            "type": "boolean",
            "title": "Current",
            "description": "Has a rate on the latest publication",
            "example": true
          }
        },
        "type": "object",
        "required": [
          "code",
          "name",
          "kind",
          "first_date",
          "last_date",
          "current"
        ],
        "title": "CurrencyOut"
      }
    }
  }
}
