PHPackages                             alialican/hubspot-rate-limiter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. alialican/hubspot-rate-limiter

ActiveLibrary[HTTP &amp; Networking](/categories/http)

alialican/hubspot-rate-limiter
==============================

This package wraps default hubspot/api-client package with a rate limiter, so that you dont breach API limits

v1.0.1-beta(2y ago)21MITPHPPHP &gt;=8.0

Since Jul 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/AliAlican/hubspot-rate-limiter)[ Packagist](https://packagist.org/packages/alialican/hubspot-rate-limiter)[ RSS](/packages/alialican-hubspot-rate-limiter/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

HubSpot Rate Limiter
====================

[](#hubspot-rate-limiter)

This package provides a rate limiting wrapper for the HubSpot API client, allowing you to set per-second and daily rate limits for your HubSpot API calls. It leverages the Redis cache store for efficient rate limiting. If Redis is not available, it falls back to a generic cache implementation.

Installation
------------

[](#installation)

Install the package using Composer:

```
composer require alialican/hubspot-rate-limiter
```

Usage:

1.Import the package in your code:

`use HubSpotRateLimiter\HubSpotClientWrapper;`

2.Create an instance of the HubspotClientWrapper class and pass in the required dependencies:

```
use Illuminate\Support\Facades\Cache;
use HubSpot\Discovery\Discovery;

$hubspotClient = new Discovery();

$secondLimit = 100; // Replace with your desired per-second limit
$dailyLimit = 250000; // Replace with your desired daily limit

$hubspot = new HubspotClientWrapper($hubspotClient, $secondLimit, $dailyLimit);

```

Use the $hubspot instance as you would use the original HubSpot API client. The rate limiter will automatically enforce the specified rate limits on each API call.

`$result = $hubspot->crm()->contacts()->getAll();`

Important Points

This package uses Laravel's Cache facade for rate limiting. Make sure you have the proper cache driver set up in your Laravel configuration. When the cache driver is Redis, the rate limiter directly interacts with Redis for efficient rate limiting. Ensure that your Redis configuration is correctly set up. If your Redis setup is unusual or complex, the Redis-based rate limiting may not work as expected. The rate limiting mechanism used in the enforceRateLimitGeneric method is simplistic and may not handle high rates of concurrency as efficiently as the Redis-based solution. The package assumes that the Redis server supports the eval command, as it uses Lua scripts for rate limiting. If your Redis server does not support this command, the rate limiting may fail. Please test the package thoroughly in your specific environment to ensure it meets your requirements and works correctly with your Redis configuration.

License This package is open-source and licensed under the MIT License.

`Feel free to customize and expand on the README to provide more information or clarify any additional details specific to your use case.`

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1091d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44370554?v=4)[Alican Ali](/maintainers/AliAlican)[@AliAlican](https://github.com/AliAlican)

---

Top Contributors

[![AliAlican](https://avatars.githubusercontent.com/u/44370554?v=4)](https://github.com/AliAlican "AliAlican (6 commits)")

### Embed Badge

![Health badge](/badges/alialican-hubspot-rate-limiter/health.svg)

```
[![Health](https://phpackages.com/badges/alialican-hubspot-rate-limiter/health.svg)](https://phpackages.com/packages/alialican-hubspot-rate-limiter)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.9k1](/packages/mike-bronner-laravel-model-caching)[omniphx/forrest

A Laravel library for Salesforce

2754.7M9](/packages/omniphx-forrest)[hamburgscleanest/guzzle-advanced-throttle

A Guzzle middleware that can throttle requests according to (multiple) defined rules. It is also possible to define a caching strategy, e.g. get response from cache when rate limit is exceeded or always get cached value to spare your rate limits.

13033.4k1](/packages/hamburgscleanest-guzzle-advanced-throttle)[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21111.6k](/packages/iazaran-smart-cache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
