spatie/guzzle-rate-limiter-middleware
Guzzle middleware to rate-limit HTTP requests by requests/second or requests/minute. When the limit is hit, it sleeps until a slot is available. Includes an in-memory store and supports custom persistence for sharing limits across processes.
Adopt When:
Look Elsewhere If:
"This lightweight package lets us enforce API rate limits programmatically, reducing risks of throttling, cost overruns, or service disruptions from third-party APIs. For example, if we’re integrating with Stripe or a weather API, it ensures we stay within their limits automatically—saving dev time and avoiding last-minute outages. It’s a plug-and-play solution with minimal overhead, and the MIT license means no vendor lock-in. Given [X]’s reliance on [API Provider], this could prevent [Y] dollars in potential penalties or downtime."
*"The spatie/guzzle-rate-limiter-middleware gives us a simple way to add rate limiting to Guzzle requests. Key benefits:
100 requests/minute).HttpClient class for all external API calls. For per-user limits, we’d layer on Laravel’s built-in rate limiting. Let’s prototype it for [API Provider] first—should take <1 hour to implement."*How can I help you explore Laravel packages today?