Skip to content

Commit dcfbbe2

Browse files
committed
Cleanup & expand docs
1 parent 546f95d commit dcfbbe2

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,27 @@ Install
2323
Usage
2424
-----
2525

26+
**Note:** cryptocompare depends on [`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch) being defined globally.
27+
28+
- If you are using this in electron, it should work without any configuration.
29+
- If you are using this in Node.js, you will need to use [`node-fetch`](https://www.npmjs.com/package/node-fetch).
30+
31+
**Example:**
32+
```js
33+
global.fetch = require('node-fetch')
34+
const cc = require('cryptocompare')
35+
```
36+
2637
### Methods
2738

2839
### `price()`
2940

41+
Get the current price of any cryptocurrency in any other currency.
42+
3043
`price(fsym, tsyms[, tryConversion])`
3144

3245
- `fsym` (String) From Symbol
33-
- `tsym` (Array of Strings | String) To Symbol(s)
46+
- `tsyms` (Array of Strings | String) To Symbol(s)
3447
- `tryConversion` (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set `tryConversion` to `false` to disable using BTC for conversion.
3548

3649
```js
@@ -57,7 +70,7 @@ cc.price('BTC', 'USD')
5770

5871
Works like `price()`, except it allows you to specify a matrix of From Symbols.
5972

60-
`priceMulti(fsym, tsyms[, tryConversion])`
73+
`priceMulti(fsyms, tsyms[, tryConversion])`
6174

6275
- `fsyms` (Array of Strings | String) From Symbol(s)
6376
- `tsyms` (Array of Strings | String) To Symbol(s)
@@ -86,9 +99,9 @@ cc.priceMulti('BTC', 'USD')
8699

87100
### `priceFull()`
88101

89-
Get all the current trading info (price, vol, open, high, low etc) of any list of cryptocurrencies in any other currency.
102+
Get all the current trading info (price, vol, open, high, low, etc.) of any list of cryptocurrencies in any other currency.
90103

91-
`priceFull(fsym, tsyms[, tryConversion])`
104+
`priceFull(fsyms, tsyms[, tryConversion])`
92105

93106
- `fsyms` (Array of Strings | String) From Symbol(s)
94107
- `tsyms` (Array of Strings | String) To Symbol(s)
@@ -132,12 +145,14 @@ cc.priceFull(['BTC', 'ETH'], ['USD', 'EUR'])
132145
.catch(console.error)
133146
```
134147

135-
### priceHistorical
148+
### `priceHistorical()`
149+
150+
Get the price of any cryptocurrency in any other currency at a given timestamp. The price comes from the daily info - so it would be the price at the end of the day GMT based on the requested timestamp.
136151

137152
`priceHistorical(fsym, tsyms, time[, tryConversion])`
138153

139154
- `fsym` (String) From Symbol
140-
- `tsym` (Array of Strings | String) To Symbol(s)
155+
- `tsyms` (Array of Strings | String) To Symbol(s)
141156
- `time` (Date) Date in history that you want price data for
142157
- `tryConversion` (Boolean) By default, if the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. Set `tryConversion` to `false` to disable using BTC for conversion.
143158

0 commit comments

Comments
 (0)