{"id":17215429,"url":"https://github.com/pixtron/binance-rate-limit","last_synced_at":"2026-04-28T23:01:26.963Z","repository":{"id":73244922,"uuid":"445844727","full_name":"pixtron/binance-rate-limit","owner":"pixtron","description":"node.js rate limit tracker for binance. Let's you verify that you won't hit a rate limit before you send your api request.","archived":false,"fork":false,"pushed_at":"2022-01-29T19:26:52.000Z","size":173,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T05:44:08.713Z","etag":null,"topics":["api","binance","nodejs","rate-limit"],"latest_commit_sha":null,"homepage":"","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/pixtron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2022-01-08T14:41:38.000Z","updated_at":"2022-04-17T13:57:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"7dfcc949-9b1c-45ea-a4be-a4fcec82d1d1","html_url":"https://github.com/pixtron/binance-rate-limit","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"013565f4b18017294788c8fb8460da90c1973d85"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixtron%2Fbinance-rate-limit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixtron%2Fbinance-rate-limit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixtron%2Fbinance-rate-limit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixtron%2Fbinance-rate-limit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixtron","download_url":"https://codeload.github.com/pixtron/binance-rate-limit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245467610,"owners_count":20620216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","binance","nodejs","rate-limit"],"created_at":"2024-10-15T03:24:23.988Z","updated_at":"2026-04-28T23:01:21.918Z","avatar_url":"https://github.com/pixtron.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @pxtrn/binance-rate-limit\n\nnode.js rate limit tracker for binance. Let's you verify that you won't hit\na rate limit before you send your api request.\n\n## Installation\n\n`npm install --save @pxtrn/binance-rate-limit`\n\n## Usage\n\nAlso see the full [axios example](examples/axios.ts)\n\n```ts\nimport { createSpotLimiter, IRequest, IResponse } from '@pxtrn/binance-rate-limit';\n\nconst request = async (req: IRequest): Promise\u003cIResponse\u003e =\u003e {\n  // dispatch request with your preferred request library\n}\n\nconst req: IRequest = {\n  method: 'GET',\n  endpoint: '/api/v3/exchangeInfo',\n  params: {symbol: 'BTCUSDT'},\n  uid: 'xxx' // binance accountId or hashed apiKey if accountId is not available\n};\n\nconst limiter = createSpotLimiter();\nconst retryIn = limiter.mayDispatchRequest(req);\n\nif (retryIn === 0) {\n  // if retryIn === 0 dispatch the request immediately.\n  const response = await request(req);\n\n  const { statusCode, headers } = response;\n  const res: IResponse = {statusCode, headers};\n\n  // update counters, make sure to call this as well if you got\n  // a response with a status code other then 2xx or any error during request\n  limiter.completeRequest(res, req);\n} else {\n  // if retryIn \u003e 0 throw and reschedule call\n  throw new Error(`Rate limit exceeded retry in ${retryIn}`);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixtron%2Fbinance-rate-limit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixtron%2Fbinance-rate-limit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixtron%2Fbinance-rate-limit/lists"}