# B2B Company Data API - Search Companies and Contacts (`nabeelbaghoor/b2b-company-contact-api`) Actor

Search a B2B database of companies and contacts by name, domain, country, city, geo radius, industry code, employee band, revenue and data completeness, and resolve IP addresses to companies. Returns firmographics, contacts and job titles as flat rows. Pay per result. Bring your own API key.

- **URL**: https://apify.com/nabeelbaghoor/b2b-company-contact-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Business, Developer tools, Lead generation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$12.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## B2B Company Data API - Search Companies and Contacts

Search a B2B database of companies and the people who work at them, and resolve IP addresses to the companies behind them. Every match comes back as a flat row: company name, domain, logo, full address with coordinates, industries, employee band, revenue and register details, or for contacts the full name, job title, department, seniority, email and company.

### What this actor does

- **Searches companies** by name, alternative name, trade name or domain, by country, city, postal code, region code or street, by a geo radius around a point, by industry code, by employee band, by revenue range, or against your saved ideal customer profiles.
- **Filters on data completeness**, which is what separates a usable list from a long one: only companies with a phone, an email, a social profile, known revenue, earnings or net worth, or IP data.
- **Searches contacts** at those companies by name, job title phrase, department, seniority, affiliation, email or company ID, so a company list you already built becomes a people list.
- **Resolves IP addresses to companies** for visitor identification, when your account carries that subscription.
- **Respects how the provider charges.** Searches consume no provider credits; full company profiles do. Profile fetching is therefore opt-in, and every run reports the credits the provider says it charged.
- **Resolves your account automatically.** Leave the account ID empty and the actor asks the API which accounts your key reaches and uses it.

### Input

| Field | What it does |
| --- | --- |
| `dataset` | Companies, contacts, or IP to company. |
| `searchTerms` | Matched against company name, alternative names, trade name and domains. |
| `countryCodes`, `cities`, `postalCodes`, `regionCodes`, `street` | Address narrowing, paired in order rather than crossed. |
| `latitude`, `longitude`, `radiusKm` | Radius search around a point, capped at 500 km. |
| `industryClassification`, `industryCodes` | Industry codes plus the table they belong to. |
| `employeeRanges` | Fixed headcount bands. |
| `revenueMin`, `revenueMax` | Revenue range in euros. |
| `icpIds` | Match against saved ideal customer profiles, combined with OR. |
| `has_phone`, `has_email`, and the other presence flags | Data completeness filters. |
| `contactSearchTerms`, `positions`, `departments`, `hierarchyLevels`, `affiliation`, `contactEmails`, `companyIds`, `buyerPersonaIds` | Contact search criteria. |
| `ipAddresses` | Addresses to resolve to companies. |
| `fetchFullProfiles` | Merge each company's full profile into its row. Spends provider credits. |
| `advancedBody`, `advancedContactBody` | Raw search bodies for anything this form does not list. |
| `accountId`, `useBearerToken` | Account scoping and OAuth support. |
| `pageSize`, `maxResults` | Page size and the hard cap on spend. |
| `apiKey` | Your own API key, sent in the `X-Api-Key` header. Stored as a secret. |

### Example output

```json
{
  "recordType": "company",
  "matched": true,
  "id": "129011",
  "name": "Beispiel Logistik GmbH",
  "url": "https://www.example.de",
  "domain": "example.de",
  "logoUrl": "https://logos.example.com/example-de.png",
  "street": "Durlacher Allee 73",
  "postalCode": "76131",
  "city": "Karlsruhe",
  "regionCode": "DE1",
  "countryCode": "DE",
  "latitude": 49.01,
  "longitude": 8.43,
  "industries": ["Software", "Marketing services"],
  "employeeRange": "101-500",
  "revenueAmount": 42000000,
  "revenueCurrency": "EUR",
  "raw": { }
}
```

### Frequently asked questions

#### What data does this B2B company API return?

Company rows carry the provider company ID, name, website URL and bare domain, logo URL, street, postal code, city, region code and country code with latitude and longitude, the industry list, the employee band, revenue amount and currency, the company's role and its trade register ID and name. Contact rows carry the contact ID, full, first and last name, position, department, seniority level, affiliation, email, phone, LinkedIn URL, and the ID and name of the company they work at.

