bigfunctions > exchange_rate
exchange_rate¶
Signature
exchange_rate(base, to)
Description
Get exchange_rate
from base
(e.g. USD
) to to
(e.g. EUR
)
from Yahoo Finance.
This functions uses yfinance python package and returns the average of the bid price
and the ask price
. If the data is not available in Yahoo Finance, will return null
Param | Possible values |
---|---|
base and to |
Iso 4217 currency codes such as EUR or USD . See active codes on wikipedia |
Examples
To know how many euros a dollar is worth
select bigfunctions.eu.exchange_rate('USD', 'EUR')
select bigfunctions.us.exchange_rate('USD', 'EUR')
select bigfunctions.europe_west1.exchange_rate('USD', 'EUR')
+---------------+
| exchange_rate |
+---------------+
| 0.910437 |
+---------------+