wlbrough/clearbit-api

A complete (unofficial) PHP SDK for Clearbit

0.2.2 2018-08-20 18:26 UTC

This package is not auto-updated.

Last update: 2024-11-24 06:40:45 UTC


README

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.