{"id":18486300,"url":"https://github.com/maxgfr/binance-historical","last_synced_at":"2026-04-06T14:04:14.037Z","repository":{"id":37038383,"uuid":"466799558","full_name":"maxgfr/binance-historical","owner":"maxgfr","description":"Get historical klines from binance api","archived":false,"fork":false,"pushed_at":"2026-03-06T08:59:44.000Z","size":5096,"stargazers_count":44,"open_issues_count":1,"forks_count":6,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-06T12:48:14.495Z","etag":null,"topics":["binance","binance-api","binance-historical","binance-historical-candle-data","binance-history","cryptocurrency","data","historical-data","history","javascript","kline","node","nodejs","trading","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/binance-historical","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxgfr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["maxgfr"]}},"created_at":"2022-03-06T16:56:14.000Z","updated_at":"2026-03-06T08:59:46.000Z","dependencies_parsed_at":"2024-04-15T23:43:46.390Z","dependency_job_id":"ca4579dc-c890-4149-89ae-f2bad1900636","html_url":"https://github.com/maxgfr/binance-historical","commit_stats":{"total_commits":514,"total_committers":6,"mean_commits":85.66666666666667,"dds":"0.39688715953307396","last_synced_commit":"bf9b7d732f2d197dc4eabd60357a877d01a511ee"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":"maxgfr/typescript-swc-starter","purl":"pkg:github/maxgfr/binance-historical","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxgfr%2Fbinance-historical","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxgfr%2Fbinance-historical/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxgfr%2Fbinance-historical/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxgfr%2Fbinance-historical/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxgfr","download_url":"https://codeload.github.com/maxgfr/binance-historical/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxgfr%2Fbinance-historical/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31475207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binance","binance-api","binance-historical","binance-historical-candle-data","binance-history","cryptocurrency","data","historical-data","history","javascript","kline","node","nodejs","trading","typescript"],"created_at":"2024-11-06T12:48:55.464Z","updated_at":"2026-04-06T14:04:14.032Z","avatar_url":"https://github.com/maxgfr.png","language":"TypeScript","funding_links":["https://github.com/sponsors/maxgfr"],"categories":[],"sub_categories":[],"readme":"# binance-historical\n\nUtility to retrieve historical data from Binance\n\n![Alt Text](https://raw.githubusercontent.com/maxgfr/binance-historical/main/.github/assets/main.gif)\n\n## Installation\n\n### Via Homebrew (macOS/Linux)\n\n```sh\nbrew install maxgfr/tap/binance-historical\n```\n\n### Via npm\n\n```sh\nnpm install -g binance-historical\n```\n\n### Download binary\n\nDownload the latest binary for your platform from the [releases page](https://github.com/maxgfr/binance-historical/releases).\n\n## Usage\n\n### CLI\n\n#### Interactive mode\n\n```sh\nbinance-historical download\n```\n\n#### Non-interactive mode\n\nPass all options as arguments:\n\n```sh\nbinance-historical download \\\n  --pair BTCUSDT \\\n  --interval 4h \\\n  --start 2024-01-01 \\\n  --end 2024-12-31 \\\n  --output ./data/ \\\n  --format json\n```\n\nExport as CSV:\n\n```sh\nbinance-historical download \\\n  --pair ETHUSDT \\\n  --interval 1h \\\n  --start 2024-01-01 \\\n  --end 2024-01-31 \\\n  --output ./data/ \\\n  --format csv\n```\n\n#### CLI Options\n\n| Option | Alias | Description |\n| ------ | ----- | ----------- |\n| `--pair \u003csymbol\u003e` | `-p` | Trading pair (e.g., BTCUSDT, ETHUSDT) |\n| `--interval \u003cinterval\u003e` | `-i` | Kline interval (1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w) |\n| `--start \u003cdate\u003e` | `-s` | Start date (YYYY-MM-DD or ISO 8601) |\n| `--end \u003cdate\u003e` | `-e` | End date (YYYY-MM-DD or ISO 8601) |\n| `--output \u003cpath\u003e` | `-o` | Output directory path (filename is auto-generated) |\n| `--format \u003cformat\u003e` | `-f` | Output format (json or csv, default: json) |\n| `--help` | `-h` | Display help |\n| `--version` | `-V` | Display version |\n\n#### Hybrid mode\n\nYou can also provide some options and be prompted for the rest:\n\n```sh\nbinance-historical download --pair ETHUSDT --interval 1h # Then you will be prompted for start date, end date, and output path\n```\n\n### Library\n\n```ts\nimport { getKline, Kline } from 'binance-historical';\n\nconst result: Array\u003cKline\u003e = await getKline(\n  'ETHUSDT',\n  '4h',\n  new Date('01-09-2020'),\n  new Date('01-12-2021'),\n);\n\nconsole.log(result);\n// [\n//   ...,\n//   {\n//     openTime: 1579953600000,\n//     open: '159.30000000',\n//     high: '161.00000000',\n//     low: '158.70000000',\n//     close: '160.41000000',\n//     volume: '25015.67605000',\n//     closeTime: 1579967999999,\n//     quoteAssetVolume: '4001959.95527980',\n//     trades: 14330,\n//     takerBaseAssetVolume: '13000.12296000',\n//     takerQuoteAssetVolume: '2079824.44045350',\n//     ignored: '0'\n//   },\n//   ...\n// ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxgfr%2Fbinance-historical","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxgfr%2Fbinance-historical","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxgfr%2Fbinance-historical/lists"}