# 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "UK Companies House Scraper",
        "description": "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.",
        "version": "1.0",
        "x-build-id": "442c0nSFhPgEJi0H4"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/wakey7dev~companies-house-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-wakey7dev-companies-house-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/wakey7dev~companies-house-scraper/runs": {
            "post": {
                "operationId": "runs-sync-wakey7dev-companies-house-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/wakey7dev~companies-house-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-wakey7dev-companies-house-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "apiKey"
                ],
                "properties": {
                    "searchMode": {
                        "title": "Search Mode",
                        "enum": [
                            "basic",
                            "advanced"
                        ],
                        "type": "string",
                        "description": "Search mode. 'basic' = search by company name. 'advanced' = search by SIC codes and/or location.",
                        "default": "basic"
                    },
                    "searchQuery": {
                        "title": "Search Query (Basic)",
                        "type": "string",
                        "description": "Company name or keyword to search for (e.g. 'Tesco' or 'tech startup'). Used in basic mode only."
                    },
                    "sicCodes": {
                        "title": "SIC Codes (Advanced)",
                        "type": "string",
                        "description": "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": {
                        "title": "Location (Advanced)",
                        "type": "string",
                        "description": "Town, city, or postcode to filter by registered office address (e.g. 'Leeds', 'Manchester', 'EC1V'). Used in advanced mode."
                    },
                    "companyStatus": {
                        "title": "Company Status (Advanced)",
                        "enum": [
                            "",
                            "active",
                            "dissolved",
                            "liquidation",
                            "administration"
                        ],
                        "type": "string",
                        "description": "Filter by company status. Leave empty for all statuses."
                    },
                    "companyNumbers": {
                        "title": "Company Numbers",
                        "type": "string",
                        "description": "One or more company registration numbers, separated by commas or newlines (e.g. '02012345, 03126067'). Overrides search."
                    },
                    "apiKey": {
                        "title": "Companies House API Key",
                        "type": "string",
                        "description": "Your free Companies House API key. Get one at https://developer.company-information.service.gov.uk/manage-applications/add"
                    },
                    "includeOfficers": {
                        "title": "Include Officers",
                        "type": "boolean",
                        "description": "Fetch company officers/directors for each company.",
                        "default": true
                    },
                    "includeFilingHistory": {
                        "title": "Include Filing History",
                        "type": "boolean",
                        "description": "Fetch recent filing history for each company.",
                        "default": false
                    },
                    "maxResults": {
                        "title": "Max Search Results",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of companies to return (max 500).",
                        "default": 50
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
