Scrape extremely up-to-date exchange rates from Google fast and for free, with only one external dependency.
npm install google-currency-scraper
import googleCurrencyScraper, { CurrencyCode } from "google-currency-scraper";
const currency = await googleCurrencyScraper({
from: CurrencyCode.USD, // You can use "USD" as well
to: CurrencyCode.TRY // You can use "TRY" as well
});
// {
// from: "USD",
// to: "TRY",
// rate: 32.2434,
// dateUpdated: "May 19, 13:59 UTC"
// }
Default: {}
Type: object
Required: Yes
Type: CurrencyCode | string
Required: Yes
Type: CurrencyCode | string
Required: Yes
It's a helper object that contains all currency codes.