You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-6Lines changed: 21 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -23,14 +23,27 @@ Install
23
23
Usage
24
24
-----
25
25
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
+
constcc=require('cryptocompare')
35
+
```
36
+
26
37
### Methods
27
38
28
39
### `price()`
29
40
41
+
Get the current price of any cryptocurrency in any other currency.
42
+
30
43
`price(fsym, tsyms[, tryConversion])`
31
44
32
45
-`fsym` (String) From Symbol
33
-
-`tsym` (Array of Strings | String) To Symbol(s)
46
+
-`tsyms` (Array of Strings | String) To Symbol(s)
34
47
-`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.
35
48
36
49
```js
@@ -57,7 +70,7 @@ cc.price('BTC', 'USD')
57
70
58
71
Works like `price()`, except it allows you to specify a matrix of From Symbols.
59
72
60
-
`priceMulti(fsym, tsyms[, tryConversion])`
73
+
`priceMulti(fsyms, tsyms[, tryConversion])`
61
74
62
75
-`fsyms` (Array of Strings | String) From Symbol(s)
63
76
-`tsyms` (Array of Strings | String) To Symbol(s)
@@ -86,9 +99,9 @@ cc.priceMulti('BTC', 'USD')
86
99
87
100
### `priceFull()`
88
101
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.
90
103
91
-
`priceFull(fsym, tsyms[, tryConversion])`
104
+
`priceFull(fsyms, tsyms[, tryConversion])`
92
105
93
106
-`fsyms` (Array of Strings | String) From Symbol(s)
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.
-`time` (Date) Date in history that you want price data for
142
157
-`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.
0 commit comments