{"id":13508667,"url":"https://github.com/whitered/ratekeeper","last_synced_at":"2025-10-21T14:59:23.758Z","repository":{"id":57540292,"uuid":"140207485","full_name":"whitered/ratekeeper","owner":"whitered","description":"Ratekeeper is a library for scheduling rate-limited actions.","archived":false,"fork":false,"pushed_at":"2018-07-14T03:10:14.000Z","size":22,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-01T08:33:48.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/whitered.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-08T22:39:37.000Z","updated_at":"2024-07-15T10:02:51.000Z","dependencies_parsed_at":"2022-09-26T18:31:08.681Z","dependency_job_id":null,"html_url":"https://github.com/whitered/ratekeeper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitered%2Fratekeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitered%2Fratekeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitered%2Fratekeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitered%2Fratekeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whitered","download_url":"https://codeload.github.com/whitered/ratekeeper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314011,"owners_count":20757450,"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":[],"created_at":"2024-08-01T02:00:56.603Z","updated_at":"2025-10-21T14:59:23.687Z","avatar_url":"https://github.com/whitered.png","language":"Elixir","funding_links":[],"categories":["Miscellaneous"],"sub_categories":[],"readme":"# Ratekeeper\n\nRatekeeper is a library for scheduling rate-limited actions.\nIt supports complex rate limits and estimates time left to resetting limits.\n\n\n## Installation\n\nAdd `ratekeeper` as dependency in `mix.exs`\n\n``` elixir\ndef deps do\n    [{:ratekeeper, \"~\u003e 0.2\"}]\nend\n```\n\n## Usage\n\nLimits can be set in config:\n```elixir\nconfig :ratekeeper, :limits, %{\"myapi.org\" =\u003e [{1000, 5}, {60_000, 100}]}\n```\nor at runtime:\n```elixir\nRatekeeper.add_limit \"myapi.org\", 1000, 5\nRatekeeper.add_limit \"myapi.org\", 60_000, 100\n```\nThis sets limits to *5 requests per 1 second* and *100 requests per minute*.\n\nAppoint a request to rate limited api:\n```elixir\ncase Ratekeeper.register(\"myapi.org\", 10_000) do\n  nil -\u003e\n    raise \"Rate limits exceeded, request not allowed in next 10 seconds\"\n  delay -\u003e\n    :timer.sleep(delay)\n    MyApi.do_request()\nend\n```\n\nFull documentation can be found at [https://hexdocs.pm/ratekeeper](https://hexdocs.pm/ratekeeper).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitered%2Fratekeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhitered%2Fratekeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitered%2Fratekeeper/lists"}