Skip to content

wlbrough/clearbit-api

Repository files navigation

Clearbit PHP API Client

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Clearbit API Client. Currently supporting the Enrichment API, but the entire API is on the roadmap for implementation. The current implementation uses v2 endpoints.

Install

Via Composer

$ composer require wlbrough/clearbit-api

Quick Start

This implementation supports using one or multiple api keys. If a single key is used, clients are generated using static functions, otherwise instance methods generate clients.

Using a single key

All of the following examples assume the following step:

use wlbrough\clearbit\Clearbit;

Clearbit::setKey('token');

Configuring endpoint behavior

By default, Clearbit transmits data to a webhook if data is not immediately available. You can configure an endpoint url to receive webhooks, or you can use the steaming API to wait for results.

$enrichment = Clearbit::createEnrichmentApi();

// Webhook endpoint
$enrichment->setWebhookEndpoint('https://test.com/api/webhook');

// Streaming
$enrichment->enableStreaming();

Get combined (person and company) data

$enrichment = Clearbit::createEnrichmentApi();
$enrichment->combined('test@test.com');

Get person data

$enrichment = Clearbit::createEnrichmentApi();
$enrichment->person('test@test.com');

To subscribe to updates:

$enrichment = Clearbit::createEnrichmentApi();
$enrichment->person('test@test.com', true);

Get company data

$enrichment = Clearbit::createEnrichmentApi();
$enrichment->company('test.com');

Name To Domain

$nameToDomain = Clearbit::createNameToDomain();
$nameToDomain->get('Segment');

Status

  • Enrichment
  • Discovery
  • Prospector
  • Risk
  • Reveal
  • Name To Domain
  • Logo

Change log

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

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

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

Credits

License

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

About

A complete (unofficial) PHP SDK for Clearbit

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages