Company data API: How to get Dun & Bradstreet data without the enterprise contract

Build an affordable D&B API with Apify - with or without code - and use it in AI applications and workflows.

Dun & Bradstreet is widely considered a gold standard for firmographic information, but its official company data API (Direct+) is primarily designed for enterprise customers.

This guide shows you how to retrieve publicly available company data with or without code and use it in AI applications and workflows. You’ll learn how to build an affordable D&B API with Apify.

Dun & Bradstreet API: The official route to company data

D&B Direct+ is Dun & Bradstreet’s official API solution. It provides access to 2,500+ attributes and proprietary analytics from 600M+ companies worldwide. Use cases include enriching prospect records, maintaining supplier data, and identifying business risks and opportunities.

The main challenge with D&B Direct+ is that access, pricing, data packages, rate limits, and quotas depend on commercial agreements with Dun & Bradstreet. There’s no standard plan you can sign up for online. Enterprise customers need to go through a sales and onboarding process. Pricing is bespoke, and API access can cost up to a few thousand dollars per month.

For developers, startups, and SMBs, these requirements can make D&B data difficult to access for smaller projects and experimentation.

Company data API without an enterprise contract

You don’t need a D&B Direct+ contract to access Dun & Bradstreet data. You can extract public company information from D&B profile pages using web scraping.

However, building a reliable scraping operation and wrapping it in an API isn’t easy. You must deal with anti-scraping protections such as CAPTCHAs and browser fingerprinting. Plus, Dun & Bradstreet triggers a Cloudflare verification for most requests that don't come from a US IP address. Building a D&B scraping-based API also involves scaling, backend development, and DevOps challenges.

Apify handles that infrastructure for you. An Apify Actor handles the scraping and exposes the extracted data through the Apify API. This lets you build a custom company data API as an alternative to the costly D&B API (Direct+).

What company data can you retrieve via web scraping?

D&B company pages expose useful firmographic and business information:

An example of a D&B company page
An example of a D&B company page

Dun & Bradstreet company data fields you can gather through web scraping include:

Data fieldDescription
Company nameOfficial company name listed on the profile
WebsiteCompany website URL
Key principalPrimary executive or decision-maker listed
Principal namesNames of listed company principals
Principal titlesJob titles of listed principals
AddressCompany's listed business address
City, region, countryLocation details for the company
IndustryPrimary industry classification
Industry sectorBroader industry sector
EmployeesModeled employee count, when available
RevenueModelled revenue, when available
Year startedYear the company started operations
Year incorporatedCompany incorporation year
CompetitorsCompetitors identified by D&B
Corporate familyRelated companies and corporate relationships
Note: Web scraping can only extract information available on the company page. Some fields may be limited or gated, and the available data can vary from one company profile to another.

How to get Dun & Bradstreet data with Apify

Apify is the largest marketplace of tools for AI, with thousands of ready-made Actors for web extraction and business automation.

An Actor for this use case is Dun & Bradstreet Scraper, which lets you access publicly available D&B company and article data.

The Dun & Bradstreet Scraper Actor
The Dun & Bradstreet Scraper Actor

It accepts company profile URLs or keywords to search for companies on the Dun & Bradstreet website. The Actor scrapes the selected pages and returns each company as a structured object, with fields such as company name, website, location, industry, key principal, and competitors.

Like any other Actor, it can be called via Apify API to access its scraped dataset in JSON. This means Dun & Bradstreet Scraper can act as a company data API or business data API, without the enterprise requirements of the official D&B API.

The Actor can also act as a source of data for AI. That’s possible thanks to Apify AI integrations, whether through MCP or official plugins for LangChain, LlamaIndex, Dify, and other AI frameworks.

How to retrieve D&B data with no code using Apify

Learn how to use Dun & Bradstreet Scraper to retrieve D&B data in a no-code workflow.

Step #1: Open the Dun & Bradstreet Scraper

Start by creating an Apify account if you haven’t already. Otherwise, log in. In Apify Console, open Apify Store and search for “dun & bradstreet scraper”:

Selecting the Dun & Bradsheet Scraper
Selecting the Dun & Bradsheet Scraper

Select Dun & Bradstreet Scraper to reach the Actor's page:

The Dun & Bradstreet Scraper Actor page
The Dun & Bradstreet Scraper Actor page

You’ll see a visual form where you can configure the Actor's input to run it from Apify Console, without writing any code.

Note: Dun & Bradstreet Scraper includes a 3-day trial, so you can test it for free. After the trial, it costs $25 per month. This fee is deducted from the prepaid usage included with your Apify plan. If that exceeds your plan's prepaid usage, the extra amount will be charged as overage.

