Search by

jeffersongoncalves / laravel-clearbit

PHP/Laravel client for the Clearbit REST API: person enrichment, company enrichment, combined lookup, IP reveal, name-to-domain, and prospector search.

Maintainers

Package info

github.com/jeffersongoncalves/laravel-clearbit

pkg:composer/jeffersongoncalves/laravel-clearbit

Transparency log

Fund package maintenance!

jeffersongoncalves

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

1.0.0 2026-09-06 22:11 UTC

This package is auto-updated.

Last update: 2026-09-06 22:17:57 UTC


README

Laravel Clearbit

Laravel Clearbit

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads License

A PHP/Laravel client for the Clearbit REST APIs. Covers person enrichment, company enrichment, combined lookup, IP reveal, name-to-domain, and prospector search through a simple, typed API built on Laravel's Http client.

Features

  • Person: enrich by email (/v2/people/find)
  • Company: enrich by domain (/v2/companies/find)
  • Combined: person + company in one call by email (/v2/combined/find)
  • Reveal: identify a company from an IP address (/v1/companies/find)
  • Name to Domain: resolve a company name to its domain (/v1/domains/find)
  • Prospector: search for people at a company by role/seniority/title (/v1/people/search)
  • Throws ClearbitException (with the original API error body) on any non-2xx response
  • Throws InvalidArgumentException before hitting the API when required criteria are missing

Installation

You can install the package via composer:

composer require jeffersongoncalves/laravel-clearbit

Publish the config file:

php artisan vendor:publish --tag=clearbit-config

Set your Clearbit API key in .env:

CLEARBIT_API_KEY=your-api-key

Find it under Settings > API in your Clearbit dashboard.

Configuration

// config/clearbit.php
return [
    'api_key' => env('CLEARBIT_API_KEY', ''),
];

Usage

The package is resolved via the Clearbit facade or by injecting JeffersonGoncalves\Clearbit\Clearbit. Each resource is exposed as a method returning a dedicated resource class.

Person

use JeffersonGoncalves\Clearbit\Facades\Clearbit;

$person = Clearbit::person()->find('jane@example.com');

Company

$company = Clearbit::company()->find('example.com');

Combined

$combined = Clearbit::combined()->find('jane@example.com');
// $combined['person'], $combined['company']

Reveal

$company = Clearbit::reveal()->find('1.2.3.4');

Name to Domain

$result = Clearbit::nameToDomain()->find('Example Inc.');
// $result['domain']

Prospector

$people = Clearbit::prospector()->search('example.com', [
    'role' => 'engineering',
    'seniority' => 'senior',
    'title' => 'Engineer',
    'page' => 1,
    'page_size' => 10,
]);

Error handling

Any non-2xx API response throws JeffersonGoncalves\Clearbit\Exceptions\ClearbitException, which exposes the decoded error body:

use JeffersonGoncalves\Clearbit\Exceptions\ClearbitException;

try {
    Clearbit::person()->find('unknown@example.com');
} catch (ClearbitException $e) {
    logger()->error($e->getMessage(), $e->errorBody());
}

Missing required criteria (an empty email, domain, ip, or name argument) throw InvalidArgumentException before any HTTP call is made.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.