#### Do I need my own API key?

Yes. This actor does not include data access. You use your own API key from Dealfront, which is the provider whose API this actor calls, found under API tokens in your personal settings. Your own plan, credits and terms apply. Paste the key into the `apiKey` field, where it is stored as an Apify secret and sent in the `X-Api-Key` request header rather than as a URL parameter, so it never appears in a log line or a redirect. If you authenticate with an OAuth access token instead, turn on `useBearerToken`.

#### Do I have to look up my account ID?

No. Leave `accountId` empty and the actor lists the accounts your key reaches and uses the first one, logging which it picked. If your key reaches several accounts and you want a specific one, set the ID explicitly.

#### How do I filter by industry?

Pick the classification table first, then supply codes from that table. `internal` is the provider's own classification and the right default; `nace` and `wz` are there when you specifically need them. These fields take codes, not industry names, so look the codes up in the provider's published list for the classification you chose.

#### Why must employee ranges be written with a dot?

They are fixed band strings defined by the provider, and the provider writes thousands with a dot: `501-1.000`, not `501-1000`. The input offers them as a dropdown so you cannot mistype one, and any value outside the documented set is dropped rather than sent.

#### Does searching cost provider credits?

No. Searches consume no credits. Credits are spent when you retrieve deep data for a company not accessed in the last twelve months, which is why `fetchFullProfiles` is off by default. Every run logs the credit total the provider reported for the work it did.

#### How do I go from a company list to the people at those companies?

Run once with `dataset` set to companies and collect the rows. Then run again with `dataset` set to contacts and paste those company IDs into `companyIds`, optionally narrowing by `departments`, `hierarchyLevels` or `positions`.

#### Why did my IP enrichment run fail with access denied?

IP enrichment is a separate subscription. When the account does not have it, the provider returns HTTP 403 `access_denied` on every call and retrying will not help. The actor reports that as a final error rather than retrying. Ask your provider to enable the subscription, or use the company and contact searches instead.

#### How much does a run cost?

Pricing is pay per result: you are charged for each company or contact returned to the dataset. Duplicates and IP addresses that resolve to no company are not charged. Apify platform usage is included in the per-result price. Your own provider credits are separate and billed by them.

### Keyword map

B2B company data API, company search API, contact search API, firmographic data, IP to company API, website visitor identification, lead generation API, ICP company list, employee range filter, revenue filter, NACE industry search, company domain lookup, sales prospecting data, job title search API, decision maker contacts, European company data

# Actor input Schema

## `dataset` (type: `string`):

Search companies, search contacts at companies, or resolve a list of IP addresses to the companies behind them.

## `searchTerms` (type: `array`):

Terms matched against company name, alternative names, trade name and domains, one per line. A domain works here, which is how you resolve a domain list to company records.

## `countryCodes` (type: `array`):

ISO 3166 two letter country codes, one per line, for example DE or GB.

## `cities` (type: `array`):

City names, one per line. Cities and country codes are paired in order, so three cities and one country code means all three cities in that country.

## `postalCodes` (type: `array`):

Postal codes, one per line. Format varies by country.

## `regionCodes` (type: `array`):

Region codes, one per line. European regions use the NUTS 1 to 3 scheme, for example DE1. Regions outside Europe use ISO 3166-2 with underscores.

## `street` (type: `string`):

A full street line including house number, for example Durlacher Allee 73.

## `latitude` (type: `string`):

Latitude of a point to search around. Set longitude too, and a radius below.

## `longitude` (type: `string`):

Longitude of a point to search around.

## `radiusKm` (type: `integer`):

How far from the point to search. The provider's maximum is 500 km; anything larger is clamped.

## `industryClassification` (type: `string`):

Which classification table the industry codes below belong to. The provider's internal classification is the default and the one to use unless you specifically need NACE or WZ.

## `industryCodes` (type: `array`):

Industry codes from the classification selected above, one per line, for example 62.01 for NACE. These are codes, not names: look them up in the provider's published code list for the classification you chose.

## `employeeRanges` (type: `array`):

Headcount bands to include. These are fixed bands and must be written exactly as the provider defines them, with a dot as the thousands separator.

## `revenueMin` (type: `integer`):

Lowest annual revenue to include, in euros. Negative values are not supported.

