Skip to content

Instantly share code, notes, and snippets.

@andreypopp
Created October 6, 2022 22:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreypopp/09f9dcb11decff3427883625d04a6454 to your computer and use it in GitHub Desktop.
Save andreypopp/09f9dcb11decff3427883625d04a6454 to your computer and use it in GitHub Desktop.
function NBG_CURRENCY(currency, date) {
let [m, d, y] = [date.getMonth(), date.getDate(), date.getFullYear()];
let dates = `${y}-${m+1}-${d}`
let url = `https://nbg.gov.ge/gw/api/ct/monetarypolicy/currencies/en/json/?currencies=${currency}&date=${dates}`;
let resp = UrlFetchApp.fetch(url);
return JSON.parse(resp.getContentText())[0].currencies[0].rate;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment