Light APIv1.0.0

API / Reference / Exchange

Get exchange rate

GET https://api.light.inc/v1/exchange/rates/{base}/{target}

Returns an exchange rate between base and target currencies for a given date

rate is the number of target units per one unit of base (amountInTarget = amountInBase × rate). Rates are the European Central Bank's daily reference rates (a second provider covers currencies the ECB doesn't publish), stored by Light once a day and served from that store: the endpoint never calls a provider live, and company-specific rate overrides are ignored. date omitted means today; a future date is clamped to the latest stored day (effectiveDate says which); weekends and holidays resolve to the last published rate. A past date with no stored row fails with EXCHANGE_RATE_NOT_AVAILABLE.

Authorization

Send one of these on every request. See Authentication for how to get credentials.

  • API key

    Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.

  • Bearer token

Path parameters

  • base stringrequired

    Base currency of the exchange rate

  • target stringrequired

    Target currency of the exchange rate

Query parameters

  • date string

    Date the exchange rate is requested for. If omitted, defaults to today

Response

  • base string

  • target string

  • rate number

    Exchange rate between base and target currency

  • effectiveDate string · date

    Effective date of the exchange rate. E.g., rate requested on Saturday will have the effective date Friday

  • requestedDate string · date

    Date the exchange rate is requested for