{"slug": "company-data-api-how-to-get-dun-bradstreet-data-without-the-enterprise-contract", "title": "Company data API: How to get Dun & Bradstreet data without the enterprise contract", "summary": "Apify, a web scraping platform, offers an alternative to Dun & Bradstreet's enterprise-only Direct+ API by using its Dun & Bradstreet Scraper Actor to extract public company data from D&B profile pages, with pricing that can cost up to a few thousand dollars per month for the official API. The scraper retrieves fields such as company name, website, key principal, address, industry, employees, revenue, and competitors, and can be used in AI applications and workflows.", "body_md": "Dun & Bradstreet is widely considered a gold standard for firmographic information, but its official company data API (Direct+) is primarily designed for enterprise customers.\n\nThis 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.\n\n## Dun & Bradstreet API: The official route to company data\n\n[D&B Direct+](https://www.dnb.com/en-us/products/dnb-direct-plus.html) 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.\n\nThe 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.\n\nFor developers, startups, and SMBs, these requirements can make D&B data difficult to access for smaller projects and experimentation.\n\n## Company data API without an enterprise contract\n\nYou 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](https://blog.apify.com/what-is-web-scraping/).\n\nHowever, building a reliable scraping operation and wrapping it in an API isn’t easy. You must deal with [anti-scraping protections](https://docs.apify.com/academy/anti-scraping) 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.\n\n[Apify](https://apify.com/) 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+).\n\n### What company data can you retrieve via web scraping?\n\nD&B company pages expose useful firmographic and business information:\n\nDun & Bradstreet company data fields you can gather through web scraping include:\n\n| Data field | Description |\n|---|---|\n| Company name | Official company name listed on the profile |\n| Website | Company website URL |\n| Key principal | Primary executive or decision-maker listed |\n| Principal names | Names of listed company principals |\n| Principal titles | Job titles of listed principals |\n| Address | Company's listed business address |\n| City, region, country | Location details for the company |\n| Industry | Primary industry classification |\n| Industry sector | Broader industry sector |\n| Employees | Modeled employee count, when available |\n| Revenue | Modelled revenue, when available |\n| Year started | Year the company started operations |\n| Year incorporated | Company incorporation year |\n| Competitors | Competitors identified by D&B |\n| Corporate family | Related companies and corporate relationships |\n\n**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.\n\n### How to get Dun & Bradstreet data with Apify\n\nApify is the largest marketplace of tools for AI, with [thousands of ready-made Actors](https://apify.com/store) for web extraction and business automation.\n\nAn Actor for this use case is [Dun & Bradstreet Scraper](https://apify.com/epctex/dnb-scraper), which lets you access publicly available D&B company and article data.\n\nIt 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.\n\nLike any other Actor, it can be called via [Apify API](https://docs.apify.com/api/v2) 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.\n\nThe Actor can also act as a source of data for AI. That’s possible thanks to [Apify AI integrations](https://docs.apify.com/integrations/ai), whether through MCP or official plugins for LangChain, LlamaIndex, Dify, and other AI frameworks.\n\n## How to retrieve D&B data with no code using Apify\n\nLearn how to use Dun & Bradstreet Scraper to retrieve D&B data in a no-code workflow.\n\n### Step #1: Open the Dun & Bradstreet Scraper\n\nStart by [creating an Apify account](https://console.apify.com/sign-up) if you haven’t already. Otherwise, [log in](https://console.apify.com/sign-in). In Apify Console, open **Apify Store** and search for “dun & bradstreet scraper”:\n\nSelect [Dun & Bradstreet Scraper](https://console.apify.com/actors/WeOty7LW7tLRrD2UD/input) to reach the Actor's page:\n\nYou’ll see a visual form where you can configure the Actor's input to run it from Apify Console, without writing any code.\n\n**Note**: Dun & Bradstreet Scraper [includes a 3-day trial](https://apify.com/epctex/dnb-scraper/pricing), 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](https://apify.com/pricing). If that exceeds your plan's prepaid usage, the extra amount will be charged as overage.\n\n### Step #2: Configure and run the Actor\n\nSuppose you want to scrape three Dun & Bradstreet companies: NVIDIA, Alibaba, and Mistral.\n\nOpen the [D&B Business Directory page](https://www.dnb.com/business-directory.html) in your browser and search for each company. Then, copy their company page URLs:\n\n```\nhttps://www.dnb.com/business-directory/company-profiles.nvidia_corporation.05d1c7d8cadd126cda3ae62daffa10c8.html\nhttps://www.dnb.com/business-directory/company-profiles.alibaba_(china)_technology_co_ltd.e3529c2476c569b9912000545d3314d6.html\nhttps://www.dnb.com/business-directory/company-profiles.mistral_ai.339836acd76560caab2b4a841b3fa05e.html\n```\n\nPaste the URLs into the **Start URLs** input:\n\nBlank 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.\n\nOnce you’ve configured the Actor’s input, click **Start** in the top-right corner:\n\nRent the Actor by accepting the free trial terms. Click **Save & Start** to launch the run, then wait for the Dun & Bradstreet data to appear.\n\n### Step #3: Explore the results\n\nAfter the run ends, you’ll get a resulting dataset like this:\n\nThe output table for Dun & Bradstreet Scraper shows only a quick summary of the scraped data. To access all D&B data, select **All fields**:\n\nIn 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.\n\nAlternatively, switch to the **JSON** view:\n\nThis gives you a clear view of all the Dun & Bradstreet data retrieved by the Actor.\n\n### Step #4: Export the dataset\n\nOn the Actor’s run page, click **Export** in the top-right corner:\n\nThe **Export dataset** modal will appear, allowing you to [export the dataset in JSON, XLS, CSV, or other formats](https://docs.apify.com/platform/storage/dataset).\n\nFor example, select **Excel** and press **Download**.\n\nA `dataset_dnb-scraper_<timestamp>.xlsx`\n\nfile will be downloaded. Open it to view the exported data:\n\nThe 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.\n\n## How to use the company data API in your AI workflow\n\nHere, you’ll see how to turn Dun & Bradstreet Scraper into a company data API that supplies firmographic information to an LLM.\n\nYou’ll build a Python script that:\n\n- Calls the Actor via API;\n- Retrieves the scraped D&B data;\n- Converts it to JSON;\n- Passes it directly to an OpenAI model for AI processing.\n\n### Prerequisites\n\nTo follow this tutorial, make sure you have:\n\n- An\n[Apify API token](https://docs.apify.com/api/v2#authentication). - An\n[OpenAI API key](https://platform.openai.com/api-keys). [Python 3.11+](https://www.python.org/downloads/)installed locally.\n\nYou’ll also need a Python project. Install the required libraries with:\n\n```\npip install apify-client openai\n```\n\nThese are:\n\n: The`apify-client`\n\n[Apify API client for Python](https://docs.apify.com/api/client/python/docs), used to call Dun & Bradstreet Scraper via API.: To process the data retrieved from the Apify-powered DnB API with an OpenAI LLM.`openai`\n\n### Step #1: Trigger the Actor through the Apify API\n\nOn the Dun & Bradstreet Scraper Actor page, select **API > API clients**:\n\nIn the **API clients** modal, switch to the **Python** tab:\n\nYou’ll get a simple Python snippet that:\n\n- Configures a Dun & Bradstreet Scraper run;\n- Launches the Actor via the Apify API client for Python;\n- Waits until the Actor finishes;\n- Gets the resulting dataset ID;\n- Fetches and iterates through the results.\n\nThe snippet provided in Apify Console contains a `<YOUR_API_TOKEN>`\n\nplaceholder. 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**:\n\nThe returned snippet configures a sample input for the Dun & Bradstreet Scraper Actor. Adapt the `run_input`\n\nobject to specify your target URLs and the desired behavior. Get a JSON version of the Actor’s input from Apify Console:\n\nYou can easily adapt that JSON to a Python object. Add a constant for the Apify API token, update `run_input`\n\n, and you’ll get the following snippet:\n\n``` python\nfrom apify_client import ApifyClient\n\n# Replace <YOUR_API_TOKEN> with your actual Apify API token\nAPIFY_API_TOKEN = \"<YOUR_API_TOKEN>\"\n# Initialize the ApifyClient\nclient = ApifyClient(APIFY_API_TOKEN)\n\n# Prepare the Actor input\nrun_input = {\n  \"extendOutputFunction\": \"($) => {\\n    const result = {};\\n    // Uncomment to add a title to the output\\n    // result.title = $('title').text().trim();\\n\\n    return result;\\n}\",\n  \"proxy\": {\n    \"useApifyProxy\": True\n  },\n  \"startUrls\": [\n    \"https://www.dnb.com/business-directory/company-profiles.nvidia_corporation.05d1c7d8cadd126cda3ae62daffa10c8.html\",\n    \"https://www.dnb.com/business-directory/company-profiles.alibaba_(china)_technology_co_ltd.e3529c2476c569b9912000545d3314d6.html\",\n    \"https://www.dnb.com/business-directory/company-profiles.mistral_ai.339836acd76560caab2b4a841b3fa05e.html\"\n  ],\n  \"mode\": \"COMPANIES\",\n  \"country\": \"all\"\n}\n\n# Run the Actor and wait for it to finish\nrun = client.actor(\"WeOty7LW7tLRrD2UD\").call(run_input=run_input)\n\n# Fetch and print Actor results from the run's dataset (if there are any)\nfor item in client.dataset(run.default_dataset_id).iterate_items():\n    print(item)\n```\n\n**Note***: In a production script, avoid hardcoding your API tokens. Instead, read them from environment variables.*\n\n### Step #2: Retrieve structured company data\n\nExecute the Python script, and you’ll get an output like this:\n\nNote how each item in the dataset is a Python object containing data fields populated by scraping the corresponding Dun & Bradstreet company page.\n\nThe Actor-based company data API returns a dataset that you can export to JSON with:\n\n``` python\nimport json\n\ncompanies = client.dataset(run.default_dataset_id).list_items().items\n\nwith open(\"dnb_companies.json\", \"w\", encoding=\"utf-8\") as f:\n    json.dump(companies, f, indent=2, ensure_ascii=False)\n```\n\nThe snippet creates a `dnb_companies.json`\n\nfile containing the retrieved company data:\n\nThe 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.\n\n### Step #3: Feed company data into an LLM\n\nThe easiest way to analyze the Dun & Bradstreet company information is to pass it directly to an LLM. The idea is to:\n\n- Use the Dun & Bradstreet Scraper as a company data API through Apify;\n- Collect the D&B data;\n- Serialize it as JSON and embed it into an OpenAI prompt.\n\nFor example, you can ask the LLM to produce a Markdown comparing the companies by summarizing their similarities and differences:\n\n``` python\nfrom apify_client import ApifyClient\nimport json\nfrom openai import OpenAI\n\n# Replace <YOUR_OPENAI_API_KEY> with your actual OpenAI API key\nOPENAI_API_KEY = \"<YOUR_OPENAI_API_KEY>\"\n\n# D&B data retrieval logic via Apify...\ncompanies = client.dataset(run.default_dataset_id).list_items().items\n\n# Initialize the OpenAI API client\nopenai_client = OpenAI(api_key=OPENAI_API_KEY)\n\n# Analzye the scraped D&B data with an LLM\nresponse = openai_client.responses.create(\n    model=\"gpt-5.4-mini\",\n    instructions=\"You are a business data analyst who responds in plain Markdown.\",\n    input=f\"\"\"\nCompare 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.\n\nDATASET:\n{json.dumps(companies, indent=2, ensure_ascii=False)}\n\"\"\",\n)\n\nwith open(\"dnb_companies_report.md\", \"w\", encoding=\"utf-8\") as f:\n    f.write(response.output_text)\n```\n\nThe result will be a Markdown report saved as `dnb_companies_report.md`\n\n.\n\nThis 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.\n\n### Step #4: Final code\n\nPut everything together, and you’ll get the following Python code:\n\n``` python\n# pip install apify-client openai\n\nfrom apify_client import ApifyClient\nimport json\nfrom openai import OpenAI\n\n# Replace <YOUR_OPENAI_API_KEY> with your actual OpenAI API key\nOPENAI_API_KEY = \"<YOUR_OPENAI_API_KEY>\"\n# Replace <YOUR_API_TOKEN> with your actual Apify API token\nAPIFY_API_TOKEN = \"<YOUR_API_TOKEN>\"\n\n# Initialize the ApifyClient\nclient = ApifyClient(APIFY_API_TOKEN)\n\n# Prepare the Actor input\nrun_input = {\n  \"extendOutputFunction\": \"($) => {\\n    const result = {};\\n    // Uncomment to add a title to the output\\n    // result.title = $('title').text().trim();\\n\\n    return result;\\n}\",\n  \"proxy\": {\n    \"useApifyProxy\": True\n  },\n  \"startUrls\": [\n    \"https://www.dnb.com/business-directory/company-profiles.nvidia_corporation.05d1c7d8cadd126cda3ae62daffa10c8.html\",\n    \"https://www.dnb.com/business-directory/company-profiles.alibaba_(china)_technology_co_ltd.e3529c2476c569b9912000545d3314d6.html\",\n    \"https://www.dnb.com/business-directory/company-profiles.mistral_ai.339836acd76560caab2b4a841b3fa05e.html\"\n  ],\n  \"mode\": \"COMPANIES\",\n  \"country\": \"all\"\n}\n\n# Run the Actor and wait for it to finish\nrun = client.actor(\"WeOty7LW7tLRrD2UD\").call(run_input=run_input)\n\n# Fetch the results from the run's dataset\ncompanies = client.dataset(run.default_dataset_id).list_items().items\n\n# Initialize the OpenAI API client\nopenai_client = OpenAI(api_key=OPENAI_API_KEY)\n\n# Analzye the scraped D&B data with an LLM\nresponse = openai_client.responses.create(\n    model=\"gpt-5.4-mini\",\n    instructions=\"You are a business data analyst who responds in plain Markdown.\",\n    input=f\"\"\"\nCompare 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.\n\nDATASET:\n{json.dumps(companies, indent=2, ensure_ascii=False)}\n\"\"\",\n)\n\n# Export the AI-generated report to a Markdown file\nwith open(\"dnb_companies_report.md\", \"w\", encoding=\"utf-8\") as f:\n    f.write(response.output_text)\n```\n\nRun the script, and it’ll generate a `dnb_companies_report.md`\n\nfile containing a report like this:\n\nThe report is fully backed by the data retrieved via your custom company data API, implemented with Apify's Dun & Bradstreet Scraper.\n\n## Build AI workflows connected to your company data API\n\nThe 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.\n\nThe [Apify MCP server](https://mcp.apify.com/) 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.\n\nYou can also connect your Actor-based business data API to workflows built with n8n, Make, Zapier, and Gumloop. A typical pipeline involves these steps:\n\n- Retrieve D&B data through the Apify Actor using\n[Apify’s official integration](https://docs.apify.com/integrations/workflows-and-notifications)node; - Feed the scraped company data to an LLM for analysis;\n- Send the results by email or store them in a database.\n\nSome relevant use cases supported by an Apify-powered D&B API include:\n\n| Use case | Description |\n|---|---|\n| CRM enrichment | Append firmographic and operational data to customer records. |\n| Lead scoring | Enrich prospect profiles with company financials to prioritize high-potential sales targets. |\n| Company research | Research companies and identify potential customers, accounts, or business opportunities. |\n| Competitor mapping | Identify and compare direct and indirect competitors across industries and regions. |\n| Sales intelligence | Generate actionable market insights and account intelligence for sales and account management teams. |\n\n*For more ideas on implementing similar workflows, check out the following resources:*\n\n[Automated market research: Build end-to-end workflows from one platform](https://blog.apify.com/market-research-automation/)[How to collect TikTok Shop product data for sales intelligence](https://blog.apify.com/tiktok-shop-sales-data/)[Marketing intelligence tools: build your own AI pipeline](https://blog.apify.com/marketing-intelligence-tools/)[How to use web scraping for lead generation](https://blog.apify.com/web-scraping-for-lead-generation/)[Extract contact details from Google Maps and enrich it in one run](https://blog.apify.com/how-to-extract-emails-from-google-places/)\n\n## Conclusion\n\nD&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.\n\nApify 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.\n\n## FAQ\n\n### What is the Dun & Bradstreet API?\n\nThe 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.\n\n### Can I access Dun & Bradstreet data without Direct+?\n\nYes, 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.\n\n### What company data can I retrieve by scraping Dun & Bradstreet?\n\nScraping 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.\n\n### What is the difference between a company data API and a business data API?\n\nThe 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.\n\n### Can I use company data with ChatGPT or Claude?\n\nYes, a company data API can be integrated with several AI tools, including ChatGPT and Claude. Apify supports this directly through its [MCP server](https://mcp.apify.com), which ChatGPT, Claude, and other MCP-compatible AI assistants can natively connect to.", "url": "https://wpnews.pro/news/company-data-api-how-to-get-dun-bradstreet-data-without-the-enterprise-contract", "canonical_source": "https://blog.apify.com/dun-bradstreet-scraper-dnb-api/", "published_at": "2026-08-17 10:00:00+00:00", "updated_at": "2026-08-17 11:42:42.937821+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools"], "entities": ["Dun & Bradstreet", "D&B Direct+", "Apify", "Dun & Bradstreet Scraper", "Cloudflare"], "alternates": {"html": "https://wpnews.pro/news/company-data-api-how-to-get-dun-bradstreet-data-without-the-enterprise-contract", "markdown": "https://wpnews.pro/news/company-data-api-how-to-get-dun-bradstreet-data-without-the-enterprise-contract.md", "text": "https://wpnews.pro/news/company-data-api-how-to-get-dun-bradstreet-data-without-the-enterprise-contract.txt", "jsonld": "https://wpnews.pro/news/company-data-api-how-to-get-dun-bradstreet-data-without-the-enterprise-contract.jsonld"}}