An open API service indexing awesome lists of open source software.

https://github.com/ozgurg/google-currency-scraper

Scrape extremely up-to-date exchange rates from Google fast and free.
https://github.com/ozgurg/google-currency-scraper

acikkaynak currency currency-api google-scraper scraper

Last synced: 5 months ago
JSON representation

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

Awesome Lists containing this project

README

          

![Downloads](https://img.shields.io/npm/dm/google-currency-scraper)
![Version](https://img.shields.io/github/package-json/v/ozgurg/google-currency-scraper)

# google-currency-scraper

Scrape extremely up-to-date exchange rates from Google fast and for free, with only one external dependency.

## Install

```shell
npm install google-currency-scraper
```

## Usage

```javascript
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"
// }
```

## 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](https://img.shields.io/github/license/ozgurg/google-currency-scraper)](https://github.com/ozgurg/google-currency-scraper/blob/main/LICENSE)