TombaTomba
Start free
  • Documentation
  • API reference
  • SDKs & CLI
  • AI & MCP
  • Integrations
  • Enterprise
  • Migration guides

Find, verify and enrich B2B contacts from public sources, in the app, your spreadsheet or through the API.

GDPR & CCPA

// docs

  • API changelog
  • Support options
  • Security

// platform

  • Dashboard
  • Pricing
  • API status

// resources

  • Help center
  • Product updates
  • TombaBot crawler

// company

  • Website
  • Contact us
  • Edit or remove your data

© 2021–2026 Tomba.io

  • Terms of service
  • Privacy policy
  • Cookie policy
  • Security policy
  • GDPR
  • CCPA
SDKs
    SDK overviewC# SDKDart SDKDeno SDKElixir SDKGo SDKLua SDKNode.js SDKPerl SDKPHP SDKPython SDKR SDKRuby SDKRust SDK
CLI
SDKs

PHP SDK

tomba-io/php is the official PHP client for the Tomba API. Each API area is a service class, and each method sends one request.

Requirements

  • PHP 8.1 or later, as declared in composer.json.
  • The curl and json extensions.

Install

TerminalCode
composer require tomba-io/php

Classes are autoloaded from the Tomba namespace; the services are in Tomba\Services.

Authenticate

Create an API key and copy your secret on the API keys page, then export both:

TerminalCode
export TOMBA_API_KEY="ta_xxxx" export TOMBA_SECRET_KEY="ts_xxxx"

The SDK doesn't read environment variables. Pass the values to setKey() and setSecret(), and the client sends them as the X-Tomba-Key and X-Tomba-Secret headers. Key expiry and rotation are covered in Authentication.

First request

Find the email address of a person at a company:

Code
<?php require __DIR__ . '/vendor/autoload.php'; use Tomba\Client; use Tomba\Services\Finder; $client = (new Client()) ->setKey(getenv('TOMBA_API_KEY')) ->setSecret(getenv('TOMBA_SECRET_KEY')); $result = (new Finder($client))->emailFinder('stripe.com', 'Jane', 'Doe'); echo $result['data']['data']['email'], PHP_EOL;

Every method returns an array with two keys: data, the decoded JSON body, and rate_limit. The API wraps its payload in its own data object (Response format), so the address is at $result['data']['data']['email'].

Errors

The SDK throws Tomba\TombaException when the API responds with status 400 or higher, when cURL fails, and before sending a request when a required argument is empty.

MethodValue
getCode()The HTTP status. 0 when the error happened before a response was received.
getMessage()The API's errors.message, or the cURL error.
getResponse()The decoded error body, ['errors' => ['type' => …, 'message' => …, 'code' => …]], or null.
Code
<?php require __DIR__ . '/vendor/autoload.php'; use Tomba\Client; use Tomba\Services\Finder; use Tomba\TombaException; $client = (new Client()) ->setKey(getenv('TOMBA_API_KEY')) ->setSecret(getenv('TOMBA_SECRET_KEY')); try { $result = (new Finder($client))->emailFinder('stripe.com', 'Jane', 'Doe'); echo $result['data']['data']['email'], PHP_EOL; } catch (TombaException $e) { echo $e->getCode(), ' ', $e->getMessage(), PHP_EOL; echo $e->getResponse()['errors']['type'] ?? '', PHP_EOL; }

Enrichment::person(), company(), and combined() don't throw when nothing is found: those endpoints answer with status 200 and an errors body, so check $result['data']['errors']. Each errors.type is described in Errors.

Rate limits and retries

The SDK doesn't retry. $result['rate_limit'] holds the response's rate limit headers, keyed by header name: x-second-rate-limit, x-minute-rate-limit, x-daily-rate-limit, x-minute-request-left, x-daily-request-left, x-minute-reset-seconds, x-daily-reset-seconds, retry-after, ratelimit-policy, and ratelimit. Numbers are integers, and a header that is absent is null.

A 429 throws TombaException with code 429, without the response headers. Wait before retrying as described in Handle 429 responses.

Requests time out after 120 seconds; the timeout isn't configurable.

