PHPackages                             bestcompany/bestcompany-api - 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. bestcompany/bestcompany-api

ActiveLibrary[API Development](/categories/api)

bestcompany/bestcompany-api
===========================

Bestcompany API Wrapper for PHP

v0.10.0(2mo ago)17.1k↓50%2Apache-2.0PHPPHP ^8.2

Since Oct 6Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/bestcompany-org/php-bestcompany-api-wrapper)[ Packagist](https://packagist.org/packages/bestcompany/bestcompany-api)[ Docs](https://github.com/bestcompany/bestcompany-api)[ RSS](/packages/bestcompany-bestcompany-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (53)Used By (0)

Bestcompany &amp; Snoball API Wrapper
=====================================

[](#bestcompany--snoball-api-wrapper)

[![Latest Version on Packagist](https://camo.githubusercontent.com/65d17e1192c03267165416ca6f319dd62376c078ac5a0c1541117c3e9e2d4ad2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62657374636f6d70616e792f62657374636f6d70616e792d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bestcompany/bestcompany-api)[![Total Downloads](https://camo.githubusercontent.com/d54bd4bf88b602e8c732a3893b9ee123847a5a93de90829c361ca28a3fd0ebd6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62657374636f6d70616e792f62657374636f6d70616e792d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bestcompany/bestcompany-api)[![GitHub Actions](https://github.com/bestcompany/bestcompany-api/actions/workflows/main.yml/badge.svg)](https://github.com/bestcompany/bestcompany-api/actions/workflows/main.yml/badge.svg)

This package provides Laravel-compatible API wrappers for both Bestcompany and Snoball services, with automatic resource separation and type-safe dependency injection.

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

[](#installation)

You can install the package via composer:

```
composer require bestcompany/bestcompany-api
```

Then if using laravel publish your config file by running the command.

`php artisan vendor:publish --provider="Bestcompany\BestcompanyApi\BestcompanyApiServiceProvider" --tag="config"`

Add your api key to the .env using the key from the config file.

Usage
-----

[](#usage)

### Separate API Clients

[](#separate-api-clients)

This package provides separate API clients for different services:

- **BestcompanyApi**: Main API for companies, reviews, and general operations
- **SnoballApi**: Dedicated API for referral-related operations

#### Using BestcompanyApi

[](#using-bestcompanyapi)

```
use Bestcompany\BestcompanyApi\BestcompanyApi;

$api = BestcompanyApi::create([
    'key' => 'your_api_key',
    'hostname' => 'https://api.bestcompany.com/api',
    'version' => 'v1'
]);

// Company operations
$companies = $api->companies()->all();
$company = $api->companies()->get(123);

// Review operations
$reviews = $api->reviews()->all();
$review = $api->reviews()->get(456);

// Other available resources
$api->verticals()->all();
$api->factSheets()->all();
$api->companyReviewLists()->all();
```

#### Using SnoballApi

[](#using-snoballapi)

```
use Bestcompany\BestcompanyApi\SnoballApi;

$snoballApi = SnoballApi::create([
    'key' => 'your_snoball_api_key',
    'hostname' => 'https://api.snoball.com/api',
    'version' => 'v1'
]);

// Referral operations
$referral = $snoballApi->referralRequest()->create([
    'user_id' => 456,
    'company_id' => 789,
    'referral_type' => 'standard'
]);

$salesRep = $snoballApi->salesRepReferral()->all();
```

### Laravel Usage with Dependency Injection

[](#laravel-usage-with-dependency-injection)

```
use Bestcompany\BestcompanyApi\BestcompanyApi;
use Bestcompany\BestcompanyApi\SnoballApi;

class CompanyController extends Controller
{
    public function __construct(
        private BestcompanyApi $bestcompanyApi,
        private SnoballApi $snoballApi
    ) {}

    public function getCompanies()
    {
        $companies = $this->bestcompanyApi->companies()->all();
        return response()->json($companies);
    }

    public function createReferral(Request $request)
    {
        $referral = $this->snoballApi->referralRequest()->create($request->all());
        return response()->json($referral);
    }
}
```

### Available Resources

[](#available-resources)

#### BestcompanyApi Resources

[](#bestcompanyapi-resources)

- `bsCompany()` - Company management operations
- `bsFeatureAdoption()` - Feature adoption tracking
- `bsReviewActions()` - Review action management
- `bsUserNotifications()` - User notification system
- `cache()` - Caching operations
- `companies()` - Company data and operations
- `companyPromotionalUrls()` - Promotional URL management
- `companyReviewLists()` - Company review list management
- `emails()` - Email operations
- `factSheetQuestions()` - Fact sheet question management
- `factSheets()` - Fact sheet operations
- `fieldReps()` - Field representative management
- `reviewBsUserFavorites()` - User favorite reviews
- `reviewMessage()` - Review messaging system
- `reviews()` - Review data and operations
- `verticals()` - Industry vertical management

#### SnoballApi Resources

[](#snoballapi-resources)

- `referralRequest()` - Referral request management
- `repConversation()` - Rep conversation management
- `salesRepReferral()` - Sales representative referral operations

### Configuration

[](#configuration)

### Configuration

[](#configuration-1)

The package requires explicit configuration to be passed to each API client. The Laravel service provider handles this automatically using environment variables and config files.

**Environment Variables:**

```
# Bestcompany API
BC_API_KEY=your_bestcompany_api_key
BC_HOSTNAME=https://api.bestcompany.com/api
BC_API_VERSION=v1

# Snoball API (for referral requests)
SNOBALL_API_KEY=your_snoball_api_key
SNOBALL_HOSTNAME=https://api.snoball.com/api
SNOBALL_API_VERSION=v1
```

**Laravel Configuration:**After publishing the config files, you can configure these in `config/bestcompany-api.php` and `config/snoball.php`:

```
// config/bestcompany-api.php
return [
    'api_key' => env('BC_API_KEY', null),
    'hostname' => env('BC_HOSTNAME', 'https://api.bestcompany.com/api'),
    'version' => env('BC_API_VERSION', 'v1'),
];

// config/snoball.php
return [
    'api_key' => env('SNOBALL_API_KEY', null),
    'hostname' => env('SNOBALL_HOSTNAME', 'https://api.snoball.com/api'),
    'version' => env('SNOBALL_API_VERSION', 'v1'),
];
```

**Manual Configuration:**When creating API instances manually (outside of Laravel), you must provide the configuration explicitly:

```
// Required configuration for BestcompanyApi
$api = BestcompanyApi::create([
    'key' => 'your_api_key',
    'hostname' => 'https://api.bestcompany.com/api',
    'version' => 'v1'
]);

// Required configuration for SnoballApi
$snoballApi = SnoballApi::create([
    'key' => 'your_snoball_key',
    'hostname' => 'https://api.snoball.com/api',
    'version' => 'v1'
]);
```

> **Note**: The API clients no longer fall back to environment variables automatically. Configuration must be explicitly provided either through the Laravel service provider or when creating instances manually.

### Laravel Facades (Optional)

[](#laravel-facades-optional)

You can also use Laravel facades for easier access:

```
// In your config/app.php aliases array:
'aliases' => [
    'BestcompanyApi' => Bestcompany\BestcompanyApi\BestcompanyApiFacade::class,
    'SnoballApi' => Bestcompany\BestcompanyApi\SnoballApiFacade::class,
]

// Then use directly:
use BestcompanyApi;
use SnoballApi;

$companies = BestcompanyApi::companies()->all();
$referrals = SnoballApi::referralRequest()->all();
```

### Error Handling

[](#error-handling)

The package automatically prevents cross-API resource access:

```
// This will throw a BadMethodCallException:
$bestcompanyApi->referralRequest(); // ❌ Not available in BestcompanyApi

// This will throw a BadMethodCallException:
$snoballApi->companies(); // ❌ Not available in SnoballApi
```

The error messages will show you which resources are available for each API client.

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- Created by [Cameron Pope](https://github.com/campope)
- Maintained by [Braden James](https://github.com/Censin)
- [All Contributors](../../contributors)

License
-------

[](#license)

The Apache License 2. Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance86

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 74.6% 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 ~33 days

Recently: every ~51 days

Total

50

Last Release

66d ago

Major Versions

v0.3.2.0 → 3.x-dev2022-09-02

PHP version history (2 changes)v0.1.1PHP &gt;= 8.0

v0.5.0.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![campope](https://avatars.githubusercontent.com/u/7671854?v=4)](https://github.com/campope "campope (50 commits)")[![Censin](https://avatars.githubusercontent.com/u/21129187?v=4)](https://github.com/Censin "Censin (12 commits)")[![cwellmoney20](https://avatars.githubusercontent.com/u/18297400?v=4)](https://github.com/cwellmoney20 "cwellmoney20 (3 commits)")[![ethyl2](https://avatars.githubusercontent.com/u/6438167?v=4)](https://github.com/ethyl2 "ethyl2 (2 commits)")

---

Tags

bestcompanybestcompany-api

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[grantholle/powerschool-api

A Laravel package to make interacting with PowerSchool less painful.

1715.6k1](/packages/grantholle-powerschool-api)

PHPackages © 2026

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