NBG Rates (National Bank of Georgia)

v0.7.1
io.github.akalongman/nbg-rates Checked 2 days ago Published 16 days ago

GEL exchange rates from the National Bank of Georgia with per-unit values.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

nbg_get_rates NBG rates for a date

Official National Bank of Georgia (NBG) exchange rates of the Georgian lari (GEL) in force on one calendar date. Every rate is GEL per ONE unit of the currency (NBG quotes some currencies per 10, 100, 1000 or 10000 units; the raw pair is returned as nbgQuantity and nbgRate). Dates are calendar days in Tbilisi; the default is today. NBG sets a rate on business days around 17:00 Tbilisi time, valid from the next calendar day until the next rate, so after 17:00 tomorrow can be requested by date. Sundays, Mondays and days after a public holiday have no rate of their own: the rate in force was set…

ParameterTypeDescription
currenciesarrayISO 4217 codes to return, case-insensitive, duplicates ignored (for example ["USD", "EUR"]). Omit for all currencies. GEL has no row, since every rate is in GEL, so it is listed in unknownCodes.
datestringCalendar date YYYY-MM-DD. Defaults to today in Tbilisi. Tomorrow's rate exists after about 17:00 Tbilisi time.
languagestringLanguage of currency names: en (default) or ka (Georgian). Codes, numbers and dates are identical in both.

nbg_convert Convert via NBG rate

Converts an amount between two currencies using the official NBG rate in force on a calendar date. Either side may be GEL; a pair without GEL is converted through GEL (via: "GEL"). Show resultRounded as the amount; result is the unrounded value for further calculation. Dates are calendar days in Tbilisi; the default is today. NBG sets a rate on business days around 17:00 Tbilisi time, valid from the next calendar day until the next rate, so after 17:00 tomorrow can be requested by date. Sundays, Mondays and days after a public holiday have no rate of their own: the rate in force was set earlie…

ParameterTypeDescription
amount *numberAmount in the "from" currency. May be negative.
from *stringISO 4217 code, or GEL.
to *stringISO 4217 code, or GEL.
datestringCalendar date YYYY-MM-DD whose official rate to apply. Defaults to today in Tbilisi.

nbg_convert_many Convert a list via NBG rates

Converts a list of amounts, each at the official NBG rate in force on its own date: one call for a list of invoices. Items are answered independently; a bad date or code fails only its item, with the error text in that item. total is present when every converted item has the same target currency and covers the converted items only; call it partial when skipped is not 0. Once NBG stops answering, the remaining dates fail with the same error without being asked. Show resultRounded as the amount; result is the unrounded value for further calculation. Dates are calendar days in Tbilisi; the defaul…

ParameterTypeDescription
items *array1 to 100 conversions, each with the fields of nbg_convert; items are answered independently.

nbg_list_currencies NBG currency list

Lists every currency NBG publishes a GEL rate for today, with its name and the unit quantity NBG quotes it in. NBG quoted other currencies in the past, so a code missing here may still have historical rates. nbgQuantity is the unit count NBG quotes the raw rate for (JPY is quoted as 1.6452 GEL per 100 JPY); for the rates themselves call nbg_get_rates.

ParameterTypeDescription
languagestringLanguage of currency names: en (default) or ka (Georgian). Codes, numbers and dates are identical in both.

nbg_rate_history NBG rate history

Official NBG rate of one currency (GEL per one unit) in force on every calendar day of an inclusive range of at most 366 days. Dates are calendar days in Tbilisi. Days without a rate of their own (Sundays, Mondays and days after a public holiday; before September 2021 NBG set a rate for every calendar day) carry the earlier rate. Days whose own rate is in force contain only date and rate; a carried-over day adds effectiveDate and carriedOver: true. Quote effectiveDate when carriedOver is true. A range reaching a date NBG has not published yet returns an error. summary holds the first, last, ch…

ParameterTypeDescription
currency *stringISO 4217 code, for example USD.
from *stringFirst calendar day, inclusive.
to *stringLast calendar day, inclusive. At most 366 days including "from".