# UK Companies House Scraper (`wakey7dev/companies-house-scraper`) Actor

Scrape UK company data from Companies House. Search by company name, get detailed company profiles, officer information, filing history, and registered office addresses. Free official UK government data.

- **URL**: https://apify.com/wakey7dev/companies-house-scraper.md
- **Developed by:** [Chris Wakefield](https://apify.com/wakey7dev) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

![Chris The Dev](https://raw.githubusercontent.com/chriswakefield87/appstore-screenshot-translator/main/assets/actor-banner.png)

## 🇬🇧 UK Companies House Scraper

Search and extract official UK company data from Companies House — the authoritative government register of every limited company in the United Kingdom. Free, public, and comprehensive.

### 🔍 What this Actor does

- **Search by company name** — find companies matching a keyword or name
- **Lookup by company number** — fetch specific companies by their registration number
- **Full company profiles** — status, type, jurisdiction, SIC codes, accounts, registered address
- **Officer information** — directors and secretaries for each company
- **Filing history** — latest filings, dates, and descriptions
- **Clean structured output** — flattened JSON ready for spreadsheets, CRMs, or databases

### 📥 Input

| Field | Type | Required | Description |
|---|---|---|---|
| `searchQuery` | string | \* | Company name or keyword to search (e.g. `"Tesco"`, `"tech startup"`) |
| `companyNumbers` | string | \* | One or more company numbers, comma or newline separated (e.g. `"02012345, 03126067"`) |
| `apiKey` | string | ✅ | Your free Companies House API key (see below) |
| `includeOfficers` | boolean | no | Fetch directors and secretaries. Default: `true` |
| `includeFilingHistory` | boolean | no | Fetch recent filing history. Default: `false` |
| `maxResults` | integer | no | Max companies from search. Default: `50`, Max: `500` |

\* At least one of `searchQuery` or `companyNumbers` is required.

### 📤 Output

Each result is a flat JSON object written to the default dataset:

```json
{
  "company_number": "02012345",
  "company_name": "ACME LTD",
  "company_status": "active",
  "type": "ltd",
  "date_of_creation": "1986-07-10",
  "jurisdiction": "england-wales",
  "address_line_1": "1 Field Croft",
  "locality": "Wakefield",
  "postal_code": "WF3 3SZ",
  "country": "England",
  "sic_codes": "62012, 62020",
  "next_accounts_due_on": "2025-12-31",
  "last_accounts_type": "full",
  "next_confirmation_statement_due_on": "2025-08-15",
  "companies_house_url": "https://find-and-update.company-information.service.gov.uk/company/02012345",
  "officer_count": 2,
  "directors": "John Smith, Jane Doe",
  "secretaries": "",
  "latest_filing_date": "2024-06-30",
  "latest_filing_type": "AA",
  "latest_filing_description": "accounts-with-full-accounts-type"
}
```

Summary stats are also stored as key-value store items: total companies, active vs dissolved counts, and companies with officers.

### 🔑 Getting a Companies House API Key

This Actor **requires** a Companies House API key. It's free and takes 2 minutes:

1. Go to https://developer.company-information.service.gov.uk/manage-applications/add
2. Create a new application (any name works, e.g. "Apify Scraper")
3. Copy the generated API key
4. Paste it into the `apiKey` input field when running this Actor

Keep your key private — never commit it to source control.

### ⚠️ Rate Limits

Companies House enforces a **600 requests per 5 minutes** rate limit. This Actor respects that by running at 2 concurrent requests with a 0.6s delay between each, staying safely under the limit.

If you hit the rate limit (429 responses), the Actor will automatically wait 60 seconds and retry.

### 💰 Pricing

This Actor uses Apify's **pay-per-result** model. You're charged per company result written to the dataset. See the Apify Store listing for current pricing.

### 🎯 Use Cases

- **Lead generation** — find companies by sector (SIC code search via API)
- **Compliance & due diligence** — verify company status, directors, and filing compliance
- **Market research** — analyse company demographics, age, and geography
- **CRM enrichment** — bulk-lookup companies by registration number
- **Monitor filings** — track when companies file accounts or confirmation statements

### 🛠️ Example

**Search for "coffee shop" in London:**

```
searchQuery: coffee shop
maxResults: 100
includeOfficers: true
apiKey: [your-key]
```

**Lookup specific companies:**

```
companyNumbers: 02012345, 03126067, 04456789
includeFilingHistory: true
apiKey: [your-key]
```

### 📊 Data Source

All data comes directly from the [Companies House REST API](https://developer.company-information.service.gov.uk/), the official UK government register. Data is public, free, and updated daily.

### 📄 License

MIT — use this Actor's source code however you like.

***

Built with ❤️ using the [Apify SDK for Python](https://docs.apify.com/sdk/python/).

# Actor input Schema

## `searchMode` (type: `string`):

Search mode. 'basic' = search by company name. 'advanced' = search by SIC codes and/or location.

## `searchQuery` (type: `string`):

Company name or keyword to search for (e.g. 'Tesco' or 'tech startup'). Used in basic mode only.

## `sicCodes` (type: `string`):

SIC industry codes, comma-separated (e.g. '62020, 62012'). Used in advanced mode. Common: 62020=IT consultancy, 62012=software dev, 62090=IT services, 56101=restaurants, 41202=construction, 82990=other business support.

## `location` (type: `string`):

Town, city, or postcode to filter by registered office address (e.g. 'Leeds', 'Manchester', 'EC1V'). Used in advanced mode.

## `companyStatus` (type: `string`):

Filter by company status. Leave empty for all statuses.

## `companyNumbers` (type: `string`):

One or more company registration numbers, separated by commas or newlines (e.g. '02012345, 03126067'). Overrides search.

## `apiKey` (type: `string`):

Your free Companies House API key. Get one at https://developer.company-information.service.gov.uk/manage-applications/add

## `includeOfficers` (type: `boolean`):

Fetch company officers/directors for each company.

## `includeFilingHistory` (type: `boolean`):

Fetch recent filing history for each company.

## `maxResults` (type: `integer`):

Maximum number of companies to return (max 500).

## Actor input object example

```json
{
  "searchMode": "basic",
  "includeOfficers": true,
  "includeFilingHistory": false,
  "maxResults": 50
}
```

# Actor output Schema

## `results` (type: `string`):

Full flattened company data as a dataset — one record per company. Includes company\_number, company\_name, company\_status, registered office address, SIC codes, directors, officers, accounts dates, and Companies House URL. Exportable as JSON, CSV, Excel, or XML.

## `summary` (type: `string`):

Human-readable summary table showing all companies with key fields: name, number, status, incorporation date, location, and officer count. Includes aggregate counts (active/dissolved/other).

## `stats` (type: `string`):

Machine-readable JSON stats: total\_companies, search\_query, companies\_with\_officers, companies\_active, companies\_dissolved, companies\_other.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("wakey7dev/companies-house-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("wakey7dev/companies-house-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call wakey7dev/companies-house-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=wakey7dev/companies-house-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/FraWVQiv540h26eaU/builds/442c0nSFhPgEJi0H4/openapi.json
