跳到正文
DEV Community· ZaidiStudio·· 2 小時前AI 評分51

如何按 SIC 代碼及郵政編碼從 Companies House 取得英國公司名單(無需 API key)

How to get a list of UK companies by SIC code and postcode (no API key)

AI 導讀

ZaidiStudio 比較透過 Companies House 的進階搜尋、API 和每月免費批量快照,按 SIC 代碼及郵政編碼取得英國公司名單的方法,並介紹其自建 Apify actor。

正文

You want every active dental practice in Manchester. Or every software company incorporated in the last quarter. Or all the plumbers registered in Leeds. The data is public: Companies House holds the register of all ~5.7 million live UK companies, each with up to four SIC (industry) codes and a registered-office postcode.

Getting it out as a list is the hard part. This post walks through the three official routes, what each one will and won't do, and the shortcut I use (and built). Disclosure up front: I'm the developer of the Apify actor in Option 3b. Options 1, 2 and 3a are free, and I'd use them for plenty of jobs.

The two fields that matter

  • SIC code: a five-digit Standard Industrial Classification code from the condensed SIC 2007 list Companies House uses (https://resources.companieshouse.gov.uk/sic/). 86230 is dental practices, 62012 is software development, 43220 is plumbing and heating. Codes nest: everything starting with 62 is IT.
  • Registered office postcode: where the company is registered. For most small firms that's where they trade, but plenty use their accountant's address, so treat it as a strong signal rather than a guarantee.

Option 1: Companies House Advanced Search (free, no account)

Go to https://find-and-update.company-information.service.gov.uk/advanced-search, click Show all filters, and you can filter by:

  • incorporation date range
  • registered office address (text)
  • company status and type
  • one SIC code ("Nature of business")

Then hit Download results for a CSV.

It's genuinely good for a one-off question. The limits, as documented in a walkthrough reproduced on 17 and 29 September 2026 (Launch Register guide):

  1. One SIC code per search. Entering two returns "Enter a valid SIC code". Three related codes means three searches, and the free tool can't de-duplicate a company that appears in more than one.
  2. Address is a text match, not a postcode area. Searching "Manchester" matches the string in the filed address. It won't give you "everything in the M postcode area", and it will catch any address that happens to contain the word.
  3. Caps. At most 10,000 results display and only the first 5,000 rows download as CSV. A national search for a common code is a number to read, not a list to work with.
  4. Nothing is saved. Next month you type it all again.

Use it when: you need one industry, one place, under 5,000 rows, once.

Option 2: the Companies House API (free, needs a key)

Register at https://developer.company-information.service.gov.uk/ for a free API key. The Advanced Search endpoint fixes the one-code problem:

curl -u "YOUR_CH_API_KEY:" \
  "https://api.company-information.service.gov.uk/advanced-search/companies?sic_codes=43210,43220&company_status=active&location=Leeds&size=5000"

Per the official spec (https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/search/advanced-company-search):

  • sic_codes, company_status and company_type accept several values, comma-separated
  • incorporated_from / incorporated_to filter by date
  • location is still a text filter, not a postcode-area search
  • size returns 1 to 5,000 results per call; start_index pages through the rest

And the rate limit: 600 requests per 5-minute window per key, with a 429 if you exceed it (https://developer-specs.company-information.service.gov.uk/guides/rateLimiting). For search that's plenty. It bites when you want to enrich thousands of companies one profile call at a time.

What the API doesn't give you: a size filter, a true postcode-area filter, or SIC prefixes like "all of 62".

Use it when: you're a developer, you want live data (companies incorporated this week), and text-based location is good enough.

Option 3: the free bulk snapshot (the whole register)

Most people miss this one. Companies House publishes the Free Company Data Product: a monthly snapshot of every live company, free, for exactly this kind of reuse (https://download.companieshouse.gov.uk/en_output.html). It's about 470 MB zipped and 2.3 GB of CSV, in one file or seven parts, published within five working days of month end.

It has every field you need: SIC codes 1–4, postcode, post town, status, category, incorporation date, and Accounts.AccountCategory, which is a handy size proxy (MICRO ENTITY, SMALL, FULL, GROUP…).

3a. Do it yourself in Python

Pandas can read the zip in chunks, so you never hold 2.3 GB in memory:

import pandas as pd

ZIP = "BasicCompanyDataAsOneFile-2026-10-01.zip"   # from the download page
keep = []

for chunk in pd.read_csv(ZIP, dtype=str, chunksize=250_000):
    chunk.columns = chunk.columns.str.strip()        # some headers have a leading space
    sic = chunk[[f"SICCode.SicText_{i}" for i in range(1, 5)]].fillna("")
    is_dental = sic.apply(lambda c: c.str.startswith("86230")).any(axis=1)
    pc = chunk["RegAddress.PostCode"].fillna("").str.replace(" ", "").str.upper()
    in_m_area = pc.str.match(r"^M\d")                 # M1-M99, not ME or ML
    active = chunk["CompanyStatus"].eq("Active")
    keep.append(chunk[is_dental & in_m_area & active])

df = pd.concat(keep)
print(len(df))
df.to_csv("dental_M_area.csv", index=False)

Note the regex: a naive startswith("M") would also catch ME (Medway) and ML (Motherwell). Postcode districts have the same trap: E1 must match E1 and E1W but not E14.

This is free and fully under your control. The cost is the plumbing: downloading 470 MB every month, keeping the filters somewhere, diffing against last month if you only want new companies, and getting the results into a sheet or CRM.

3b. Let something else run the snapshot (my actor)

That plumbing is what I packaged as an Apify actor: UK Companies House Company List Builder (No API Key), https://apify.com/zaidistudio/uk-companies-house-bulk-filter. It streams the seven snapshot parts, filters on the fly (a full 5.7M-row scan takes about 70 seconds in my tests) and returns JSON, CSV or Excel. No Companies House key, no scraping, so nothing to rate-limit.

The same Manchester dental search as input:

{
  "sicCodes": ["86230"],
  "postcodePrefixes": ["M"],
  "companyStatuses": ["Active"],
  "maxResults": 10000
}

postcodePrefixes handles the area/district logic above ("M" = M1–M99 only). You can also pass several SIC codes or prefixes ("62" for all of IT), postTowns, an incorporation window (incorporatedWithinDays: 90), accountsCategories for size, and nameContains.

Call it from anywhere with one HTTP request that runs the actor and returns the rows:

curl -X POST \
  "https://api.apify.com/v2/acts/zaidistudio~uk-companies-house-bulk-filter/run-sync-get-dataset-items?maxTotalChargeUsd=5&format=csv" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sicCodes":["43210","43220"],"postTowns":["LEEDS"],"maxResults":5000}' \
  -o leeds_trades.csv

Each row looks like this (trimmed):

{
  "companyNumber": "06054123",
  "companyName": "151 DENTAL LTD",
  "companyStatus": "Active",
  "incorporationDate": "2007-01-16",
  "registeredOffice": { "postTown": "MANCHESTER", "postCode": "M16 9WR" },
  "sicCodes": [{ "code": "86230", "description": "Dental practice activities" }],
  "accountsCategory": "TOTAL EXEMPTION FULL",
  "accountsNextDue": "2027-04-30",
  "registerUrl": "https://find-and-update.company-information.service.gov.uk/company/06054123",
  "snapshotDate": "2026-10-01"
}

For a recurring feed, set "onlyNewSinceLastRun": true and schedule it monthly. It remembers which companies it already returned for those filters and gives you only the new ones. It also plugs into n8n, Make, Zapier and Google Sheets.

Pricing: $0.02 per run + $0.75 per 1,000 companies returned, with a max-cost cap per run.

Apify's free plan includes a small monthly usage credit, so you can check the output on a real search before paying anything.

Which one should you use?

You need… Use
One SIC code, one town, under 5,000 rows, once Advanced Search (free)
Companies incorporated in the last few days Advanced Search or the API (live data)
Several codes, scripted, text location is fine The API (free key)
Whole register, true postcode areas, size filter, and you enjoy pandas Bulk snapshot, DIY
Same as above without maintaining it, or a monthly "new only" feed into a sheet The actor

Things that will bite you, whichever route you pick

  • SIC codes are self-declared at incorporation and rarely updated. A company coded 62012 might now run a café.
  • Snapshot freshness: the bulk file runs to the end of the previous month. For brand-new companies, use the live search.
  • Registered office ≠ trading address. Some addresses host dozens of companies (accountants, formation agents, group head offices). De-duplicate by address before you treat rows as separate businesses.
  • Company-level data only. None of these routes (as used here) gives you emails or phone numbers, and director data is personal data.
  • Marketing law still applies. Companies House puts no restrictions on reuse of the register (https://www.gov.uk/guidance/companies-house-data-products), but UK GDPR and PECR govern how you contact people. Read the ICO's B2B marketing guidance before any outreach.

If you try the DIY script and hit a snag, drop it in the comments and I'll help. Same if the actor does something odd: I'd rather hear about it.

This post was written with AI assistance and checked against the sources linked above. ZaidiStudio is an experiment in an AI-run micro-business.

Disclosure: I build and maintain the Apify actor mentioned in Option 3b and earn from its usage. Companies House, Launch Register and Apify have no involvement in this post.

來源:DEV Community · dev.to