Method reference

Create each service with the client, for example new Finder($client).

MethodEndpoint
Account::getAccount()GET /me
Usage::getUsage()GET /usage
Logs::getLogs(?int $page = null, ?int $limit = null)GET /logs
Domain::domainSearch(string $domain, int $page = null, int $limit = null, string $department = null, bool $enrichMobile = null, string $webhookUrl = null)GET /domain-search
Finder::emailFinder(string $domain, string $firstName, string $lastName, string $webhookUrl = null)GET /email-finder
Finder::authorFinder(string $url, string $webhookUrl = null)GET /author-finder
Finder::linkedinFinder(string $url, string $webhookUrl = null)GET /linkedin
Format::emailFormat(string $domain)GET /email-format
Location::getLocation(string $domain)GET /location
Count::emailCount(string $domain)GET /email-count
Verifier::emailVerifier(string $email, string $webhookUrl = null)GET /email-verifier
Sources::emailSources(string $email)GET /email-sources
Enrichment::person(string $email, string $webhookUrl = null)GET /people/find
Enrichment::company(string $domain)GET /companies/find
Enrichment::combined(string $email)GET /combined/find
Finder::phoneFinder(string $email, string $webhookUrl = null)GET /phone-finder
Phone::phoneFinder(array $params, string $webhookUrl = null)GET /phone-finder
Phone::phoneValidator(string $phone, ?string $countryCode = null)GET /phone-validator
Status::domainStatus(string $domain)GET /domain-status
Status::autoComplete(string $query)GET /domain-suggestions
Similar::websites(string $domain)GET /similar
Technology::list(string $domain)GET /technology
Reveal::companiesSearch(array $params)POST /reveal/search
Flag::listFlags(?int $page = null, ?int $limit = null)GET /flag
Keys::getKeys()GET /keys
Keys::getKey(string $id)GET /keys/{id}
Keys::createKey()POST /keys
Keys::resetKey(string $id)PUT /keys/{id}
Keys::deleteKey(string $id)DELETE /keys/{id}
Leads::listLeads(?int $page = null, ?int $limit = null, ?string $domain = null)GET /leads
Leads::getLead(string $id)GET /leads/{id}
Leads::createLead(array $data)POST /leads
Leads::updateLead(string $id, array $data)PUT /leads/{id}
Leads::deleteLead(string $id)DELETE /leads/{id}
LeadsLists::getLists()GET /leads_lists
LeadsLists::deleteListId(string $id)DELETE /leads_lists/{id}
LeadsAttributes::getLeadAttributes()GET /attributes
LeadsAttributes::deleteLeadAttribute(string $id)DELETE /attributes/{id}
Bulk::listBulks(string $type, ?array $params = null)GET /bulk/{type}
Bulk::createBulk(string $type, array $data)POST /bulk/{type}
Bulk::getBulk(string $type, int $id)GET /bulk/{type}/{id}
Bulk::launchBulk(string $type, int $id)PUT /bulk/{type}/{id}
Bulk::bulkProgress(string $type, int $id)GET /bulk/{type}/{id}/progress
Bulk::downloadBulk(string $type, int $id)GET /bulk/{type}/{id}/download
Bulk::renameBulk(string $type, int $id, string $name)PUT /bulk/{type}/{id}/rename
Bulk::archiveBulk(string $type, int $id)DELETE /bulk/{type}/{id}/archive
Bulk::deleteBulk(string $type, int $id)DELETE /bulk/{type}/{id}/delete

$type is the {type} segment listed in Bulk types; the order of calls is described in Lifecycle. createBulk() sends a JSON body, so it can't create jobs that need a CSV upload, such as email finder jobs. downloadBulk() returns the results file, a CSV, as a string in $result['data'].

Source

github.com/tomba-io/php (Apache-2.0). Release notes are in CHANGELOG.md.

Last modified on September 30, 2026
Perl SDKPython SDK
On this page
  • Requirements
  • Install
  • Authenticate
  • First request
  • Errors
  • Rate limits and retries
  • Method reference
  • Source
PHP
PHP