Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxgfr/binance-historical
Get historical klines from binance api
https://github.com/maxgfr/binance-historical
binance binance-api binance-historical binance-historical-candle-data binance-history cryptocurrency data historical-data history javascript kline node nodejs trading typescript
Last synced: 7 days ago
JSON representation
Get historical klines from binance api
- Host: GitHub
- URL: https://github.com/maxgfr/binance-historical
- Owner: maxgfr
- License: mit
- Created: 2022-03-06T16:56:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T22:27:20.000Z (15 days ago)
- Last Synced: 2024-10-29T22:44:46.367Z (15 days ago)
- Topics: binance, binance-api, binance-historical, binance-historical-candle-data, binance-history, cryptocurrency, data, historical-data, history, javascript, kline, node, nodejs, trading, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/binance-historical
- Size: 4.26 MB
- Stars: 31
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# binance-historical
Utility to retrieve historical data from Binance.
![Alt Text](https://raw.githubusercontent.com/maxgfr/binance-historical/main/.github/assets/main.gif)
## Usage
### With the cli
```sh
npm install -g binance-historical
binance-historical download# or by using npx
npx binance-historical download
```### With the library
```ts
import { getKline, Kline } from 'binance-historical';const result: Array = await getKline(
'ETHUSDT',
'4h',
new Date('01-09-2020'),
new Date('01-12-2021'),
);console.log(result);
// [
// ...,
// {
// openTime: 1579953600000,
// open: '159.30000000',
// high: '161.00000000',
// low: '158.70000000',
// close: '160.41000000',
// volume: '25015.67605000',
// closeTime: 1579967999999,
// quoteAssetVolume: '4001959.95527980',
// trades: 14330,
// takerBaseAssetVolume: '13000.12296000',
// takerQuoteAssetVolume: '2079824.44045350',
// ignored: '0'
// },
// ...
// ]
```