# Dun & Bradstreet Scraper - Companies, DUNS & Revenue (`haketa/dnb-scraper`) Actor

Dun & Bradstreet (D\&B) scraper & API: search the business directory and export company profile, DUNS number, revenue, employee count, industry, address, phone, website and key principals/executives. B2B lead generation, company firmographics and due diligence — fast, no login.

- **URL**: https://apify.com/haketa/dnb-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** Lead generation
- **Features:** Limited permissions
- **Stats:** 118 total users, 12 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Dun & Bradstreet Scraper 🌐 — Company Data, DUNS, Revenue & Firmographics

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-blue?logo=apify)](https://apify.com/haketa/dnb-scraper)
[![Coverage](https://img.shields.io/badge/Coverage-20%2B%20Countries-purple)]()
[![Scale](https://img.shields.io/badge/Scale-1%2C000%2B%20Companies-orange)]()
[![Firmographics](https://img.shields.io/badge/Data-DUNS%20%2B%20Revenue%20%2B%20Principals-success)]()
[![No Login](https://img.shields.io/badge/Auth-No%20Login%20Required-brightgreen)]()

**Extract company data from the [Dun & Bradstreet](https://www.dnb.com/) business directory (dnb.com) in minutes.** This **Dun & Bradstreet scraper** and **D\&B data extractor** turns any search term or industry keyword into a clean, structured database of companies — complete with **company name, full address, industry classification, DUNS identifier, annual revenue, key principal / executive, parent industry, employee band, and financial year** — ready for B2B lead generation, sales prospecting, market sizing, and CRM enrichment.

Export everything in bulk as **JSON, CSV, Excel (XLSX), XML, or via the Apify API** — no D\&B subscription, no manual copy-paste, and no coding required.

> 💡 **Built for:** B2B sales teams, lead-generation agencies, market researchers, RevOps & data-enrichment engineers, M\&A analysts, and founders who need reliable company firmographics and B2B prospecting data at scale.

***

### ⚡ At a glance

| Feature | Details |
|---|---|
| **Target directory** | [Dun & Bradstreet (dnb.com)](https://www.dnb.com) global business directory |
| **Search & discovery** | Search by any company name, industry keyword, or vertical (`queries`), or run empty for a 16-industry sample |
| **Country targeting** | 20 built-in country markets (`US`, `GB`, `CA`, `AU`, `IE`, `DE`, `FR`, `IT`, `ES`, `NL`, `BE`, `SE`, `CH`, `AT`, `IN`, `SG`, `HK`, `JP`, `MX`, `BR`) |
| **Core directory fields** | `companyName`, `duns`, `companyProfileUrl`, `urlSelector`, `address`, `city`, `region`, `zipCode`, `country`, `countryRegion`, `industryName`, `locationType` (`Parent` / `Branch`), `tradeStyleNames` |
| **Deep profile enrichment** | Optional `scrapeCompanyProfiles: true` adds `revenue`, `revenueValue`, `revenueCurrency`, `revenueYear`, `keyPrincipal`, `parentIndustryName`, `employees`, `phone`, `registeredDuns` (9-digit numeric DUNS), `totalPrincipals`, and `similarCompaniesCount` |
| **Pagination & 1,000+ scale** | Automatic 50-per-page traversal up to `1,000+` companies per search term with global DUNS deduplication (`0` duplicates) |
| **Export & integrations** | JSON, CSV, Excel, XML, RSS, Apify API, Google Sheets, HubSpot, Clay, Make, Zapier, n8n, Slack & webhooks |

***

### 🔎 Why scrape Dun & Bradstreet?

Dun & Bradstreet maintains one of the world's largest commercial databases — hundreds of millions of business records, each tied to a unique **D-U-N-S Number**. Its public business directory exposes company profiles with firmographics that are gold for B2B prospecting: industry classification, location, revenue, key decision-makers and corporate hierarchy.

But D\&B has no public bulk export, and its directory is a JavaScript app that's painful to copy by hand. This scraper automates the whole process: you give it search terms, it returns hundreds of clean company records you can filter, sort and import anywhere.

**Common reasons people scrape Dun & Bradstreet:**

- Build **targeted B2B lead and prospect lists** by industry and location
- Enrich a **CRM** with company firmographics (industry, address, revenue, DUNS)
- Run **market sizing / TAM analysis** for a sector or region
- Map **corporate hierarchies** (parent vs branch locations)
- Identify **key principals / decision-makers** for outreach
- Power **competitive and industry research**

***

### ✨ What this Dun & Bradstreet scraper does

- ✅ Searches the D\&B business directory by **any company name or keyword** (e.g. `software`, `logistics`, `Take-Two`)
- ✅ Returns **hundreds of companies per term** with automatic pagination (de-duplicated)
- ✅ Captures core firmographics — **company name, full address, city, region, ZIP, country, industry, DUNS, parent/branch type**
- ✅ Optional **deep profile mode** adds **revenue, key principal, parent industry, financial year, registered DUNS, number of principals, competitors and similar companies**
- ✅ **Country targeting** — search within US, GB, DE, FR, CA, AU and more
- ✅ Exports to **JSON, CSV, Excel, XML** and integrates with Google Sheets, Make, Zapier, Slack and your own apps
- ✅ **Fast and reliable** — runs against D\&B's own directory API, no fragile page rendering

***

### 🎯 Use cases

#### 1. B2B lead generation & sales prospecting

Build targeted prospect lists by searching an industry or keyword and filtering by location. Each company comes with its **industry, full address and profile link** — and with deep mode, **revenue and the key principal** to prioritize and personalize outreach.

#### 2. CRM & data enrichment

Already have company names? Search them and append fresh firmographics — **DUNS number, industry classification, address, revenue and parent industry** — to keep your CRM accurate and your segmentation sharp.

#### 3. Market sizing & TAM analysis

Pull every company in a sector and region to estimate market size, map the competitive landscape, and quantify your total addressable market with real firmographic data rather than guesswork.

#### 4. Corporate hierarchy mapping

The `locationType` field distinguishes **parent companies from branches**, so you can map multi-location enterprises and target the right entity for sales or research.

#### 5. Decision-maker identification

Deep profile mode surfaces the **key principal** and the number of principals on file, helping you find the right person to contact at each company.

#### 6. Competitive & industry intelligence

Combine industry classification, revenue and competitor signals to benchmark companies, track sectors and feed dashboards or analyst models.

#### 7. Risk, credit & supplier research

Firmographics tied to DUNS numbers are the backbone of vendor onboarding, KYB (know-your-business) and supplier due-diligence workflows.

***

### ⚙️ How it works

1. **Enter one or more search terms** — company names or keywords.
2. **Pick a country** and how many companies you want per term.
3. **Optionally enable deep profile mode** for revenue, principals and more.
4. **Run the Actor** — it collects, de-duplicates and structures the data, then makes it available for download or via API.

No login, no D\&B subscription, no captcha solving.

#### 🔬 Deep company profiles (optional)

Most directory scrapers stop at the search list. Enable **`scrapeCompanyProfiles`** and this Actor also visits each company's profile to pull:

- **Revenue** — formatted (e.g. `$6.66 B`) and as a number, with currency and fiscal year
- **Key principal** — the lead executive on file
- **Parent industry**, **registered (numeric) DUNS**, number of **principals**
- **Employee band** and **phone** — present for many US companies
- **Similar companies** signal

It's optional because it adds one request per company (slower, more compute). Where D\&B does not publicly expose a value (e.g. incorporation year for some records), the scraper returns clean `null` rather than garbage or placeholder characters.

***

### ✅ Proven results (fresh verification run)

A fresh run (2026-11) across three broad terms — `software`, `logistics`, `construction` (US) — collected **330 unique companies** with **zero duplicates** and **zero value bugs**. Core-field coverage on the listing output:

| Field | Fill rate |
| --- | --- |
| companyName, DUNS, companyProfileUrl | 100% |
| address, city, region, ZIP, country | 100% |
| industryName, locationType | 100% |
| tradeStyleNames (DBA — only when a company has one) | ~36% |

A separate deep-profile run (`scrapeCompanyProfiles: true`) returned **100%** coverage on `revenue`, `revenueValue`, `revenueCurrency`, `revenueYear`, `keyPrincipal`, `parentIndustryName`, `registeredDuns`, `totalPrincipals` and `similarCompaniesCount` — e.g. **Take-Two Interactive → `$6.66 B` (2026), Strauss Zelnick, DUNS 829681063**. Even when D\&B masks the formatted revenue string, the scraper recovers the **numeric revenue** and rebuilds a clean figure. Many US companies now also return `employees` (e.g. `10,000+`) and `phone`; where D\&B does not expose a field, the scraper returns clean `null` rather than placeholder text.

### ⭐ What makes this scraper stand out

- **Deep firmographics, not just listings.** Revenue, key principal, parent industry and DUNS — the fields that actually qualify a B2B account.
- **Clean revenue every time.** When D\&B hides the formatted figure, we reconstruct it from the underlying number.
- **No garbage values.** Gated fields become `null`, so your spreadsheet stays tidy.
- **Country targeting + de-duplication** built in for focused, clean prospect lists.

### 🔎 Popular searches & industries

You can search any keyword or company name. Popular B2B sourcing and prospecting examples include:

- **Technology** — software, SaaS, IT services, cybersecurity, semiconductors
- **Industrial** — manufacturing, machinery, automotive, aerospace
- **Logistics** — freight, warehousing, supply chain, distribution
- **Energy** — renewable energy, oil and gas, utilities
- **Healthcare** — medical devices, pharmaceuticals, biotech
- **Finance** — fintech, insurance, investment firms
- **Consumer** — retail, food and beverage, apparel

Pair any term with a `country` code to focus the search on a single market.

### 🔧 Input parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `queries` | array | No | Company names or keywords to search (e.g. `software`, `logistics`). Leave empty to get a ready-made sample across popular industries. |
| `country` | string | No | Two-letter country code (US, GB, DE, FR, CA, AU…). Default `US`. |
| `maxItemsPerQuery` | integer | No | Max companies to collect per term. Paginated automatically. Default `50`. |
| `scrapeCompanyProfiles` | boolean | No | Visit each company's profile for revenue, key principal, financials and more. Richer but slower. Default `false`. |
| `proxyConfiguration` | object | No | Apify Proxy settings. US proxy recommended (D\&B is geo-aware). |

#### Example input — quick company list

```json
{
    "queries": ["software"],
    "country": "US",
    "maxItemsPerQuery": 200
}
```

#### Example input — deep firmographics

```json
{
    "queries": ["logistics", "renewable energy"],
    "country": "US",
    "maxItemsPerQuery": 100,
    "scrapeCompanyProfiles": true
}
```

#### Example input — search within another country

```json
{
    "queries": ["automotive"],
    "country": "DE",
    "maxItemsPerQuery": 150
}
```

***

### 📤 Output

The Actor stores one row per company. Data can be downloaded as **JSON, CSV, Excel, XML** or pulled via the Apify API.

#### Sample output record (with deep profile)

```json
{
    "companyName": "Take-Two Interactive Software, Inc.",
    "duns": "2d66458a75c9d054a6e33addf02f1573",
    "companyProfileUrl": "https://www.dnb.com/business-directory/company-profiles/take-two-interactive-software-inc.2d66458a75c9d054a6e33addf02f1573",
    "urlSelector": "take-two-interactive-software-inc.2d66458a75c9d054a6e33addf02f1573",
    "address": "110 W 44TH St",
    "city": "New York",
    "region": "New York",
    "zipCode": "10036-4011",
    "country": "United States",
    "countryRegion": "New York, NY, United States",
    "industryName": "Computer Systems Design and Related Services",
    "locationType": "Parent",
    "tradeStyleNames": null,
    "revenue": "$6.66 B",
    "revenueValue": 6656400000,
    "revenueCurrency": "USD",
    "revenueYear": "2026",
    "keyPrincipal": "Strauss Zelnick",
    "parentIndustryName": "Professional, Scientific, and Technical Services",
    "employees": "10,000+",
    "phone": "(646) 536-2842",
    "registeredDuns": "829681063",
    "totalPrincipals": "4",
    "similarCompaniesCount": 9,
    "searchTerm": "software",
    "scrapedAt": "2026-11-02T00:48:29.439Z"
}
```

> The top block of fields (companyName → scrapedAt) is returned on **every** run. The `revenue`, `keyPrincipal`, `employees`, `phone`, `registeredDuns`, `totalPrincipals` and related fields appear only when **`scrapeCompanyProfiles`** is enabled (one extra request per company).

#### Output fields reference

**Core company fields (always present)**

| Field | Description |
| --- | --- |
| `companyName` | Company primary name |
| `duns` | D\&B directory identifier for the company |
| `companyProfileUrl` | Full link to the company's D\&B profile |
| `urlSelector` | The profile slug + id used to build the URL |
| `address` / `city` / `region` / `zipCode` / `country` | Full location |
| `countryRegion` | Combined region string (e.g. `New York, NY, United States`) |
| `industryName` | Industry classification |
| `locationType` | `Parent`, `Subsidiary` or `Independent` location |
| `tradeStyleNames` | Trade/DBA names (present when the company has one) |
| `searchTerm` | The term this record came from |
| `scrapedAt` | ISO timestamp of extraction |

**Deep profile fields** (only when `scrapeCompanyProfiles` is enabled)

| Field | Description |
| --- | --- |
| `revenue` | Formatted revenue, e.g. `$6.66 B` |
| `revenueValue` | Revenue as a number (e.g. `6656400000`) |
| `revenueCurrency` | Revenue currency (e.g. `USD`) |
| `revenueYear` | Fiscal year of the revenue figure |
| `keyPrincipal` | Lead executive on file |
| `parentIndustryName` | Higher-level industry |
| `registeredDuns` | Registered (numeric) DUNS number |
| `totalPrincipals` | Number of principals on file |
| `similarCompaniesCount` | Count of close industry peers |
| `employees` | Employee band (e.g. `10,000+`, `1,000-9,999`) — present when available |
| `phone` | Company phone — present when available |
| `incorporatedYear` / `competitorsIndustry` | Returned when D\&B exposes them publicly (otherwise `null`) |

***

### 🔁 Pagination & scale

This **Dun & Bradstreet scraper** paginates the directory automatically — you never touch a page number. Each search term is fetched page by page (`pagesize` 50) against the D\&B business-directory API, and the Actor keeps requesting the next page until it has reached your `maxItemsPerQuery` target or the directory runs out of results for that term. It walks up to hundreds of pages per term, so broad keywords can yield **hundreds to thousands of companies**.

- **Automatic page walking** — the `pagenumber` cursor advances until the result set is exhausted or your cap is hit.
- **Per-term and global de-duplication** — companies are keyed by **DUNS / profile identifier**, so overlapping terms never create duplicate rows.
- **Scale controls** — `maxItemsPerQuery` (1–10,000) caps each term; add multiple `queries` to build a large combined list in one run.
- **Clean termination** — the crawler stops as soon as a page comes back empty, so you don't pay for wasted requests.

Run several related keywords (e.g. `software`, `SaaS`, `IT services`) with a country filter and a higher `maxItemsPerQuery` to assemble a large, de-duplicated prospect list in a single pass.

***

### 🌍 Country coverage

Dun & Bradstreet's directory is global. Set the `country` parameter to focus your search, for example:

- **US** — United States (richest coverage)
- **GB** — United Kingdom
- **DE** — Germany
- **FR** — France
- **CA** — Canada
- **AU** — Australia

…and many more two-letter ISO country codes. US has the deepest data, including the most complete revenue and principal coverage.

***

### 🔌 Integrations

Send your Dun & Bradstreet data anywhere with Apify's built-in integrations and webhooks:

- **Google Sheets** — push company lists straight into a spreadsheet
- **Make (Integromat) & Zapier** — trigger workflows on every run
- **Slack / email** — get notified when new data is ready
- **CRMs & databases** — via API, webhooks or no-code connectors
- **Your own app** — pull results through the Apify API in JSON

***

### ▶️ How to use this Dun & Bradstreet scraper (step by step)

1. Click **Try for free** at the top of this page.
2. In the **Input** tab, add your search terms under `queries`.
3. Set the `country` and `maxItemsPerQuery`, and enable `scrapeCompanyProfiles` if you need revenue and principals.
4. Click **Start** and wait for the run to finish.
5. Open the **Output / Dataset** tab and download your data as **JSON, CSV or Excel**, or copy the API endpoint to pull it programmatically.

You can also **schedule** the Actor to run daily/weekly to keep your company data fresh.

***

### ❓ Frequently asked questions

**Does it include the numeric DUNS number?**
The search result includes a directory identifier, and deep profile mode adds the `registeredDuns` (numeric) when D\&B exposes it publicly.

**Does it include revenue?**
Yes — enable `scrapeCompanyProfiles` and most US companies return a formatted revenue (e.g. `$5.63 billion`) plus a numeric value, currency and fiscal year.

**Do I get employee count and phone?**
For many US companies, deep-profile mode returns an **employee band** (e.g. `10,000+`, `1,000-9,999`) and a **phone** number. A few fields (such as incorporation year for some records) are not always exposed by D\&B — the scraper detects those and returns clean `null` instead of placeholder text, so your data stays tidy.

**Can I search outside the US?**
Yes — set the `country` parameter to any supported ISO code (GB, DE, FR, CA, AU…). US has the most complete coverage.

**How many companies can I get?**
Results are paginated automatically; set `maxItemsPerQuery` to your target. Broad terms can return many hundreds of companies.

**What export formats are supported?**
JSON, CSV, Excel (XLSX), XML and RSS — plus direct API access.

**Will I get duplicate companies?**
No. Results are de-duplicated within a run, so overlapping search terms won't create duplicate rows.

**How much does it cost to run?**
You only pay for the results you collect. Listing runs fetch 50 companies per page, making large 1,000+ company runs fast and economical.

**Can I search by company name to find one specific company?**
Yes. Put the exact company name in `queries` (e.g. `Take-Two`) and the directory returns matching companies; enable `scrapeCompanyProfiles` to get full firmographics for each match.

**Does it return the parent company or the branches?**
Both — each record's `locationType` tells you whether it's a `Parent` or a branch location, so you can target the headquarters or map all sites of an enterprise.

**How fresh is the data?**
Every run queries D\&B's directory live, so firmographics reflect what's published at the time you run it. Schedule recurring runs to keep your database current.

**Can I push results straight into my CRM or Google Sheet?**
Yes — use Apify's native integrations (Google Sheets, HubSpot, Make, Zapier) or webhooks to send each run's results wherever you need them, automatically.

**What's the best way to build a large prospect list?**
Use several related keywords (e.g. `software`, `SaaS`, `IT services`) with a country filter and a higher `maxItemsPerQuery`. De-duplication keeps the combined list clean.

***

### 💡 Tips & best practices

- **Use focused search terms.** An industry keyword plus a country returns a clean, relevant set. Combine several terms for broader coverage.
- **Enable deep profiles only when you need revenue/principals** — it's slower and uses more compute, so keep it off for quick list-building.
- **Target the country** with the `country` parameter to avoid mixing markets.
- **Set a realistic `maxItemsPerQuery`.** 100–300 per term suits most prospecting and research projects.
- **Export to a spreadsheet** and sort by `revenueValue` or `industryName` to prioritize the best accounts.
- **Schedule recurring runs** to keep firmographics fresh and catch newly listed companies.
- **De-duplication is automatic** — feel free to add overlapping terms.
- **Sort by `revenueValue`** to instantly surface the largest accounts in a list.
- **Use `locationType`** to separate headquarters (Parent) from branches when planning outreach.
- **Combine industry + country** (e.g. `fintech` in `GB`) for tightly scoped market maps.

***

### 🔗 Built for B2B workflows

This scraper fits naturally into prospecting and research pipelines: pull a company list, enrich it with revenue and key principals, push it to your CRM or spreadsheet, and refresh it on a schedule. Because every record is de-duplicated and exported in open formats (JSON, CSV, Excel), it drops straight into your existing sales, marketing or analytics stack without extra cleanup.

***

### ⚠️ Limitations

- A few firmographic fields (e.g. incorporation year for some records) are not always exposed by D\&B and may be empty for a given company.
- Revenue, employee-band, phone and principal coverage is highest for US companies and larger businesses.
- Result volume per term depends on how many companies D\&B lists for that keyword and country.

***

### 🔗 Related scrapers

Building B2B lead lists, firmographics and company intelligence? Pair this **Dun & Bradstreet scraper** with these related company-data Actors:

- [BBB Scraper](https://apify.com/haketa/bbb-scraper) — pull Better Business Bureau company profiles, ratings, accreditation and contact details.
- [Impressum & EU Legal Notice Extractor](https://apify.com/haketa/impressum-legal-notice-extractor) — extract company name, VAT ID and legal-notice data from European websites.
- [YCombinator Companies Scraper](https://apify.com/haketa/ycombinator-companies-scraper) — scrape the full YC startup directory (5,900+ companies) with batch, status and founders.
- [India MCA Company Data Scraper](https://apify.com/haketa/india-mca-scraper) — official India corporate registry data: CIN, directors and charges.
- [BuiltIn Tech Companies & Tech Stack Scraper](https://apify.com/haketa/builtin-tech-companies-scraper) — tech-company profiles with the technologies they use.
- [SBA Small Business Search Scraper](https://apify.com/haketa/sba-small-business-scraper) — US small businesses and federal contractors for lead generation.

***

### 🚀 Get started

Click **Try for free**, enter a term like `software` or `logistics`, pick a country, and get a clean list of companies — with industry, address, DUNS and (optionally) revenue and key principals — in minutes. Perfect for **B2B lead generation, sales prospecting, market research and CRM enrichment**.

Have a feature request or question? Open an issue from the Actor's page and we'll help.

### 📋 Changelog

#### v1.2 (2026-11)

- **Unlocked 1,000+ company pagination & multi-industry scaling:** Raised `MAX_PAGES_PER_QUERY` to `1,000` (up to 50,000 companies per query), expanded default industry seed terms to 16 major B2B sectors, and removed the 100-item empty-run clamp when `maxItems` or `maxItemsPerQuery > 50` is explicitly requested.
- **Added `maxItems` alias support:** Supports both `maxItemsPerQuery` and `maxItems` for seamless API integration.
- **Documentation upgrade:** Added `At a glance` summary table, visual status badges, and updated 1,000+ scaling documentation.

#### v1.1 (2026-11)

- Verified with a 330-company benchmark across `software`, `logistics`, and `construction` (US) with 100% core-field coverage and 0 duplicates; confirmed deep profile mode (`scrapeCompanyProfiles: true`) extracting revenue, key principal, employee band, phone, and registered 9-digit DUNS.

#### v1.0 (2026-05)

- Initial release with multi-country search, 50-per-page pagination, automatic masked-field cleaning (`cleanMasked`), numeric revenue reconstruction (`formatRevenue`), and optional deep company profile enrichment.

# Changelog

This Actor's version history is a separate document: https://apify.com/haketa/dnb-scraper/changelog.md

# Actor input Schema

## `queries` (type: `array`):

Type one or more company names, industries or keywords to look up in the Dun & Bradstreet business directory (e.g. "software", "logistics", "Take-Two"). Leave empty to get a ready-made sample of well-known companies across popular industries.

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

Pick the country to search within. Dun & Bradstreet is geo-aware and the United States has the richest coverage.

## `maxItemsPerQuery` (type: `integer`):

Maximum number of companies to collect for each search term (0 = unlimited). Results are paginated automatically across pages of 50 companies.

## `scrapeCompanyProfiles` (type: `boolean`):

Visit each company's profile to add revenue, key principal, parent industry, financial years, competitors and DUNS. Much richer data, but slower (one extra request per company). Some fields (employee count, phone) are gated by Dun & Bradstreet and may be empty.

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

Dun & Bradstreet is geo-aware, so a residential proxy in your chosen country is recommended for the most complete data.

## Actor input object example

```json
{
  "queries": [
    "software",
    "logistics"
  ],
  "country": "US",
  "maxItemsPerQuery": 100,
  "scrapeCompanyProfiles": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

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

Open to view, filter and export all scraped results from this run (JSON, CSV, Excel).

# 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 = {
    "queries": [
        "software"
    ],
    "maxItemsPerQuery": 100,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/dnb-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 = {
    "queries": ["software"],
    "maxItemsPerQuery": 100,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/dnb-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 '{
  "queries": [
    "software"
  ],
  "maxItemsPerQuery": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call haketa/dnb-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,haketa/dnb-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/UtpwelZ0YdvxcMcT4/builds/iyZ14lvoUGfMhAzpy/openapi.json
