Scroll to navigation

Finance::Quote::CurrencyRates::TwelveData(3) User Contributed Perl Documentation Finance::Quote::CurrencyRates::TwelveData(3)

NAME

Finance::Quote::CurrencyRates::TwelveData - Obtain currency rates from https://api.twelvedata.com/exchange_rate

SYNOPSIS

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

DESCRIPTION

This module fetches currency rates from https://api.twelvedata.com/exchange_rate provides data to Finance::Quote to convert the first argument to the equivalent value in the currency indicated by the second argument.

This module is not the default currency conversion module for a Finance::Quote object. It can be utilized by setting the environment variable FQ_CURRENCY=TwelveData.

API_KEY

https://api.twelvedata.com/exchange_rate requires users to register and obtain an API key.

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

Terms & Conditions

Use of https://api.twelvedata.com/exchange_rate 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.

2026-04-19 perl v5.42.1