google-currency-scraper

1.2.2 • Public • Published

Downloads Version

Google Currency Scraper

Scrape extremely up-to-date exchange rates from Google fast and free.

Install

npm install google-currency-scraper

This package is a pure ESM package.

Usage

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: 17.9539,
//     dateUpdated: "2022-08-11T23:24:00.000Z"
// }

API

googleCurrencyScraper(params) : object

params

Default: {}
Type: object
Required: Yes

params.from

Type: CurrencyCode | string
Required: Yes

params.to

Type: CurrencyCode | string
Required: Yes

CurrencyCode

It's a helper object that contains all currency codes.

License

License

Package Sidebar

Install

npm i google-currency-scraper

Weekly Downloads

26

Version

1.2.2

License

MIT

Unpacked Size

21.5 kB

Total Files

20

Last publish

Collaborators

  • ozgurg