Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Http Client Rate Limits For Laravel

Http Client Rate Limits For Laravel Laravel Package

roundly-consulting/http-client-rate-limits-for-laravel

A Laravel package for rate limiting outgoing HTTP client requests. Throttle external API calls, avoid 429 errors, and control request bursts with simple, configurable limits, helping keep integrations reliable, predictable, and polite under load. Easy to configure per request or globally.

View on GitHub
Deep Wiki
Context7

Rate limit outgoing requests made with Laravel's HTTP client

Frequently asked questions about Http Client Rate Limits For Laravel
What does roundly-consulting/http-client-rate-limits-for-laravel actually do?
It connects Laravel's RateLimiter to the HTTP client so outgoing requests are checked against named limits before they are sent. You can apply a limit per host, per service, or per individual request, which helps keep your integration inside a third-party API quota. When a request is throttled or a 429 comes back, the package can retry with configurable backoff instead of failing immediately.
How do I install this package with Composer?
Install it as a normal Laravel Composer dependency, typically with composer require roundly-consulting/http-client-rate-limits-for-laravel. It is a Laravel package, so service provider discovery and any publishable config should be checked after install. If your application pins older Roundly packages, run composer why-not first to confirm the required Roundly dependency versions resolve before committing the lockfile change.
Which Laravel and PHP versions are supported?
The package targets Laravel's HTTP client and RateLimiter, so it needs a Laravel version that provides both, but the exact supported matrix is not spelled out in the release notes. Check the composer.json constraints for the Laravel framework and PHP versions before upgrading, and compare them to your application. If your CI matrix does not cover the target Laravel version, add a job for it or verify in a branch before rolling out.
How do I apply a rate limit to a single HTTP client request?
The package is designed so you can attach a named limit at the point where you build the request, alongside the usual Laravel HTTP client calls. You define the limit with the familiar RateLimiter API, then reference that limit name when sending. That keeps the throttling rules visible in the integration code rather than buried in a global configuration.
How does it handle 429 Too Many Requests responses?
When an outgoing call returns a 429, the package can retry the request using a configurable retry and backoff setup. That means transient throttling from the third party does not immediately surface as an exception to your application code. You should still configure a sensible maximum number of attempts so a persistently throttled endpoint fails predictably instead of looping.
Can I set limits globally for a host or service instead of per request?
Yes, applying limits per host or per service is one of the main use cases. That lets every request going to a given API share the same quota bucket, which is closer to how third-party providers actually count your usage. Per-request limits remain available when a single call needs its own stricter budget.
What is the difference between this and Laravel's built-in HTTP client retry and throttle options?
Laravel's HTTP client already offers retry and a simple throttle, but it does not know about RateLimiter definitions or shared per-host budgets. This package layers named limits on top of the client so the same limiter configuration used elsewhere in your application controls outgoing traffic. It is most useful when several services call the same external API and need to share one quota.
How do I customize the limit key or what happens when a limit is exceeded?
The package exposes customization for the limit key and for the exceeded-limit behavior, so you can decide which identifier a limit is tracked under and how a blocked request is handled. That matters when the same host is used by multiple tenants or when you want a specific exception or fallback response. Review the package configuration after install and document the chosen keys so limits behave consistently across environments.
Will this package conflict with other Roundly packages I already use?
Version 1.1.1 is a maintenance release that raises the minimum versions of Roundly dependencies such as package-toolkit, crypto, and enums, so conflicts are possible if your application pins older constraints. Run composer why-not and a dry-run update on an isolated branch to see what would move. Treat it as a lockstep upgrade of the Roundly family if multiple packages need to change together.
Is it safe to run in production, and how should I test it?
The release is a dependency alignment with no indicated feature change, so risk is mostly in Composer resolution rather than runtime behavior. Before promoting, run your unit, integration, and smoke tests against the updated lockfile, and confirm your CI matrix covers your production Laravel and PHP versions. Keep a lockfile rollback path and deploy to staging first, especially if the package touches hot request paths.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections