{"id":18464261,"url":"https://github.com/projectdiscovery/ratelimit","last_synced_at":"2026-04-01T22:31:15.309Z","repository":{"id":61628050,"uuid":"545751495","full_name":"projectdiscovery/ratelimit","owner":"projectdiscovery","description":"A Golang blocking rate limit implementation","archived":false,"fork":false,"pushed_at":"2026-03-22T00:15:51.000Z","size":212,"stargazers_count":65,"open_issues_count":0,"forks_count":12,"subscribers_count":11,"default_branch":"main","last_synced_at":"2026-03-22T14:28:55.680Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/projectdiscovery.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,"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}},"created_at":"2022-10-04T23:16:58.000Z","updated_at":"2026-03-19T11:12:00.000Z","dependencies_parsed_at":"2024-03-10T01:26:28.121Z","dependency_job_id":"cb14e3f9-ff8f-498e-81c6-8c0c4ba4fb95","html_url":"https://github.com/projectdiscovery/ratelimit","commit_stats":{"total_commits":102,"total_committers":7,"mean_commits":"14.571428571428571","dds":0.3529411764705882,"last_synced_commit":"da44b72c17e7806a0cecf9a6fa6f1efde82d4c04"},"previous_names":[],"tags_count":84,"template":false,"template_full_name":null,"purl":"pkg:github/projectdiscovery/ratelimit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fratelimit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fratelimit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fratelimit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fratelimit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectdiscovery","download_url":"https://codeload.github.com/projectdiscovery/ratelimit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectdiscovery%2Fratelimit/sbom","scorecard":{"id":746579,"data":{"date":"2025-08-11","repo":{"name":"github.com/projectdiscovery/ratelimit","commit":"49b8cc969372c893f01f3112e493e50e617f2470"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.2,"checks":[{"name":"Code-Review","score":-1,"reason":"Found no human activity in the last 15 changesets","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autorelease.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/autorelease.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/autorelease.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/autorelease.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/autorelease.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/autorelease.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/build-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/build-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/dep-auto-merge.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/dep-auto-merge.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/dep-auto-merge.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/dep-auto-merge.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/lint-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint-test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/lint-test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint-test.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/projectdiscovery/ratelimit/lint-test.yml/main?enable=pin","Info:   0 out of  11 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:12","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:13","Warn: no topLevel permission defined: .github/workflows/autorelease.yml:1","Warn: no topLevel permission defined: .github/workflows/build-test.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/lint-test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/projectdiscovery/.github/SECURITY.md:1","Info: Found linked content: github.com/projectdiscovery/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/projectdiscovery/.github/SECURITY.md:1","Info: Found text in security policy: github.com/projectdiscovery/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (30) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T18:57:02.357Z","repository_id":61628050,"created_at":"2025-08-22T18:57:02.357Z","updated_at":"2025-08-22T18:57:02.357Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"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":[],"created_at":"2024-11-06T09:09:16.205Z","updated_at":"2026-04-01T22:31:15.286Z","avatar_url":"https://github.com/projectdiscovery.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ratelimit\n\n[![License](https://img.shields.io/github/license/projectdiscovery/ratelimit)](LICENSE.md)\n![Go version](https://img.shields.io/github/go-mod/go-version/projectdiscovery/ratelimit?filename=go.mod)\n[![Release](https://img.shields.io/github/release/projectdiscovery/ratelimit)](https://github.com/projectdiscovery/ratelimit/releases/)\n[![Checks](https://github.com/projectdiscovery/ratelimit/actions/workflows/build-test.yml/badge.svg)](https://github.com/projectdiscovery/ratelimit/actions/workflows/build-test.yml)\n[![GoDoc](https://pkg.go.dev/badge/projectdiscovery/ratelimit)](https://pkg.go.dev/github.com/projectdiscovery/ratelimit)\n\nA Golang rate limit implementation which allows burst of request during the defined duration.\n\n\n### Differences with 'golang.org/x/time/rate#Limiter'\n\nThe original library i.e `golang.org/x/time/rate` implements classic **token bucket** algorithm allowing a burst of tokens and a refill that happens at a specified ratio by one unit at a time whereas this implementation is a variant  that allows a burst of tokens just like \"the token bucket\" algorithm, but the refill happens entirely at the defined ratio.\n\nThis allows scanners to respect maximum defined rate limits, pause until the allowed interval hits, and then process again at maximum speed. The original library slowed down requests according to the refill ratio.\n\n## Example\n\nAn Example showing usage of ratelimit as a library is specified below:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/projectdiscovery/ratelimit\"\n)\n\nfunc main() {\n\n\t// create a rate limiter by passing context, max tasks/requests , time interval\n\tlimiter := ratelimit.New(context.Background(), 5, time.Duration(10*time.Second))\n\n\tsave := time.Now()\n\n\tfor i := 0; i \u003c 10; i++ {\n\t\t// run limiter.Take() method before each task\n\t\tlimiter.Take()\n\t\tfmt.Printf(\"Task %v completed after %v\\n\", i, time.Since(save))\n\t}\n\n\t/*\n\t\tOutput:\n\t\tTask 0 completed after 4.083µs\n\t\tTask 1 completed after 111.416µs\n\t\tTask 2 completed after 118µs\n\t\tTask 3 completed after 121.083µs\n\t\tTask 4 completed after 124.583µs\n\t\tTask 5 completed after 10.001356375s\n\t\tTask 6 completed after 10.001524791s\n\t\tTask 7 completed after 10.001537583s\n\t\tTask 8 completed after 10.001542708s\n\t\tTask 9 completed after 10.001548666s\n\t*/\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Fratelimit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectdiscovery%2Fratelimit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectdiscovery%2Fratelimit/lists"}