Step #2: Configure and run the Actor

Suppose you want to scrape three Dun & Bradstreet companies: NVIDIA, Alibaba, and Mistral.

Open the D&B Business Directory page in your browser and search for each company. Then, copy their company page URLs:

https://www.dnb.com/business-directory/company-profiles.nvidia_corporation.05d1c7d8cadd126cda3ae62daffa10c8.html
https://www.dnb.com/business-directory/company-profiles.alibaba_(china)_technology_co_ltd.e3529c2476c569b9912000545d3314d6.html
https://www.dnb.com/business-directory/company-profiles.mistral_ai.339836acd76560caab2b4a841b3fa05e.html

Paste the URLs into the Start URLs input:

Configuring the Dun & Bradstreet Scraper Actor's run
Configuring the Dun & Bradstreet Scraper Actor's run

Blank out Maximum number of items to set its default behavior, which is retrieving all data for every URL you provide. Leave all other fields at their values.

Once you’ve configured the Actor’s input, click Start in the top-right corner:

Click Start
Click Start

Rent the Actor by accepting the free trial terms. Click Save & Start to launch the run, then wait for the Dun & Bradstreet data to appear.

Step #3: Explore the results

After the run ends, you’ll get a resulting dataset like this:

The dataset produced by the Dun & Bradstreet Scraper Actor's run
The dataset produced by the Dun & Bradstreet Scraper Actor's run

The output table for Dun & Bradstreet Scraper shows only a quick summary of the scraped data. To access all D&B data, select All fields:

D&B data fields scraped in the All fields view
D&B data fields scraped in the All fields view

In the All fields table, you can see all scraped data. For structured fields (e.g., Company Snapshot, Competitors, and Industry), click them to view their contents.

Alternatively, switch to the JSON view:

The JSON representation of the scraped data
Data in JSON

This gives you a clear view of all the Dun & Bradstreet data retrieved by the Actor.

Step #4: Export the dataset

On the Actor’s run page, click Export in the top-right corner:

Click Export
Click Export

The Export dataset modal will appear, allowing you to export the dataset in JSON, XLS, CSV, or other formats.

Configuring the export to produce an Excel file
Configure the export to produce an Excel file

For example, select Excel and press Download.

dataset_dnb-scraper_<timestamp>.xlsx file will be downloaded. Open it to view the exported data:

Exploring the downloaded XLSX dataset
Explore the downloaded XLSX dataset

The file contains a flat version of the scraped Dun & Bradstreet data. Filter and explore the data in Excel or import it into your data analysis pipeline.

How to use the company data API in your AI workflow

Here, you’ll see how to turn Dun & Bradstreet Scraper into a company data API that supplies firmographic information to an LLM.

You’ll build a Python script that:

  1. Calls the Actor via API;
  2. Retrieves the scraped D&B data;
  3. Converts it to JSON;
  4. Passes it directly to an OpenAI model for AI processing.

Prerequisites

To follow this tutorial, make sure you have:

You’ll also need a Python project. Install the required libraries with:

pip install apify-client openai

These are:

Step #1: Trigger the Actor through the Apify API

On the Dun & Bradstreet Scraper Actor page, select API > API clients:

Selecting API > API clients on the Actor page
Selecting API > API clients on the Actor page

In the API clients modal, switch to the Python tab:

The Python snippet in the API clients modal
The Python snippet in the API clients modal

You’ll get a simple Python snippet that:

  1. Configures a Dun & Bradstreet Scraper run;
  2. Launches the Actor via the Apify API client for Python;
  3. Waits until the Actor finishes;
  4. Gets the resulting dataset ID;
  5. Fetches and iterates through the results.

The snippet provided in Apify Console contains a <YOUR_API_TOKEN> placeholder. You need to replace it with your Apify API token, which you can find in the Settings > API & Integrations section of Apify Console. You can also access that page by clicking Manage tokens:

Retrieving your Apify API token
Retrieving your Apify API token

The returned snippet configures a sample input for the Dun & Bradstreet Scraper Actor. Adapt the run_input object to specify your target URLs and the desired behavior. Get a JSON version of the Actor’s input from Apify Console:

JSON version of the Actor’s run
JSON version of the Actor’s run

You can easily adapt that JSON to a Python object. Add a constant for the Apify API token, update run_input, and you’ll get the following snippet:

from apify_client import ApifyClient

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

