{
  "openapi": "3.1.0",
  "info": {
    "title": "Currency Exchange Rate API",
    "version": "1.0.0",
    "summary": "Current USD-based exchange rates through a metered JSON API.",
    "description": "USD-based exchange rates for about 160 currencies through a metered JSON API, with daily historical rates back to 1999. Any currency can be the base, and the same edition backs webhooks and a WebSocket stream. Current rates come from the newest edition for the key’s plan, and each plan sets how often that edition can change and how far back historical rates reach.",
    "termsOfService": "https://currencyexchangerate-api.com/terms"
  },
  "servers": [
    {
      "url": "https://api.currencyexchangerate-api.com/api/v1",
      "description": "Currency Exchange Rate API"
    }
  ],
  "externalDocs": {
    "description": "API documentation",
    "url": "https://currencyexchangerate-api.com/docs"
  },
  "tags": [
    {
      "name": "Rates",
      "description": "Metered endpoints. Need a bearer key."
    },
    {
      "name": "Public",
      "description": "Not metered. No key needed."
    }
  ],
  "paths": {
    "/latest": {
      "get": {
        "operationId": "getLatest",
        "summary": "Current rates per one unit of a base currency. Every currency is returned unless symbols narrows the list.",
        "tags": [
          "Rates"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "base",
            "in": "query",
            "required": false,
            "description": "Currency the rates are per one unit of. Case-insensitive, default USD. Any currency in the edition works, such as EGP.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "description": "Comma-separated currency codes, at most 200, case-insensitive. Without it, every currency is returned, including the base at 1.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rates for the request.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Monthly quota for the key owner’s plan.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left in the current UTC month.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the period resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Latest"
                },
                "example": {
                  "base": "EGP",
                  "updatedAt": "2026-10-08T00:00:01.000Z",
                  "nextUpdateAt": "2026-10-09T00:00:01.000Z",
                  "rates": {
                    "EUR": 0.01895679012,
                    "USD": 0.02057613169
                  }
                }
              }
            }
          },
          "401": {
            "description": "API_KEY_INVALID: The key is missing, malformed, unknown, or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "API_KEY_INVALID": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 401,
                      "code": "API_KEY_INVALID",
                      "detail": "The key is missing, malformed, unknown, or revoked."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "RATES_INVALID_INPUT: A query parameter is missing or invalid. RATES_UNSUPPORTED_CURRENCY: A currency code or base is well-formed but not in the snapshot.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_INVALID_INPUT": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 422,
                      "code": "RATES_INVALID_INPUT",
                      "detail": "A query parameter is missing or invalid."
                    }
                  },
                  "RATES_UNSUPPORTED_CURRENCY": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 422,
                      "code": "RATES_UNSUPPORTED_CURRENCY",
                      "detail": "A currency code or base is well-formed but not in the snapshot."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "API_QUOTA_EXCEEDED: The monthly quota is used up. Retry-After gives the seconds until the next UTC month. API_RATE_LIMITED: Too many requests per second for the key, or too many failed keys from this IP. Retry-After is set.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "API_QUOTA_EXCEEDED": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 429,
                      "code": "API_QUOTA_EXCEEDED",
                      "detail": "The monthly quota is used up. Retry-After gives the seconds until the next UTC month."
                    }
                  },
                  "API_RATE_LIMITED": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 429,
                      "code": "API_RATE_LIMITED",
                      "detail": "Too many requests per second for the key, or too many failed keys from this IP. Retry-After is set."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "RATES_INTERNAL_ERROR: Unexpected failure.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_INTERNAL_ERROR": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 500,
                      "code": "RATES_INTERNAL_ERROR",
                      "detail": "Unexpected failure."
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "RATES_UNAVAILABLE: No snapshot has been stored yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_UNAVAILABLE": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 503,
                      "code": "RATES_UNAVAILABLE",
                      "detail": "No snapshot has been stored yet."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/convert": {
      "get": {
        "operationId": "getConvert",
        "summary": "Converts an amount between any two currencies in the edition. The pair is converted through USD.",
        "tags": [
          "Rates"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Currency code to convert from. Case-insensitive.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "Currency code to convert to. Case-insensitive.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "description": "Amount in the from currency. Greater than 0 and at most 1,000,000,000,000. Default 1.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rates for the request.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Monthly quota for the key owner’s plan.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left in the current UTC month.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the period resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Convert"
                },
                "example": {
                  "from": "EUR",
                  "to": "GBP",
                  "amount": 100,
                  "rate": 0.8524910453,
                  "result": 85.249105,
                  "updatedAt": "2026-10-08T00:00:01.000Z"
                }
              }
            }
          },
          "401": {
            "description": "API_KEY_INVALID: The key is missing, malformed, unknown, or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "API_KEY_INVALID": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 401,
                      "code": "API_KEY_INVALID",
                      "detail": "The key is missing, malformed, unknown, or revoked."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "RATES_INVALID_INPUT: A query parameter is missing or invalid. RATES_UNSUPPORTED_CURRENCY: A currency code or base is well-formed but not in the snapshot.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_INVALID_INPUT": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 422,
                      "code": "RATES_INVALID_INPUT",
                      "detail": "A query parameter is missing or invalid."
                    }
                  },
                  "RATES_UNSUPPORTED_CURRENCY": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 422,
                      "code": "RATES_UNSUPPORTED_CURRENCY",
                      "detail": "A currency code or base is well-formed but not in the snapshot."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "API_QUOTA_EXCEEDED: The monthly quota is used up. Retry-After gives the seconds until the next UTC month. API_RATE_LIMITED: Too many requests per second for the key, or too many failed keys from this IP. Retry-After is set.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "API_QUOTA_EXCEEDED": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 429,
                      "code": "API_QUOTA_EXCEEDED",
                      "detail": "The monthly quota is used up. Retry-After gives the seconds until the next UTC month."
                    }
                  },
                  "API_RATE_LIMITED": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 429,
                      "code": "API_RATE_LIMITED",
                      "detail": "Too many requests per second for the key, or too many failed keys from this IP. Retry-After is set."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "RATES_INTERNAL_ERROR: Unexpected failure.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_INTERNAL_ERROR": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 500,
                      "code": "RATES_INTERNAL_ERROR",
                      "detail": "Unexpected failure."
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "RATES_UNAVAILABLE: No snapshot has been stored yet.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_UNAVAILABLE": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 503,
                      "code": "RATES_UNAVAILABLE",
                      "detail": "No snapshot has been stored yet."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/historical": {
      "get": {
        "operationId": "getHistorical",
        "summary": "Closing rates of one past UTC day per one unit of a base currency. On a weekend or holiday the nearest earlier day with rates is served, and date says which day it is.",
        "tags": [
          "Rates"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "The day, YYYY-MM-DD (UTC), no later than today and within the plan’s historical reach.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "description": "Currency the rates are per one unit of. Case-insensitive, default USD.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "description": "Comma-separated currency codes, at most 200, case-insensitive. Without it, every currency of that day is returned.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rates for the request.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Monthly quota for the key owner’s plan.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left in the current UTC month.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the period resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Historical"
                },
                "example": {
                  "requestedDate": "2026-10-10",
                  "date": "2026-10-09",
                  "base": "EUR",
                  "rates": {
                    "GBP": 0.8524910453,
                    "USD": 1.085422772
                  }
                }
              }
            }
          },
          "401": {
            "description": "API_KEY_INVALID: The key is missing, malformed, unknown, or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "API_KEY_INVALID": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 401,
                      "code": "API_KEY_INVALID",
                      "detail": "The key is missing, malformed, unknown, or revoked."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "RATES_HISTORY_NOT_IN_PLAN: The date, or the start of the range, is older than the plan’s historical reach (Free: 30 days).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_HISTORY_NOT_IN_PLAN": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 403,
                      "code": "RATES_HISTORY_NOT_IN_PLAN",
                      "detail": "The date, or the start of the range, is older than the plan’s historical reach (Free: 30 days)."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "RATES_HISTORY_UNAVAILABLE: No rates are stored for the date or the 7 days before it, such as a date before 1999.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_HISTORY_UNAVAILABLE": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 404,
                      "code": "RATES_HISTORY_UNAVAILABLE",
                      "detail": "No rates are stored for the date or the 7 days before it, such as a date before 1999."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "RATES_INVALID_INPUT: A query parameter is missing or invalid. RATES_UNSUPPORTED_CURRENCY: A currency code or base is well-formed but not in the snapshot.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_INVALID_INPUT": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 422,
                      "code": "RATES_INVALID_INPUT",
                      "detail": "A query parameter is missing or invalid."
                    }
                  },
                  "RATES_UNSUPPORTED_CURRENCY": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 422,
                      "code": "RATES_UNSUPPORTED_CURRENCY",
                      "detail": "A currency code or base is well-formed but not in the snapshot."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "API_QUOTA_EXCEEDED: The monthly quota is used up. Retry-After gives the seconds until the next UTC month. API_RATE_LIMITED: Too many requests per second for the key, or too many failed keys from this IP. Retry-After is set.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "API_QUOTA_EXCEEDED": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 429,
                      "code": "API_QUOTA_EXCEEDED",
                      "detail": "The monthly quota is used up. Retry-After gives the seconds until the next UTC month."
                    }
                  },
                  "API_RATE_LIMITED": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 429,
                      "code": "API_RATE_LIMITED",
                      "detail": "Too many requests per second for the key, or too many failed keys from this IP. Retry-After is set."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "RATES_INTERNAL_ERROR: Unexpected failure.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_INTERNAL_ERROR": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 500,
                      "code": "RATES_INTERNAL_ERROR",
                      "detail": "Unexpected failure."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/timeseries": {
      "get": {
        "operationId": "getTimeseries",
        "summary": "Closing rates for every day with rates from start to end inclusive, at most 366 days, keyed by date. Weekends and holidays without rates are left out.",
        "tags": [
          "Rates"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": true,
            "description": "First day, YYYY-MM-DD (UTC), within the plan’s historical reach.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "description": "Last day, YYYY-MM-DD (UTC), no later than today and at most 365 days after start.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "description": "Currency the rates are per one unit of. Case-insensitive, default USD. Days without the base are left out.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "description": "Comma-separated currency codes, at most 200, case-insensitive. Codes a day lacks are left out of that day.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rates for the request.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Monthly quota for the key owner’s plan.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests left in the current UTC month.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the period resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Timeseries"
                },
                "example": {
                  "base": "USD",
                  "start": "2026-10-05",
                  "end": "2026-10-07",
                  "rates": {
                    "2026-10-05": {
                      "EUR": 0.9205
                    },
                    "2026-10-06": {
                      "EUR": 0.9198
                    },
                    "2026-10-07": {
                      "EUR": 0.9213
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "API_KEY_INVALID: The key is missing, malformed, unknown, or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "API_KEY_INVALID": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 401,
                      "code": "API_KEY_INVALID",
                      "detail": "The key is missing, malformed, unknown, or revoked."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "RATES_HISTORY_NOT_IN_PLAN: The date, or the start of the range, is older than the plan’s historical reach (Free: 30 days).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_HISTORY_NOT_IN_PLAN": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 403,
                      "code": "RATES_HISTORY_NOT_IN_PLAN",
                      "detail": "The date, or the start of the range, is older than the plan’s historical reach (Free: 30 days)."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "RATES_HISTORY_UNAVAILABLE: No rates are stored for the date or the 7 days before it, such as a date before 1999.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_HISTORY_UNAVAILABLE": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 404,
                      "code": "RATES_HISTORY_UNAVAILABLE",
                      "detail": "No rates are stored for the date or the 7 days before it, such as a date before 1999."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "RATES_INVALID_INPUT: A query parameter is missing or invalid. RATES_UNSUPPORTED_CURRENCY: A currency code or base is well-formed but not in the snapshot.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_INVALID_INPUT": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 422,
                      "code": "RATES_INVALID_INPUT",
                      "detail": "A query parameter is missing or invalid."
                    }
                  },
                  "RATES_UNSUPPORTED_CURRENCY": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 422,
                      "code": "RATES_UNSUPPORTED_CURRENCY",
                      "detail": "A currency code or base is well-formed but not in the snapshot."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "API_QUOTA_EXCEEDED: The monthly quota is used up. Retry-After gives the seconds until the next UTC month. API_RATE_LIMITED: Too many requests per second for the key, or too many failed keys from this IP. Retry-After is set.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "API_QUOTA_EXCEEDED": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 429,
                      "code": "API_QUOTA_EXCEEDED",
                      "detail": "The monthly quota is used up. Retry-After gives the seconds until the next UTC month."
                    }
                  },
                  "API_RATE_LIMITED": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 429,
                      "code": "API_RATE_LIMITED",
                      "detail": "Too many requests per second for the key, or too many failed keys from this IP. Retry-After is set."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "RATES_INTERNAL_ERROR: Unexpected failure.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "RATES_INTERNAL_ERROR": {
                    "value": {
                      "type": "about:blank",
                      "title": "Request failed",
                      "status": 500,
                      "code": "RATES_INTERNAL_ERROR",
                      "detail": "Unexpected failure."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/currencies": {
      "get": {
        "operationId": "listCurrencies",
        "summary": "Every currency code in the newest snapshot, sorted by code, with an English name. Public and not metered.",
        "tags": [
          "Public"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Currency"
                  }
                },
                "example": [
                  {
                    "code": "AED",
                    "name": "United Arab Emirates Dirham"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/preview": {
      "get": {
        "operationId": "getPreview",
        "summary": "Rates for a fixed selection of popular currencies from the newest snapshot. Public and not metered.",
        "tags": [
          "Public"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Edition"
                },
                "example": {
                  "base": "USD",
                  "updatedAt": "2026-10-08T00:00:01.000Z",
                  "nextUpdateAt": "2026-10-09T00:00:01.000Z",
                  "rates": {
                    "EUR": 0.9213,
                    "GBP": 0.7854
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "rates.updated": {
      "post": {
        "operationId": "receive_rates_updated",
        "summary": "A subscriber’s edition changed.",
        "description": "A subscriber’s edition changed.",
        "parameters": [
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "rates.updated"
              ]
            }
          },
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The webhook id."
          },
          {
            "name": "X-Webhook-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The delivery id. The same on every retry."
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>. Reject t older than 5 minutes."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RatesUpdatedEvent"
              }
            }
          }
        },
        "responses": {
          "2xx": {
            "description": "Any 2xx response marks the delivery delivered."
          }
        }
      }
    },
    "webhook.test": {
      "post": {
        "operationId": "receive_webhook_test",
        "summary": "Test delivery from the console.",
        "description": "Test delivery from the console.",
        "parameters": [
          {
            "name": "X-Webhook-Event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "webhook.test"
              ]
            }
          },
          {
            "name": "X-Webhook-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The webhook id."
          },
          {
            "name": "X-Webhook-Delivery",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The delivery id. The same on every retry."
          },
          {
            "name": "X-Webhook-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>. Reject t older than 5 minutes."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookTestEvent"
              }
            }
          }
        },
        "responses": {
          "2xx": {
            "description": "Any 2xx response marks the delivery delivered."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A key that starts with cxr_."
      }
    },
    "schemas": {
      "Edition": {
        "type": "object",
        "required": [
          "base",
          "updatedAt",
          "nextUpdateAt",
          "rates"
        ],
        "properties": {
          "base": {
            "type": "string",
            "description": "Base currency code."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "nextUpdateAt": {
            "type": "string",
            "format": "date-time"
          },
          "rates": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "description": "Units of each currency per one unit of the base."
          }
        }
      },
      "Latest": {
        "type": "object",
        "required": [
          "base",
          "updatedAt",
          "nextUpdateAt",
          "rates"
        ],
        "properties": {
          "base": {
            "type": "string",
            "description": "Base currency code."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "nextUpdateAt": {
            "type": "string",
            "format": "date-time"
          },
          "rates": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "description": "Units of each currency per one unit of the base."
          }
        }
      },
      "Convert": {
        "type": "object",
        "required": [
          "from",
          "to",
          "amount",
          "rate",
          "result",
          "updatedAt"
        ],
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "rate": {
            "type": "number",
            "description": "Rounded to 10 significant digits."
          },
          "result": {
            "type": "number",
            "description": "amount times the unrounded rate, rounded to 6 decimal places."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Historical": {
        "type": "object",
        "required": [
          "requestedDate",
          "date",
          "base",
          "rates"
        ],
        "properties": {
          "requestedDate": {
            "type": "string",
            "format": "date"
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "The day served: requestedDate, or the nearest earlier day with rates."
          },
          "base": {
            "type": "string",
            "description": "Base currency code."
          },
          "rates": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "description": "Units of each currency per one unit of the base."
          }
        }
      },
      "Timeseries": {
        "type": "object",
        "required": [
          "base",
          "start",
          "end",
          "rates"
        ],
        "properties": {
          "base": {
            "type": "string",
            "description": "Base currency code."
          },
          "start": {
            "type": "string",
            "format": "date"
          },
          "end": {
            "type": "string",
            "format": "date"
          },
          "rates": {
            "type": "object",
            "description": "Rates per one unit of the base, keyed by day.",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "description": "Units of each currency per one unit of the base."
            }
          }
        }
      },
      "Currency": {
        "type": "object",
        "required": [
          "code",
          "name"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "Problem": {
        "type": "object",
        "description": "application/problem+json error body.",
        "required": [
          "type",
          "status",
          "code",
          "title",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string",
            "examples": [
              "about:blank"
            ]
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "enum": [
              "RATES_INVALID_INPUT",
              "RATES_UNSUPPORTED_CURRENCY",
              "RATES_UNAVAILABLE",
              "API_KEY_INVALID",
              "API_QUOTA_EXCEEDED",
              "API_RATE_LIMITED",
              "RATES_PLAN_UPGRADE_REQUIRED",
              "RATES_HISTORY_NOT_IN_PLAN",
              "RATES_HISTORY_UNAVAILABLE",
              "RATES_INTERNAL_ERROR"
            ]
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          }
        }
      },
      "RatesUpdatedEvent": {
        "type": "object",
        "required": [
          "id",
          "type",
          "createdAt",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The delivery id."
          },
          "type": {
            "type": "string",
            "enum": [
              "rates.updated"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "required": [
              "base",
              "updatedAt",
              "nextUpdateAt",
              "rates"
            ],
            "properties": {
              "base": {
                "type": "string",
                "description": "Base currency code."
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time"
              },
              "nextUpdateAt": {
                "type": "string",
                "format": "date-time"
              },
              "rates": {
                "type": "object",
                "additionalProperties": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "description": "Units of each currency per one unit of the base."
              }
            }
          }
        }
      },
      "WebhookTestEvent": {
        "type": "object",
        "required": [
          "id",
          "type",
          "createdAt",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The delivery id."
          },
          "type": {
            "type": "string",
            "enum": [
              "webhook.test"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "required": [
              "message"
            ],
            "properties": {
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}