{"id":13446989,"url":"https://github.com/aishek/axios-rate-limit","last_synced_at":"2025-05-16T03:05:40.983Z","repository":{"id":34735470,"uuid":"182444613","full_name":"aishek/axios-rate-limit","owner":"aishek","description":"Rate limit for axios","archived":false,"fork":false,"pushed_at":"2024-08-07T14:47:33.000Z","size":252,"stargazers_count":242,"open_issues_count":15,"forks_count":35,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T10:40:42.423Z","etag":null,"topics":["axios","js","rate-limit","rate-limiting","rate-limits","ratelimit","ratelimiter","ratelimiting","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/aishek.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2019-04-20T19:05:46.000Z","updated_at":"2025-04-14T11:19:45.000Z","dependencies_parsed_at":"2024-05-20T11:39:16.530Z","dependency_job_id":"ac750c2c-c4ed-4e71-9fb5-c483f413defc","html_url":"https://github.com/aishek/axios-rate-limit","commit_stats":{"total_commits":53,"total_committers":9,"mean_commits":5.888888888888889,"dds":0.339622641509434,"last_synced_commit":"32f3b8bcc31fe5db04dba10edb74690c10c206b3"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aishek%2Faxios-rate-limit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aishek%2Faxios-rate-limit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aishek%2Faxios-rate-limit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aishek%2Faxios-rate-limit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aishek","download_url":"https://codeload.github.com/aishek/axios-rate-limit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459088,"owners_count":22074605,"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":["axios","js","rate-limit","rate-limiting","rate-limits","ratelimit","ratelimiter","ratelimiting","typescript"],"created_at":"2024-07-31T05:01:05.101Z","updated_at":"2025-05-16T03:05:35.974Z","avatar_url":"https://github.com/aishek.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# axios-rate-limit\n\n[![npm version](https://img.shields.io/npm/v/axios-rate-limit.svg?style=flat-square)](https://www.npmjs.com/package/axios-rate-limit)\n[![npm downloads](https://img.shields.io/npm/dt/axios-rate-limit.svg?style=flat-square)](https://www.npmjs.com/package/axios-rate-limit)\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/axios-rate-limit?style=flat-square)](https://bundlephobia.com/package/axios-rate-limit@latest)\n[![build status](https://img.shields.io/github/actions/workflow/status/aishek/axios-rate-limit/node.js.yml\n)](https://github.com/aishek/axios-rate-limit/actions?query=branch%3Amaster++)\n[![code coverage](https://img.shields.io/coveralls/aishek/axios-rate-limit.svg?style=flat-square)](https://coveralls.io/r/aishek/axios-rate-limit)\n[![install size](https://img.shields.io/badge/dynamic/json?url=https://packagephobia.com/v2/api.json?p=axios-rate-limit\u0026query=$.install.pretty\u0026label=install%20size\u0026style=flat-square)](https://packagephobia.now.sh/result?p=axios-rate-limit)\n[![known vulnerabilities](https://snyk.io/test/npm/axios-rate-limit/badge.svg)](https://snyk.io/test/npm/axios-rate-limit)\n\nA rate limit for [Axios](https://www.npmjs.com/package/axios): set how many requests per interval should perform immediately, other will be delayed automatically.\n\n## Installing\n\n```bash\nnpm install axios-rate-limit\n```\n\n## Usage\n\n```javascript\nimport axios from 'axios';\nimport rateLimit from 'axios-rate-limit';\n\n// sets max 2 requests per 1 second, other will be delayed\n// note maxRPS is a shorthand for perMilliseconds: 1000, and it takes precedence\n// if specified both with maxRequests and perMilliseconds\nconst http = rateLimit(axios.create(), { maxRequests: 2, perMilliseconds: 1000, maxRPS: 2 })\nhttp.getMaxRPS() // 2\nhttp.get('https://example.com/api/v1/users.json?page=1') // will perform immediately\nhttp.get('https://example.com/api/v1/users.json?page=2') // will perform immediately\nhttp.getQueue() // [{...}]\nhttp.get('https://example.com/api/v1/users.json?page=3') // will perform after 1 second from the first one\n\n// options hot-reloading also available\nhttp.setMaxRPS(3)\nhttp.getMaxRPS() // 3\nhttp.setRateLimitOptions({ maxRequests: 6, perMilliseconds: 150 }) // same options as constructor\n```\n\n## Alternatives\n\nConsider using Axios built-in [rate-limiting](https://www.npmjs.com/package/axios#user-content--rate-limiting) functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faishek%2Faxios-rate-limit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faishek%2Faxios-rate-limit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faishek%2Faxios-rate-limit/lists"}