Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 6 min read

Bulk file, API or MCP: how to get company data into your app in 2026

Every B2B product ends up needing company data. A signup form that should fill in the registered address. A KYB check on a registration number. A CRM that needs industry and size on every account. An agent that has to kn

Every B2B product ends up needing company data. A signup form that should fill in the registered address. A KYB check on a registration number. A CRM that needs industry and size on every account. An agent that has to know who owns whom.

There are three ways to wire that data into your stack in 2026: a bulk feed, a real-time API and an MCP server. They are not interchangeable. Each one puts the data in a different place, and that decides your latency, your costs and what you are allowed to store.

I work at CompanyData.com, so the examples use our API. The patterns are the same for any provider.

The short version

Bulk feed Real-time API MCP server
Data lives In your warehouse With the vendor With the vendor
Called by Your SQL and jobs Your backend Your AI agent
Freshness As fresh as the last file Live Live
Cost shape High up front, queries free Per call, forever Per call, via the agent
Good for Analytics, ML, joins, your own product Onboarding, KYB, forms Research, enrichment while an agent works

1. Bulk feed: the data moves to you

You license a dataset (a country, an industry, the world) and receive files on a schedule, usually CSV, JSON or Parquet in an S3 bucket. From there it is your data platform's job.

With Parquet you do not even need to load it first. DuckDB reads it straight from the bucket:

-- Example path and column names: your vendor gives you the real layout
CREATE VIEW companies AS
SELECT * FROM read_parquet('s3://your-bucket/companydata/2026-11/*.parquet');

-- Every software company in the Netherlands with 50+ staff
SELECT "Company Name", "Company Registration Number", "City", "Employees Total"
FROM companies
WHERE "Country" = 'Netherlands'
  AND "Business Category Code 1" LIKE '737%'
  AND "Employees Total" >= 50;

Three things matter more than the first load:

  • Key on the registration number, not the name. Names change and collide. A registration number plus country is stable, and it is what you will join your own tables on.
  • Plan the refresh. A file starts ageing the day it lands. Ask for full snapshots plus a changes file, and make the monthly load idempotent (upsert on the vendor's ID).
  • Keep the vendor ID. It is the handle for every later update and for API lookups of the same record.

Choose bulk when you query the same data again and again, need the whole population (market sizing, models, matching your entire customer base) or build the data into something you ship.

2. Real-time API: the data stays there, you ask

Your backend asks for one company and gets JSON back. Search first, then fetch the full record by ID:

curl -G "https://app.companydata.com/api/company/search" \
  -H "x-api-key: $COMPANYDATA_API_KEY" \
  --data-urlencode "countryCode=NL" \
  --data-urlencode "search=Heineken"
{
  "meta": { "totalCount": 3, "currentPage": 1, "totalPages": 1, "pageSize": 25 },
  "data": {
    "records": [
      { "ID": "330114331", "Company Name": "Heineken N.V.", "Country": "Netherlands", "City": "AMSTERDAM" }
    ]
  }
}

In TypeScript, with the SDK:

import { ApiClient } from '@companydata/companydata-sdk';

const client = new ApiClient({
  auth: { type: 'apiKey', apiKey: process.env.COMPANYDATA_API_KEY! },
});

const { data } = await client.company.search({ countryCode: 'NL', search: 'Heineken' });

Match on the strongest identifier you have

Most bad matches come from searching by name when you had something better. Work down this list and stop at the first hit:

async function findCompany(row: { regNo?: string; domain?: string; name: string; country?: string }) {
  if (row.regNo && row.country) {
    const r = await client.company.search({ nationalId: row.regNo, countryCode: row.country });
    if (r.data.records.length) return r.data.records[0];   // exact
  }
  if (row.domain) {
    const r = await client.company.search({ website: row.domain });
    if (r.data.records.length) return r.data.records[0];   // strong
  }
  const r = await client.company.search({ search: row.name, countryCode: row.country });
  return r.data.records[0] ?? null;                         // a candidate, verify it
}

A name-only match is a candidate, not a confirmation. Check the address or legal form before you write it to your database.

Cache, if your contract allows it

Company records change slowly. A short cache saves most of your calls:

const cache = new Map<string, { at: number; record: unknown }>();
const TTL = 24 * 60 * 60 * 1000;

async function getCompany(id: string) {
  const hit = cache.get(id);
  if (hit && Date.now() - hit.at < TTL) return hit.record;
  const record = await fetchFullRecord(id);   // your export call
  cache.set(id, { at: Date.now(), record });
  return record;
}

Read the terms first. Some providers forbid storing responses at all, which means you pay again every time you need the same company. That one clause changes the economics of an API more than the price per call does.

When the API stops being the cheap option

An API is cheap to start and expensive at scale. The break-even is simple:

calls per year Γ— price per call  >  licence price per year

If you call the same market over and over, or you need every record anyway, a feed is cheaper and faster. A common end state is both: the file as your base, the API for the moment a company signs up.

3. MCP: the data goes to your agent

The Model Context Protocol lets an AI assistant call tools. A company data MCP server exposes search and enrichment as tools, so the agent can look up a company while it works.

Hosted, nothing to install:

claude mcp add --transport http companydata https://companydata.com/mcp/ \
  --header "x-api-key: your_api_key"

Or in Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "companydata": {
      "url": "https://companydata.com/mcp/",
      "headers": { "x-api-key": "your_api_key" }
    }
  }
}

The server has three tools: company_search, company_enrich and field_lookup. Ask the agent "who is the parent company of this supplier?" and it calls them itself.

Two things to know before you build on it:

  • MCP is an API with a model in the loop. Same data, same credits, less determinism. Use it where a person would otherwise search by hand; use the plain API where you need the same answer every time.
  • The result lands in the model's context. Whatever the tool returns is sent to your AI provider. That matters for the next section.

What you may store and log

Company data is mostly not personal data. A limited company's name and registration number are outside GDPR. Directors, sole traders, contact names, direct emails and mobile numbers are inside it. For those fields, as a developer:

  • You are the controller of your copy. Once it is in your database, your company decides what happens with it, whoever sold it to you.
  • Store only the fields you use. Do not persist a full record with contacts because it was in the response.
  • Keep the source and the date on every record. You need both to answer "where did you get my data?" and to honour retention.
  • Keep personal fields out of logs and prompts. Application logs and agent transcripts are the two places personal data leaks into without anyone deciding it should.
  • Sending your own customer list for enrichment? Then the vendor processes your data and you need a data processing agreement that says they only match it and delete it afterwards.

Which one should you build?

  • One company at a time, in a user flow: API.
  • The whole market, repeated queries, or data inside your own product: bulk feed.
  • An agent or assistant that needs to look things up: MCP.
  • All three at once is normal. Pick a provider that uses the same IDs across file, API and MCP, so a record you loaded from a file is the same record your API and your agent see. The best-known example of such an ID is the D-U-N-S number from Dun & Bradstreet. You do not need a D&B contract to get the same idea: several Dun & Bradstreet alternatives, ours included, give every company one stable ID next to its official registration number.

Code and more examples: companydata-api on GitHub and the API docs. For the buyer's side of the same choice (contracts, licences and prices), see how to buy a company database in 2026.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.