## `revenueMax` (type: `integer`):

Highest annual revenue to include, in euros.

## `icpIds` (type: `array`):

IDs of saved ideal customer profiles, one per line. Companies matching any one of them are returned. Unknown IDs are ignored by the provider.

## `has_phone` (type: `boolean`):

Return only companies with at least one phone number.

## `has_email` (type: `boolean`):

Return only companies with at least one known email address.

## `has_social_media_profiles` (type: `boolean`):

Return only companies with at least one social media profile such as LinkedIn.

## `has_financials_revenue` (type: `boolean`):

Return only companies that have revenue data on record.

## `has_financials_earnings` (type: `boolean`):

Return only companies that have earnings data on record.

## `has_financials_net_worth` (type: `boolean`):

Return only companies that have net worth data on record.

## `has_ip_addresses` (type: `boolean`):

Return only companies that have IP address data, which is what makes visitor matching possible.

## `contactSearchTerms` (type: `array`):

Terms matched against contact full name and title, one per line. Used when collecting contacts.

## `positions` (type: `array`):

Job titles to match, one per line. Values are matched as phrases against both the original language title and its English translation, so Chief matches Chief Executive Officer. There is no typo tolerance and no synonym expansion: list every variant you want.

## `departments` (type: `array`):

Departments the contact works in.

## `hierarchyLevels` (type: `array`):

How senior the contact is within the company.

## `affiliation` (type: `string`):

How the contact is related to the company: a direct employee, an employee of the corporate group, or otherwise related.

## `contactEmails` (type: `array`):

Email addresses to look contacts up by, one per line.

## `companyIds` (type: `array`):

Provider company IDs whose contacts you want, one per line. This is how you go from a company list you already collected to the people at those companies.

## `buyerPersonaIds` (type: `array`):

IDs of saved buyer personas to filter contacts by, one per line.

## `ipAddresses` (type: `array`):

IPv4 or IPv6 addresses to resolve to companies, one per line. Write IPv6 in plain shortened notation without brackets. This needs an active IP enrichment subscription on your account.

## `fetchFullProfiles` (type: `boolean`):

After each search hit, also fetch that company's full profile and merge it into the row. Searches consume no provider credits, but full profiles do for companies not accessed recently, so this is off by default.

## `advancedBody` (type: `string`):

A raw company search body as JSON, merged over the fields above and winning on conflict. Use it for filters this form does not list. Example: {"filters":{"do\_not\_contact":false},"employee\_ranges":\["11-100"]}

## `advancedContactBody` (type: `string`):

A raw contact search body as JSON, merged over the contact fields above and winning on conflict.

## `accountId` (type: `string`):

Which account to run against. Leave empty and the actor asks the API which accounts your key reaches and uses the first one, which is what you want when the key sees only one account.

## `useBearerToken` (type: `boolean`):

Send the credential as an OAuth Authorization bearer header instead of the X-Api-Key header. Turn this on if you are using an OAuth access token rather than a personal API key.

## `pageSize` (type: `integer`):

Records per request. The provider's maximum is 100.

## `maxResults` (type: `integer`):

Stop after this many records. This is the cap on both spend and run time.

## `apiKey` (type: `string`):

Your own B2B company data API key, sent in the X-Api-Key header. The actor never ships a key of its own: your plan, credits and terms apply.

## Actor input object example

```json
{
  "dataset": "companies",
  "searchTerms": [
    "Microsoft"
  ],
  "radiusKm": 20,
  "industryClassification": "internal",
  "has_phone": false,
  "has_email": false,
  "has_social_media_profiles": false,
  "has_financials_revenue": false,
  "has_financials_earnings": false,
  "has_financials_net_worth": false,
  "has_ip_addresses": false,
  "fetchFullProfiles": false,
  "useBearerToken": false,
  "pageSize": 100,
  "maxResults": 100
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchTerms": [
        "Microsoft"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/b2b-company-contact-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "searchTerms": ["Microsoft"] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/b2b-company-contact-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchTerms": [
    "Microsoft"
  ]
}' |
apify call nabeelbaghoor/b2b-company-contact-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/b2b-company-contact-api"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/0a8q4UwWSAbQE46LY/builds/qdGJtGySchIIqdN21/openapi.json
