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

Ruby SDK

The tomba gem is the official Ruby client for the Tomba API. Each API area is a service class in the Tomba module, and each method sends one request.

Requirements

Ruby 2.5 or later, as declared in the gemspec. The gem uses only the standard library.

Install

TerminalCode
gem install tomba

Or add gem 'tomba' to your Gemfile.

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 set_key and set_secret, 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
require 'tomba' client = Tomba::Client.new client.set_key(ENV.fetch('TOMBA_API_KEY')).set_secret(ENV.fetch('TOMBA_SECRET_KEY')) finder = Tomba::Finder.new(client) result = finder.email_finder(domain: 'stripe.com', first_name: 'Jane', last_name: 'Doe') puts result['data']['data']['email']

Every method returns a hash with two keys: 'data', the parsed 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 raises Tomba::Exception when the API responds with status 400 or higher, when the body isn't JSON, when the connection fails, and before sending a request when a required argument is nil.

AttributeValue
codeThe status from the error body's errors.code, which matches the HTTP status. nil when no response was received.
messageThe API's errors.message.
responseThe parsed error body, { 'errors' => { 'type' => …, 'message' => …, 'code' => … } }, or nil.
Code
require 'tomba' client = Tomba::Client.new client.set_key(ENV.fetch('TOMBA_API_KEY')).set_secret(ENV.fetch('TOMBA_SECRET_KEY')) begin finder = Tomba::Finder.new(client) result = finder.email_finder(domain: 'stripe.com', first_name: 'Jane', last_name: 'Doe') puts result['data']['data']['email'] rescue Tomba::Exception => e puts "#{e.code} #{e.message}" puts e.response['errors']['type'] if e.response end

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 nil.

A 429 raises Tomba::Exception with code 429, without the response headers. Wait before retrying as described in Handle 429 responses.

Connections and reads time out after 120 seconds; the timeouts aren't configurable.

Method reference

Create each service with the client, for example Tomba::Finder.new(client). Arguments shown as name: are keyword arguments.

MethodEndpoint
Account#get_accountGET /me
Usage#get_usageGET /usage
Logs#get_logs(page: nil, limit: nil)GET /logs
Domain#domain_search(domain:, page: nil, limit: nil, department: nil, enrich_mobile: nil, webhook_url: nil)GET /domain-search
Finder#email_finder(domain:, first_name:, last_name:, webhook_url: nil)GET /email-finder
Finder#author_finder(url:, webhook_url: nil)GET /author-finder
Format#email_format(domain)GET /email-format
Location#get_location(domain)GET /location
Count#email_count(domain:)GET /email-count
Verifier#email_verifier(email:, webhook_url: nil)GET /email-verifier
Sources#email_sources(email:)GET /email-sources
Finder#phone_finder(email:, webhook_url: nil)GET /phone-finder
Phone#finder(params, webhook_url: nil)GET /phone-finder
Phone#validator(phone, country_code: nil)GET /phone-validator
Status#domain_status(domain:)GET /domain-status
Status#auto_complete(query:)GET /domain-suggestions
Similar#websites(domain)GET /similar
Technology#list(domain)GET /technology
Keys#get_keysGET /keys
Keys#get_key(id:)GET /keys/{id}
Keys#create_keyPOST /keys
Keys#reset_key(id:)PUT /keys/{id}
Keys#delete_key(id:)DELETE /keys/{id}
Leads#list_leads(page: nil, limit: nil, domain: nil)GET /leads
Leads#get_lead(id)GET /leads/{id}
Leads#create_lead(**data)POST /leads
Leads#update_lead(id, **data)PUT /leads/{id}
Leads#delete_lead(id)DELETE /leads/{id}
LeadsLists#get_listsGET /leads_lists
LeadsLists#delete_list_id(id:)DELETE /leads_lists/{id}
Bulk#list(type, params: {})GET /bulk/{type}
Bulk#create(type, data)POST /bulk/{type}
Bulk#get(type, id)GET /bulk/{type}/{id}
Bulk#progress(type, id)GET /bulk/{type}/{id}/progress
Bulk#rename(type, id, name)PUT /bulk/{type}/{id}/rename

type is the {type} segment listed in Bulk types. Bulk#create 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/ruby (Apache-2.0). Release notes are in CHANGES.

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