# Dun & Bradstreet Company Data Scraper (`scrapyx/dnb-companies-scraper`) Actor

Extracts company firmographics from the Dun & Bradstreet business directory: search by name, browse any NAICS industry by country, state and city, or pull full profiles with revenue, employees, key principals and corporate family. 120M+ businesses worldwide. HTTP-only, no login.

- **URL**: https://apify.com/scrapyx/dnb-companies-scraper.md
- **Developed by:** [Ibnu Adzim](https://apify.com/scrapyx) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Dun & Bradstreet Company Data Scraper

Extract company firmographics from the Dun & Bradstreet business directory — company names, addresses, D‑U‑N‑S numbers, revenue, industry classification, key principals and corporate structure — for over 120 million businesses worldwide.

### Why use this actor

- **No account, no login, no API key.** D\&B's commercial data products start in the thousands per seat; this reads the free public directory.
- **Real D‑U‑N‑S numbers.** Full profiles return the actual 9‑digit D‑U‑N‑S identifier, the standard key for joining business data across systems.
- **Five ways in, one output format.** Search by company name, browse an entire industry, drill into a state or city, pull complete profiles, or dump the industry taxonomy.
- **Global coverage.** United States (1.15M retail companies alone), India (5.8M), Brazil (2.8M), Japan, Germany, France, UK, Canada, Australia, Indonesia, Singapore and more.
- **Honest about what's withheld.** D\&B paywalls some fields per company. Those come back as `null` with a `maskedFieldCount` telling you exactly how many were held back — never as filler text that looks like real data.
- **Stable JSON** suitable for spreadsheets, CRMs, databases and enrichment pipelines. Export to JSON, CSV or Excel. Automatic retries; runs on Apify's schedule.

### How it works

1. Pick a **mode** — search by name, browse by industry, fetch full profiles, get industry research, or list the industry taxonomy.
2. Fill in what that mode needs: company names, an industry path, or profile URLs.
3. Optionally narrow by country, state/region and city, or by employee-count range.
4. The actor collects every matching company, following pagination automatically and de‑duplicating as it goes.
5. Results land in the dataset, one row per company, ready to export.

No scrapers, browsers or blocks to babysit.

***

### Modes

| Mode | What it does | Needs |
|---|---|---|
| `search` | Find companies by name | `companyNames` |
| `industry` | Browse every company in an industry | `industryPaths` |
| `profile` | Full firmographic record for specific companies | `companyUrls` |
| `industryAnalysis` | Industry research: description, activities, top companies, geography | `industryPaths` |
| `taxonomy` | List all 327 industry paths with NAICS codes | — |

**Start with `taxonomy`** if you plan to use `industry` or `industryAnalysis` — it gives you every valid industry path in one run.

***

### Input

#### Search companies by name

```json
{
  "mode": "search",
  "companyNames": ["apple"],
  "country": "us",
  "minEmployees": 1000,
  "maxEmployees": 100000,
  "maxItems": 100,
  "enrichWithProfile": false
}
```

#### Browse an industry, narrowed to a city

```json
{
  "mode": "industry",
  "industryPaths": ["retail_trade"],
  "country": "us",
  "regionName": "california",
  "cityName": "los_angeles",
  "maxItems": 500
}
```

#### Full profiles for specific companies

```json
{
  "mode": "profile",
  "companyUrls": [
    "https://www.dnb.com/business-directory/company-profiles.apple_inc.ec7f550b3a97b94d919d837672573959.html"
  ]
}
```

| Field | Type | Description |
|---|---|---|
| `mode` | string | `search`, `industry`, `profile`, `industryAnalysis` or `taxonomy` |
| `companyNames` | array | Company names to search for (mode `search`) |
| `industryPaths` | array | Industry paths such as `retail_trade` (modes `industry`, `industryAnalysis`) |
| `companyUrls` | array | Profile URLs or bare selectors (mode `profile`) |
| `country` | string | Two-letter country code: `us`, `gb`, `de`, `in`, `br`, `id` … |
| `regionName` | string | State/region slug, e.g. `california` |
| `cityName` | string | City slug, e.g. `los_angeles`. Works with or without a region |
| `minEmployees` / `maxEmployees` | integer | Employee-count range (mode `search`) |
| `enrichWithProfile` | boolean | Also fetch each company's full profile. One extra request per company |
| `maxItems` | integer | Cap per input. `0` = no cap |
| `pageSize` | integer | Results per request, max 50 |
| `maxConcurrency` | integer | Requests in flight, default 4 |
| `minRequestInterval` | integer | Minimum seconds between requests |
| `proxyConfiguration` | object | Apify Proxy settings. Residential recommended |

***

### Output

Every row carries `_input`, `_source`, `_scrapedAt` and a `recordType` telling you what it is: `COMPANY`, `COMPANY_PROFILE`, `INDUSTRY`, `SEARCH_SUMMARY` or `ERROR`. Each query also emits one `SEARCH_SUMMARY` row with the total D\&B reports, so you always know how much exists versus how much you retrieved.

#### `search` — a `COMPANY` row

```json
{
  "_input": "search:apple",
  "_source": "S1-bd-api",
  "_scrapedAt": "2026-08-21T10:05:28Z",
  "recordType": "COMPANY",
  "companyAddress": "1 Apple Park Way",
  "companyCity": "Cupertino",
  "companyCountry": "United States",
  "companyProfileLink": "/business-directory/company-profiles.apple_inc.ec7f550b3a97b94d919d837672573959",
  "companyRegion": "California",
  "companyZipCode": "95014-0642",
  "countryRegion": "Cupertino, CA, United States",
  "duns": "ec7f550b3a97b94d919d837672573959",
  "industryName": "Communications Equipment Manufacturing",
  "locationType": "Parent",
  "primaryName": "Apple Inc.",
  "tradeStyleNames": "Apple",
  "urlSelector": "apple_inc.ec7f550b3a97b94d919d837672573959",
  "companySelector": "apple_inc.ec7f550b3a97b94d919d837672573959",
  "companyUrlBuilt": "https://www.dnb.com/business-directory/company-profiles.apple_inc.ec7f550b3a97b94d919d837672573959.html",
  "searchRank": 1,
  "maskedFieldCount": 0,
  "countryQueried": "us",
  "companyNameQueried": "apple"
}
```

#### `industry` — a `COMPANY` row

```json
{
  "_input": "industry:retail_trade",
  "_source": "S1-bd-api",
  "_scrapedAt": "2026-08-21T10:05:38Z",
  "recordType": "COMPANY",
  "duns": "1d6aec28aff542b40d3c2193a9a258f4",
  "primaryName": "Amazon.com, Inc.",
  "primaryNameForUrl": "amazoncom_inc",
  "primaryAddress": {
    "addressCountry": { "isoAlpha2Code": "US", "countryName": "United States" },
    "addressLocality": { "name": "Seattle" },
    "addressRegion": { "name": "Washington", "abbreviatedName": "WA" },
    "postalCode": "98109-5210",
    "streetAddress": { "line1": "410 Terry Ave N" }
  },
  "addressLocalityNameFormatted": "Seattle",
  "addressRegionNameFormatted": "Washington",
  "addressCountryName": "United States",
  "salesRevenue": "716,924",
  "companyNameUrl": "amazoncom_inc.1d6aec28aff542b40d3c2193a9a258f4",
  "companyUrlBuilt": "https://www.dnb.com/business-directory/company-profiles.amazoncom_inc.1d6aec28aff542b40d3c2193a9a258f4.html",
  "searchRank": 1,
  "industryPathQueried": "retail_trade"
}
```

#### `profile` — a `COMPANY_PROFILE` row

Key fields lifted to the top level for spreadsheets; the complete nested record (overview, financials, corporate family, competitors, similar companies, breadcrumb) is kept alongside them.

```json
{
  "_input": "profile:apple_inc.ec7f550b3a97b94d919d837672573959",
  "recordType": "COMPANY_PROFILE",
  "companyNameResolved": "Apple Inc.",
  "dunsNumber": "060704780",
  "directoryKey": "ec7f550b3a97b94d919d837672573959",
  "websiteResolved": "www.apple.com",
  "revenueFormatted": "$416.16 billion",
  "keyPrincipalResolved": "Timothy D Cook",
  "companyLocationResolved": "1 Apple Park Way Cupertino, CA, 95014-0642 United States",
  "stockExchangeResolved": "NASDAQ:AAPL",
  "maskedFieldCount": 58,
  "overview": {
    "tradeStyleName": "Apple",
    "parentIndustryName": "Manufacturing",
    "industries": {
      "Communications Equipment Manufacturing": "communications_equipment_manufacturing",
      "Computer and Peripheral Equipment Manufacturing": "computer_and_peripheral_equipment_manufacturing"
    }
  },
  "financials": {
    "annualIncomes": [
      { "year": "2025", "revenue": 416161.0, "revenueAccuracy": "Actual" }
    ]
  },
  "companyLinkage": { "totalPrincipals": 13, "totalContacts": "50,061" }
}
```

#### `taxonomy` — an `INDUSTRY` row

```json
{
  "_input": "taxonomy",
  "recordType": "INDUSTRY",
  "sectorName": "Mining, Quarrying, and Oil and Gas Extraction",
  "industryTitle": "Mining, Quarrying, and Oil and Gas Extraction",
  "industryPath": "mining_quarrying_and_oil_and_gas_extraction",
  "naicsCode": "21",
  "industryUrl": "/business-directory/industry-analysis.mining_quarrying_and_oil_and_gas_extraction.html"
}
```

#### `SEARCH_SUMMARY` — one per query

```json
{
  "recordType": "SEARCH_SUMMARY",
  "mode": "search",
  "totalMatches": 20195,
  "returnedCount": 2,
  "requestsMade": 1,
  "resultWindowReached": false,
  "notes": "D&B reports 20195 matching companies but its directory only pages through 1000 per query; split the work by country or employee-count band to reach the rest",
  "companyNameQueried": "apple"
}
```

| Field | Type | Description |
|---|---|---|
| `primaryName` | string | Company name |
| `duns` | string | D\&B's directory key for the company |
| `dunsNumber` | string | The real 9-digit D‑U‑N‑S number (profile rows only) |
| `companyUrlBuilt` | string | Direct link to the company's D\&B profile page |
| `industryName` | string | Industry classification |
| `locationType` | string | `Parent`, `Subsidiary`, `Branch`, `Single Location` |
| `salesRevenue` / `revenueFormatted` | string | Annual revenue where published |
| `keyPrincipalResolved` | string | Named executive (profile rows) |
| `stockExchangeResolved` | string | Ticker where listed |
| `maskedFieldCount` | integer | How many fields D\&B withheld for this company |
| `totalMatches` | integer | How many companies D\&B says match your query |
| `resultWindowReached` | boolean | Whether the per-query row limit was hit |

***

### Notes and limits

- **About 1,000 companies per query.** D\&B's directory stops paging at roughly 1,000 rows regardless of how many matches it reports. To collect more of a large industry, split the work — run it per state, or per city, or per employee-count band. Every `SEARCH_SUMMARY` row tells you `totalMatches` versus `returnedCount` so you can see when this applies.
- **Some fields are withheld per company.** D\&B publishes different amounts for different businesses; detailed financials in particular are usually held back for large public companies. Withheld fields are `null`, and `maskedFieldCount` reports how many there were. Revenue, key principal, website, address and industry are the most reliably present.
- **`enrichWithProfile` costs one request per company.** Leave it off for large listing runs and turn it on for shortlists.
- **Use Residential proxy** on the platform for the most reliable results.
- **Contact/people data is not collected.** This actor returns company information only.
- Last verified against the live site: **2026‑08‑21**.

# Actor input Schema

## `mode` (type: `string`):

What to collect. 'search' finds companies by name. 'industry' browses every company in a NAICS industry (optionally narrowed to a state and city). 'profile' pulls the full firmographic record for specific companies. 'industryAnalysis' returns industry research. 'taxonomy' lists every valid industry path — run this first to discover the values the other modes need.

## `companyNames` (type: `array`):

Company names to search for, one per row. Used by mode 'search'. Each name is queried independently and produces its own summary row.

## `industryPaths` (type: `array`):

NAICS industry paths such as 'retail\_trade' or 'oil\_and\_gas\_extraction'. Used by modes 'industry' and 'industryAnalysis'. Run the actor once in mode 'taxonomy' to list every valid value with its NAICS code.

## `companyUrls` (type: `array`):

Used by mode 'profile'. Accepts a full D\&B profile URL (https://www.dnb.com/business-directory/company-profiles.apple\_inc.ec7f550b3a97b94d919d837672573959.html) or just the bare selector after 'company-profiles.'.

## `country` (type: `string`):

Two-letter country code, e.g. 'us', 'gb', 'de', 'in', 'br', 'id'. Defaults to 'us' for industry browsing. D\&B returns zero rows for a code it does not carry rather than an error, so a typo looks like an empty result.

## `regionName` (type: `string`):

Optional state or region slug for mode 'industry', e.g. 'california' or 'new\_york'. Read valid values from the companyInformationGeos hrefs in a broader run's output.

## `cityName` (type: `string`):

Optional city slug for mode 'industry', e.g. 'los\_angeles'. Works on its own or combined with a state/region — both narrow to the same result set.

## `minEmployees` (type: `integer`):

Lower bound on employee count for mode 'search'. Verified to move the match count (an 'apple' search drops from 20,195 to 34 with a 1,000-100,000 range).

## `maxEmployees` (type: `integer`):

Upper bound on employee count for mode 'search'.

## `enrichWithProfile` (type: `boolean`):

For modes 'search' and 'industry': fetch each company's complete firmographic profile (revenue, employees, key principal, financial history, corporate family, competitors). Costs one extra request per company, so leave it off for large listing runs.

## `maxItems` (type: `integer`):

Stop after this many companies per input. Set 0 for no cap. Note that D\&B itself only pages through about 1,000 companies per query however high this is set.

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

Results per request for mode 'search'. Maximum 50 — D\&B returns zero rows for anything larger. Does not apply to mode 'industry', where the page size is fixed at 50 server-side.

## `language` (type: `string`):

Language for D\&B's own labels and descriptions, e.g. 'en' or 'de'. Does not change which companies match.

## `maxConcurrency` (type: `integer`):

Upper bound on requests in flight across all queries. Pagination within one query is always sequential because the stop condition depends on the previous page.

## `minRequestInterval` (type: `integer`):

Paces how often a request may START, without occupying a concurrency slot. This, not maxConcurrency, is the honest speed control once the rate cap binds. Raise it if Cloudflare starts challenging.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings. Residential is the default on the platform: the API is fronted by Cloudflare, and a datacenter exit raises the challenge rate. Local runs go direct unless this is set.

## Actor input object example

```json
{
  "mode": "search",
  "companyNames": [
    "apple"
  ],
  "industryPaths": [
    "retail_trade"
  ],
  "companyUrls": [
    "https://www.dnb.com/business-directory/company-profiles.apple_inc.ec7f550b3a97b94d919d837672573959.html"
  ],
  "country": "us",
  "regionName": "california",
  "cityName": "los_angeles",
  "enrichWithProfile": false,
  "maxItems": 100,
  "pageSize": 50,
  "language": "en",
  "maxConcurrency": 4,
  "minRequestInterval": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `items` (type: `string`):

One row per scraped record. See the dataset's default view for field definitions.

# 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 = {
    "companyNames": [
        "apple"
    ],
    "industryPaths": [
        "retail_trade"
    ],
    "companyUrls": [
        "https://www.dnb.com/business-directory/company-profiles.apple_inc.ec7f550b3a97b94d919d837672573959.html"
    ],
    "country": "us",
    "regionName": "california",
    "cityName": "los_angeles",
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapyx/dnb-companies-scraper").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 = {
    "companyNames": ["apple"],
    "industryPaths": ["retail_trade"],
    "companyUrls": ["https://www.dnb.com/business-directory/company-profiles.apple_inc.ec7f550b3a97b94d919d837672573959.html"],
    "country": "us",
    "regionName": "california",
    "cityName": "los_angeles",
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapyx/dnb-companies-scraper").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 '{
  "companyNames": [
    "apple"
  ],
  "industryPaths": [
    "retail_trade"
  ],
  "companyUrls": [
    "https://www.dnb.com/business-directory/company-profiles.apple_inc.ec7f550b3a97b94d919d837672573959.html"
  ],
  "country": "us",
  "regionName": "california",
  "cityName": "los_angeles",
  "language": "en"
}' |
apify call scrapyx/dnb-companies-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapyx/dnb-companies-scraper"
        }
    }
}

```

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/Qub7TSX086IYfv62x/builds/b8ZZt9NivlgBeDOej/openapi.json
