PHPackages                             chrisreedio/api-amigo - 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. [API Development](/categories/api)
4. /
5. chrisreedio/api-amigo

ActiveLibrary[API Development](/categories/api)

chrisreedio/api-amigo
=====================

API Quota Management and Analytics

v4.1.0(3mo ago)1532↓26.2%[1 issues](https://github.com/chrisreedio/api-amigo/issues)[4 PRs](https://github.com/chrisreedio/api-amigo/pulls)MITPHPPHP ^8.3CI passing

Since Jan 6Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/chrisreedio/api-amigo)[ Packagist](https://packagist.org/packages/chrisreedio/api-amigo)[ Docs](https://github.com/chrisreedio/api-amigo)[ GitHub Sponsors](https://github.com/chrisreedio)[ RSS](/packages/chrisreedio-api-amigo/feed)WikiDiscussions 4.x Synced 1mo ago

READMEChangelog (10)Dependencies (17)Versions (84)Used By (0)

API Quota Management and Analytics
==================================

[](#api-quota-management-and-analytics)

[![Latest Version on Packagist](https://camo.githubusercontent.com/20c1ba9e8efe596f0d9c30e8eeddcdcc574a6e65acb07f05d8d3a0693af1ea3d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636872697372656564696f2f6170692d616d69676f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chrisreedio/api-amigo)[![GitHub Tests Action Status](https://camo.githubusercontent.com/ac9065b50af1c831c78872280b66d5c7b0f6cba53b2f5233e9cca3a256128adf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636872697372656564696f2f6170692d616d69676f2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/chrisreedio/api-amigo/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/0cd3b6e4f73065e109ca588843fed34364065d211cd069875fe8b5f2e1a2b12b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636872697372656564696f2f6170692d616d69676f2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/chrisreedio/api-amigo/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/8d107906dfe1aa7ad0613f8a08177f835a842133553b369a122ca038ce022bb8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636872697372656564696f2f6170692d616d69676f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chrisreedio/api-amigo)

Overview
--------

[](#overview)

API Amigo is a comprehensive Laravel package tailored to elevate your API integration experience.

It's more than just a quota manager; it's a robust tool for monitoring API health, tracking failed requests, and delivering actionable insights through aggregate statistics.

API Amigo is your dependable partner, ensuring that you make the most out of every API interaction.

Key Features
------------

[](#key-features)

- Quota Monitoring: Stay informed on your API usage with real-time tracking of quota limits. API Amigo diligently monitors quota headers in API responses, ensuring you're always within bounds.
- Failure Analysis: Track and analyze failed API requests. Understand the 'why' behind failures to improve reliability and efficiency in your API interactions.
- Aggregate Statistics: Get a comprehensive view of your API usage with detailed statistics. Understand usage patterns, peak request times, and more, enabling data-driven decisions.
- Intuitive Dashboard: Seamlessly integrated with Laravel's Filament admin panel, API Amigo provides a clear, concise view of your API landscape, all in one place.
- Custom Alerts: Configure alerts for approaching quota limits and detect anomalies in API performance. Stay proactive and prevent unexpected downtimes.
- Easy Integration: Designed with simplicity in mind, API Amigo offers a straightforward setup process, allowing you to focus on building, not configuring.

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

[](#installation)

You can install the package via composer:

```
composer require chrisreedio/api-amigo
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="api-amigo-migrations"
php artisan migrate
```

Install the plugin into your panel by adding the following to your `AdminPanelProvider.php` (or other panel) file:

```
    ->plugins([
        // ... Other plugins
        \ChrisReedIO\APIAmigo\APIAmigoPlugin::make(),
    ])
```

Be sure to enable API Amigo tracking globally via your `.env`:

```
AMIGO_ENABLED=true
```

You can publish the config file with:

```
php artisan vendor:publish --tag="api-amigo-config"
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="api-amigo-views"
```

Response Aggregation
--------------------

[](#response-aggregation)

API Amigo provides powerful commands to aggregate API response data for analytics and reporting. These commands help you track performance metrics, success rates, and usage patterns over time.

### Available Commands

[](#available-commands)

1. **Daily Aggregation**

    ```
    php artisan responses:aggregate-daily
    ```

    This command processes the previous day's responses and creates hourly aggregations. It's designed to be run daily via the scheduler.
2. **Historical Data Processing**

    ```
    # Process all historical data up to yesterday
    php artisan responses:aggregate --all

    # Process a specific date range
    php artisan responses:aggregate 2023-01-01 2023-12-31 --bulk

    # Process a single day
    php artisan responses:aggregate 2023-01-01
    ```
3. **Pruning Old Responses**

    ```
    # Prune responses older than the configured lifetime (default: 90 days)
    php artisan responses:prune

    # Force prune without confirmation
    php artisan responses:prune --force
    ```

### Setting Up Scheduling

[](#setting-up-scheduling)

For Laravel 11/12 applications, add the following to your `app/Console/Kernel.php`:

```
use Illuminate\Support\Facades\Schedule;
use ChrisReedIO\APIAmigo\Commands\ResponsesDailyAggregationCommand;
use ChrisReedIO\APIAmigo\Commands\PruneResponsesCommand;

protected function schedule(Schedule $schedule): void
{
    // Run daily aggregation at 1 AM in your configured timezone
    Schedule::command(new ResponsesDailyAggregationCommand)
        ->dailyAt('22:00')
        ->timezone(config('api-amigo.aggregation.timezone', 'UTC'));

    // Run pruning weekly on Sunday at 2 AM
    Schedule::command(new PruneResponsesCommand, ['--force'])
        ->weekly()
        ->sundays()
        ->at('02:00');
}
```

### Configuration

[](#configuration)

You can configure the timezone and response lifetime in your `.env` file:

```
AMIGO_AGGREGATION_TIMEZONE=America/New_York
AMIGO_PRUNE_LIFETIME_DAYS=90
```

Or directly in `config/api-amigo.php`:

```
'aggregation' => [
    'timezone' => 'America/New_York',
    'prune_lifetime_days' => 90,
],
```

### Initial Setup

[](#initial-setup)

When first installing API Amigo or after a long period without aggregation, you should:

1. Process all historical data:

    ```
    php artisan responses:aggregate --all
    ```
2. Set up the daily scheduler as shown above

The `--all` command will:

- Find your earliest response date
- Process all data up to yesterday
- Use bulk processing to handle large datasets efficiently
- Show progress and statistics during processing

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Chris Reed](https://github.com/chrisreedio)
- [All Contributors](../../contributors)

License
-------

[](#license)

This is currently closed source.

License choice is pending. Please check back soon.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance66

Regular maintenance activity

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 95% 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 ~12 days

Recently: every ~45 days

Total

62

Last Release

99d ago

Major Versions

v1.0.0-beta.21 → v4.0.0-beta.22025-08-13

PHP version history (2 changes)v1.0.0-alpha.1PHP ^8.1

v1.0.0-alpha.29PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/edf125933a93f1f09822d1679b36b2d6deed75b2380f6e1c57d54cd52a8db29d?d=identicon)[chrisreedio](/maintainers/chrisreedio)

---

Top Contributors

[![chrisreedio](https://avatars.githubusercontent.com/u/77644584?v=4)](https://github.com/chrisreedio "chrisreedio (342 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")

---

Tags

laravelchrisreedioapi-amigo

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/chrisreedio-api-amigo/health.svg)

```
[![Health](https://phpackages.com/badges/chrisreedio-api-amigo/health.svg)](https://phpackages.com/packages/chrisreedio-api-amigo)
```

###  Alternatives

[guava/filament-knowledge-base

A filament plugin that adds a knowledge base and help to your filament panel(s).

206120.5k1](/packages/guava-filament-knowledge-base)[rupadana/filament-api-service

A simple api service for supporting filamentphp

204103.8k7](/packages/rupadana-filament-api-service)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[tapp/filament-webhook-client

Add a Filament resource and a policy for Spatie Webhook client

1120.2k](/packages/tapp-filament-webhook-client)[codebar-ag/laravel-zammad

Zammad integration with Laravel

106.1k](/packages/codebar-ag-laravel-zammad)[zpmlabs/filament-api-docs-builder

This package will give you the best API docs building experience.

151.9k](/packages/zpmlabs-filament-api-docs-builder)

PHPackages © 2026

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