Git Product home page Git Product logo

clearbit-php's Introduction

clearbit-php

PHP SDK for Clearbit API (http://clearbit.com).

This SDK is NOT official, heavily inspired by sementria-php.

We developped and maintain this library for our own usage and released it open source (see LICENCE.md) if it could help. Clearbit and its API belongs to Clearbit.

Basic usage

Remember to include the Composer autoloader in your application:

<?php
require_once 'vendor/autoload.php';

$clearbit = Clearbit\Client::factory(['api_token' => 'my-api-token']);

$person = $clearbit->getPerson(['email' => '[email protected]']); // returns a Clearbit/Person instance
var_dump($person->get('name.fullname'));

$company = $clearbit->getCompany(['domain' => 'bar.com'])); // returns a Clearbit/Company instance
var_dump($company->get('name'));

$combined = $clearbit->getPersonCombined(['email' => '[email protected]']); // returns an array ['person' => Clearbit/Person, 'company' => Clearbit/Company]
var_dump($combined['person']->get('name.fullname'));
var_dump($combined['company']->get('name'));

$autocomplete = $clearbit->getAutocomplete(['name' => 'foo'])); // returns a Clearbit/Autocomplete instance
var_dump($autocomplete->get('0.domain'));

$logo = $clearbit->getLogo(['domain' => 'foo.com'])); // returns a Clearbit/Logo instance
var_dump($autocomplete->get('logo'));

Testing

Run bin/phpunit

Resources

Resources this API supports:

Uri Methods Comments
https://person.clearbit.com/v1/people/email/:email GET
https://person.clearbit.com/v1/combined/email/:email GET
https://person.clearbit.com/v1/people/:id/flag POST /!\ untested yet
https://company.clearbit.com/v1/companies/domain/:domain GET
https://company.clearbit.com/v1/companies/:id/flag POST /!\ untested yet
https://autocomplete.clearbit.com/v1/companies/suggest?query=:name GET
https://logo.clearbit.com/:domain?size=:size&format=:format&greyscale=:greyscale GET

Licence

See LICENCE file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.