Finance::Quote::CurrencyRates::OpenExchange(3pm)

Finance::Quote::CurrencyRates::OpenExchange3pm

Obtain currency rates from https://openexchangerates.org

Usage

    use Finance::Quote;
    
    $q = Finance::Quote->new(currency_rates =>
           {order => ['OpenExchange'], openexchange => {API_KEY => ...}}
         );
    $value = $q->currency('18.99 EUR', 'USD');

Overview

This module fetches currency rates from https://openexchangerates.org and provides data to Finance::Quote to convert the first argument to the equivalent value in the currency indicated by the second argument.

This module caches the currency rates for the lifetime of the quoter object, unless 'cache => 0' is included in the 'openexchange' options hash.

Currency Module Selection

The Finance::Quote currency method to be used can also be selected by setting the environment variable FQ_CURRENCY.

    export FQ_CURRENCY=OpenExchange

Api_key

https://openexchangerates.org requires users to register and obtain an API key. Their free plan allows 1000 queries per month.

The API key can be set by setting the environment variable OPENEXCHANGE_API_KEY or by providing a 'openexchange' hash inside the 'currency_rates' hash to Finance::Quote->new as in the above example.

Terms & Conditions

Use of https://openexchangerates.org is governed by any terms & conditions of that site.

Finance::Quote is released under the GNU General Public License, version 2, which explicitly carries a "No Warranty" clause.

Releases

3 releases since Debian 11 (Bullseye); the text changed 2 times.

  1. 11
  2. 12
  3. 13

From libfinance-quote-perl 1.65-1+deb13u1 in Debian 13 (Trixie). Parsed by carta from the page's man source.