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

Rust SDK

The tomba crate is the official Rust client for the Tomba API. All methods hang off one blocking client, and each method sends one request.

Requirements

  • Rust 1.85 or later. Cargo.toml declares rust-version = "1.63", but the current releases of the crate's dependencies (reqwest 0.12 and the crates it pulls in) need Rust 1.85.
  • On Linux, OpenSSL development headers, for reqwest's default TLS backend.

Install

TerminalCode
cargo add tomba

The client uses reqwest::blocking, so each call blocks the current thread. In async code, run calls with tokio::task::spawn_blocking.

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 in a TombaConfig to Tomba::init, 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
use std::env; use tomba::{Tomba, TombaConfig}; fn main() -> Result<(), Box<dyn std::error::Error>> { let client = Tomba::init(TombaConfig { key: env::var("TOMBA_API_KEY")?, secret: env::var("TOMBA_SECRET_KEY")?, })?; let result = client.email_finder("stripe.com", "Jane", "Doe", None)?; if let Some(email) = result.data["data"]["email"].as_str() { println!("{email}"); } Ok(()) }

Every method returns Result<TombaResponse, TombaError>. TombaResponse.data is the JSON body as a serde_json::Value, and TombaResponse.rate_limit holds the rate limit headers. The API wraps its payload in its own data object (Response format), so the address is at result.data["data"]["email"].

Errors

TombaError has four variants:

VariantWhen
Api { message, code }The API responded with status 400 or higher. code is the HTTP status; message is the raw response body, for example {"errors":{"type":"authentication_failed","message":"Please enter a valid KEY.","code":400}}.
Http(reqwest::Error)The request failed before a response arrived, for example a timeout.
Parse(serde_json::Error)A successful response body isn't JSON.
InvalidParam(String)A bulk method got an unknown bulk type. No request is sent.
Code
use std::env; use tomba::{Tomba, TombaConfig, TombaError}; fn main() -> Result<(), Box<dyn std::error::Error>> { let client = Tomba::init(TombaConfig { key: env::var("TOMBA_API_KEY")?, secret: env::var("TOMBA_SECRET_KEY")?, })?; match client.email_finder("stripe.com", "Jane", "Doe", None) { Ok(result) => println!("{}", result.data["data"]["email"]), Err(TombaError::Api { code, message }) => eprintln!("HTTP {code}: {message}"), Err(err) => eprintln!("{err}"), } Ok(()) }

To branch on errors.type, parse message with serde_json::from_str. Each type is described in Errors.

Rate limits and retries

The SDK doesn't retry. result.rate_limit holds the response's rate limit headers as Option<String> fields: 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, rate_limit_policy, and rate_limit. tomba::parse_rate_limit reads the same headers from a reqwest::header::HeaderMap.

A 429 returns TombaError::Api with code 429 and no headers. Wait before retrying as described in Handle 429 responses.

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

Method reference

All methods are on Tomba, the value returned by Tomba::init, and return Result<TombaResponse, TombaError>. Request bodies are &serde_json::Value.

MethodEndpoint
account()GET /me
usage()GET /usage
logs(page: Option<u32>, limit: Option<u32>)GET /logs
domain_search(domain: &str, enrich_mobile: Option<bool>, webhook_url: Option<&str>)GET /domain-search
email_finder(domain: &str, first_name: &str, last_name: &str, webhook_url: Option<&str>)GET /email-finder
author_finder(url: &str, webhook_url: Option<&str>)GET /author-finder
linkedin_finder(url: &str, enrich_mobile: Option<bool>, full: Option<bool>, webhook_url: Option<&str>)GET /linkedin
email_format(domain: &str)GET /email-format
count(domain: &str)GET /email-count
email_verifier(email: &str, webhook_url: Option<&str>, enrich_mobile: Option<bool>)GET /email-verifier
email_sources(email: &str)GET /email-sources
phone_finder(email: &str, webhook_url: Option<&str>)GET /phone-finder
phone_validator(phone: &str)GET /phone-validator
status(domain: &str)GET /domain-status
autocomplete(query: &str)GET /domain-suggestions
similar_domains(domain: &str)GET /similar
list_keys()GET /keys
get_key(id: &str)GET /keys/{id}
create_key(body: &Value)POST /keys
delete_key(id: &str)DELETE /keys/{id}
list_leads(domain: Option<&str>)GET /leads
get_lead(id: &str)GET /leads/{id}
create_lead(body: &Value)POST /leads
update_lead(id: &str, body: &Value)PUT /leads/{id}
delete_lead(id: &str)DELETE /leads/{id}
list_leads_lists()GET /leads_lists
get_leads_list(id: &str)GET /leads_lists/{id}
create_leads_list(body: &Value)POST /leads_lists
update_leads_list(id: &str, body: &Value)PUT /leads_lists/{id}
delete_leads_list(id: &str)DELETE /leads_lists/{id}
list_bulk(bulk_type: &str)GET /bulk/{type}
create_bulk(bulk_type: &str, body: &Value)POST /bulk/{type}
get_bulk(bulk_type: &str, id: &str)GET /bulk/{type}/{id}
launch_bulk(bulk_type: &str, id: &str)PUT /bulk/{type}/{id}
bulk_progress(bulk_type: &str, id: &str)GET /bulk/{type}/{id}/progress
rename_bulk(bulk_type: &str, id: &str, name: &str)PUT /bulk/{type}/{id}/rename
archive_bulk(bulk_type: &str, id: &str)DELETE /bulk/{type}/{id}/archive
delete_bulk(bulk_type: &str, id: &str)DELETE /bulk/{type}/{id}/delete

bulk_type is the {type} segment listed in Bulk types; the order of calls is described in Lifecycle. create_bulk sends a JSON body, so it can't create jobs that need a CSV upload, such as email finder jobs.

Source

github.com/tomba-io/rust (Apache-2.0).

Last modified on September 30, 2026
Ruby SDKInstallation
On this page
  • Requirements
  • Install
  • Authenticate
  • First request
  • Errors
  • Rate limits and retries
  • Method reference
  • Source
Rust
Rust