# Prepare the Actor input
run_input = {
  "extendOutputFunction": "($) => {\n    const result = {};\n    // Uncomment to add a title to the output\n    // result.title = $('title').text().trim();\n\n    return result;\n}",
  "proxy": {
    "useApifyProxy": True
  },
  "startUrls": [
    "https://www.dnb.com/business-directory/company-profiles.nvidia_corporation.05d1c7d8cadd126cda3ae62daffa10c8.html",
    "https://www.dnb.com/business-directory/company-profiles.alibaba_(china)_technology_co_ltd.e3529c2476c569b9912000545d3314d6.html",
    "https://www.dnb.com/business-directory/company-profiles.mistral_ai.339836acd76560caab2b4a841b3fa05e.html"
  ],
  "mode": "COMPANIES",
  "country": "all"
}

# Run the Actor and wait for it to finish
run = client.actor("WeOty7LW7tLRrD2UD").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)
Note: In a production script, avoid hardcoding your API tokens. Instead, read them from environment variables.

Step #2: Retrieve structured company data

Execute the Python script, and you’ll get an output like this:

The output of the Python D&B scraper
The output of the Python D&B scraper

Note how each item in the dataset is a Python object containing data fields populated by scraping the corresponding Dun & Bradstreet company page.

The Actor-based company data API returns a dataset that you can export to JSON with:

import json

companies = client.dataset(run.default_dataset_id).list_items().items

with open("dnb_companies.json", "w", encoding="utf-8") as f:
    json.dump(companies, f, indent=2, ensure_ascii=False)

The snippet creates a dnb_companies.json file containing the retrieved company data:

The dnb_companies.json file
The dnb_companies.json file

The resulting file corresponds to the JSON version of the dataset you can download from Apify Console. That’s much better suited as data for AI than the raw HTML of D&B pages.

Step #3: Feed company data into an LLM

The easiest way to analyze the Dun & Bradstreet company information is to pass it directly to an LLM. The idea is to:

  1. Use the Dun & Bradstreet Scraper as a company data API through Apify;
  2. Collect the D&B data;
  3. Serialize it as JSON and embed it into an OpenAI prompt.

For example, you can ask the LLM to produce a Markdown comparing the companies by summarizing their similarities and differences:

from apify_client import ApifyClient
import json
from openai import OpenAI

# Replace <YOUR_OPENAI_API_KEY> with your actual OpenAI API key
OPENAI_API_KEY = "<YOUR_OPENAI_API_KEY>"

# D&B data retrieval logic via Apify...
companies = client.dataset(run.default_dataset_id).list_items().items

# Initialize the OpenAI API client
openai_client = OpenAI(api_key=OPENAI_API_KEY)

# Analzye the scraped D&B data with an LLM
response = openai_client.responses.create(
    model="gpt-5.4-mini",
    instructions="You are a business data analyst who responds in plain Markdown.",
    input=f"""
Compare the companies in this dataset and create a Markdown table covering company name, country, city, industry, website, key principal, and number of principals. After the table, summarize the most important similarities and differences between the companies.

DATASET:
{json.dumps(companies, indent=2, ensure_ascii=False)}
""",
)

with open("dnb_companies_report.md", "w", encoding="utf-8") as f:
    f.write(response.output_text)

The result will be a Markdown report saved as dnb_companies_report.md.

This is just one example of what you can do with your Apify-backed D&B API. By changing the prompt, you can use the same code to identify potential competitors, summarize company profiles, or build business research workflows around Dun and Bradstreet data.

Step #4: Final code

Put everything together, and you’ll get the following Python code:

# pip install apify-client openai

from apify_client import ApifyClient
import json
from openai import OpenAI

# Replace <YOUR_OPENAI_API_KEY> with your actual OpenAI API key
OPENAI_API_KEY = "<YOUR_OPENAI_API_KEY>"
# Replace <YOUR_API_TOKEN> with your actual Apify API token
APIFY_API_TOKEN = "<YOUR_API_TOKEN>"

# Initialize the ApifyClient
client = ApifyClient(APIFY_API_TOKEN)

# Prepare the Actor input
run_input = {
  "extendOutputFunction": "($) => {\n    const result = {};\n    // Uncomment to add a title to the output\n    // result.title = $('title').text().trim();\n\n    return result;\n}",
  "proxy": {
    "useApifyProxy": True
  },
  "startUrls": [
    "https://www.dnb.com/business-directory/company-profiles.nvidia_corporation.05d1c7d8cadd126cda3ae62daffa10c8.html",
    "https://www.dnb.com/business-directory/company-profiles.alibaba_(china)_technology_co_ltd.e3529c2476c569b9912000545d3314d6.html",
    "https://www.dnb.com/business-directory/company-profiles.mistral_ai.339836acd76560caab2b4a841b3fa05e.html"
  ],
  "mode": "COMPANIES",
  "country": "all"
}

# Run the Actor and wait for it to finish
run = client.actor("WeOty7LW7tLRrD2UD").call(run_input=run_input)

# Fetch the results from the run's dataset
companies = client.dataset(run.default_dataset_id).list_items().items

# Initialize the OpenAI API client
openai_client = OpenAI(api_key=OPENAI_API_KEY)

# Analzye the scraped D&B data with an LLM
response = openai_client.responses.create(
    model="gpt-5.4-mini",
    instructions="You are a business data analyst who responds in plain Markdown.",
    input=f"""
Compare the companies in this dataset and create a Markdown table covering company name, country, city, industry, website, key principal, and number of principals. After the table, summarize the most important similarities and differences between the companies.

DATASET:
{json.dumps(companies, indent=2, ensure_ascii=False)}
""",
)

# Export the AI-generated report to a Markdown file
with open("dnb_companies_report.md", "w", encoding="utf-8") as f:
    f.write(response.output_text)

Run the script, and it’ll generate a dnb_companies_report.md file containing a report like this:

The AI-generated dnb companies report
The AI-generated dnb companies report

The report is fully backed by the data retrieved via your custom company data API, implemented with Apify's Dun & Bradstreet Scraper.

Build AI workflows connected to your company data API

The Python example above is just one way to connect your business data API to an AI workflow. Apify provides other methods to integrate scraped D&B data directly with AI agents and automation platforms.

The Apify MCP server lets MCP-compatible clients such as Claude, ChatGPT, Grok, and Cursor discover Actors, run them, and retrieve their results. This means an AI agent can trigger Dun & Bradstreet Scraper on demand whenever it needs fresh company information.

You can also connect your Actor-based business data API to workflows built with n8n, Make, Zapier, and Gumloop. A typical pipeline involves these steps:

  1. Retrieve D&B data through the Apify Actor using Apify’s official integration node;
  2. Feed the scraped company data to an LLM for analysis;
  3. Send the results by email or store them in a database.

Some relevant use cases supported by an Apify-powered D&B API include:

Use caseDescription
CRM enrichmentAppend firmographic and operational data to customer records.
Lead scoringEnrich prospect profiles with company financials to prioritize high-potential sales targets.
Company researchResearch companies and identify potential customers, accounts, or business opportunities.
Competitor mappingIdentify and compare direct and indirect competitors across industries and regions.
Sales intelligenceGenerate actionable market insights and account intelligence for sales and account management teams.

For more ideas on implementing similar workflows, check out the following resources:


Conclusion

D&B Direct+ offers programmatic access to Dun & Bradstreet company data, but it’s expensive and requires enterprise contracts. You can collect some of the same information more affordably by scraping D&B company pages.

Apify provides the infrastructure and tools to build your own company data API. Dun & Bradstreet Scraper returns publicly scraped data from D&B pages. You can integrate this Actor with AI agents through Apify MCP or call it in custom workflows via API.

FAQ

What is the Dun & Bradstreet API?

The Dun & Bradstreet API (Direct+) provides programmatic access to D&B business data. It targets enterprises that need structured company information for applications, data enrichment, risk analysis, and other business use cases.

Can I access Dun & Bradstreet data without Direct+?

Yes, you can collect company data without using the enterprise D&B API by scraping public Dun & Bradstreet API company profiles. A scraper can collect the available information from those pages and return it as structured data for further processing.

What company data can I retrieve by scraping Dun & Bradstreet?

Scraping Dun & Bradstreet gives you access to firmographic fields such as company name, website, industry, address, location, and key principals. Available fields vary by company profile, and some information may be missing or unavailable.

What is the difference between a company data API and a business data API?

The terms company data API and business data API are often used interchangeably, but they can have different scopes. The first focuses on firmographic, corporate structure, and financial information about registered companies. The latter covers a broader range of information, including local businesses, storefronts, consumer reviews, and public listings.

Can I use company data with ChatGPT or Claude?

Yes, a company data API can be integrated with several AI tools, including ChatGPT and Claude. Apify supports this directly through its MCP server, which ChatGPT, Claude, and other MCP-compatible AI assistants can natively connect to.

On this page

Publish and earn on Apify Store

The largest marketplace of tools for AI

Start here