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

Scrape UK company data from Companies House - search by company name, get company profiles, registered addresses, SIC codes, accounts, officers, and filing history.

- **URL**: https://apify.com/crawlerbros/companies-house-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## UK Companies House Scraper

Scrape UK company data from [Companies House](https://www.gov.uk/government/organisations/companies-house) — the UK's official registrar of companies. Search by company name, filter by type and status, and fetch full company profiles including registered addresses, SIC codes, accounts filing dates, and more.

### What data does this actor extract?

Each record contains:

| Field | Description |
|-------|-------------|
| `companyNumber` | Unique UK company registration number |
| `companyName` | Registered company name |
| `companyType` | Legal type (ltd, plc, llp, etc.) |
| `companyStatus` | Current status (active, dissolved, liquidation, etc.) |
| `dateOfCreation` | Date company was incorporated |
| `dateOfCessation` | Date company ceased (if dissolved) |
| `registeredOfficeAddress` | Registered office address (address lines, locality, region, postal code, country) |
| `sicCodes` | List of SIC industry codes |
| `accounts` | Accounts filing dates (next due, last made up to, accounting reference date) |
| `confirmationStatement` | Confirmation statement dates (next due, last made up to) |
| `jurisdiction` | Legal jurisdiction (e.g. england-wales, scotland) |
| `hasCharges` | Whether the company has registered charges |
| `hasInsolvencyHistory` | Whether the company has insolvency history |
| `sourceUrl` | Direct link to company profile on Companies House |
| `recordType` | Always "company" |
| `scrapedAt` | ISO timestamp of when the record was scraped |

### Input

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | `searchCompanies` (default) or `getCompanyDetail` |
| `apiKey` | string | Free API key from [developer.company-information.service.gov.uk](https://developer.company-information.service.gov.uk) — **required** |
| `searchQuery` | string | Company name or keywords to search |
| `companyNumbers` | array | Registration numbers for `getCompanyDetail` mode |
| `companyType` | select | Filter by type: Ltd, PLC, LLP, Partnership, Sole Trader |
| `companyStatus` | select | Filter by status: Active, Dissolved, Liquidation, Administration |
| `maxItems` | integer | Maximum records to return (1–500, default 25) |

### Getting a Free API Key

1. Register at [developer.company-information.service.gov.uk](https://developer.company-information.service.gov.uk)
2. Create an application to get your API key
3. Pass the key as `apiKey` in the actor input

The API key is required for all requests. Without it, the actor emits a clear error record explaining how to get the free key. Registration takes under 5 minutes.

### Example Input

```json
{
  "mode": "searchCompanies",
  "apiKey": "your-api-key-here",
  "searchQuery": "technology",
  "companyType": "ltd",
  "companyStatus": "active",
  "maxItems": 50
}
````

### Example Output

```json
{
  "companyNumber": "09876543",
  "companyName": "ACME TECHNOLOGY LTD",
  "companyType": "ltd",
  "companyStatus": "active",
  "dateOfCreation": "2015-03-12",
  "registeredOfficeAddress": {
    "addressLine1": "123 Tech Street",
    "locality": "London",
    "postalCode": "EC1A 1BB",
    "country": "England"
  },
  "sicCodes": ["62012", "62020"],
  "accounts": {
    "nextDue": "2025-12-31",
    "lastMadeUpTo": "2024-03-31"
  },
  "jurisdiction": "england-wales",
  "hasCharges": false,
  "hasInsolvencyHistory": false,
  "sourceUrl": "https://find-and-update.company-information.service.gov.uk/company/09876543",
  "recordType": "company",
  "scrapedAt": "2024-01-20T10:30:00+00:00"
}
```

### Error Handling

If no API key is provided, the actor emits a single error record instead of crashing:

```json
{
  "error": "Companies House API requires a free API key. Register at https://developer.company-information.service.gov.uk to get your key, then pass it as `apiKey` in the actor input.",
  "recordType": "error",
  "scrapedAt": "2024-01-20T10:30:00+00:00"
}
```

This ensures the daily automated test runs produce a clean dataset item rather than a failed run.

### Frequently Asked Questions

**Q: Is an API key really required?**
A: Yes, Companies House requires authentication for all API requests. The key is free and registration takes under 5 minutes.

**Q: What are SIC codes?**
A: Standard Industrial Classification codes — used to classify a company's main business activity.

**Q: How do I look up a company by registration number?**
A: Use `getCompanyDetail` mode and provide the registration number in `companyNumbers`.

**Q: Can I filter for only active companies?**
A: Yes — set `companyStatus` to "active".

**Q: What company types are available?**
A: Private Limited (Ltd), Public Limited (PLC), Limited Liability Partnership (LLP), Partnership, and Sole Trader — plus many others returned by the API.

**Q: How current is the data?**
A: Companies House data is updated in near real-time as companies file documents.

**Q: What is the rate limit?**
A: Companies House has a rate limit of approximately 600 requests per 5 minutes. The actor handles this automatically with retries.

# Actor input Schema

## `mode` (type: `string`):

Operation mode: search companies by name or fetch full detail for specific company numbers.

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

Free API key from https://developer.company-information.service.gov.uk. Required for all requests. Registration is free.

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

Company name or keywords to search for (e.g. 'technology', 'consulting', 'Amazon').

## `companyNumbers` (type: `array`):

List of UK company registration numbers (e.g. \['01234567', '09876543']). Used in getCompanyDetail mode.

## `companyType` (type: `string`):

Filter results by company type. Leave blank for all types.

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

Filter results by company status. Leave blank for all statuses.

## `maxItems` (type: `integer`):

Maximum number of company records to return.

## Actor input object example

```json
{
  "mode": "searchCompanies",
  "searchQuery": "technology",
  "companyType": "",
  "companyStatus": "",
  "maxItems": 10
}
```

# Actor output Schema

## `companies` (type: `string`):

Dataset containing all scraped Companies House company records.

# 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 = {
    "mode": "searchCompanies",
    "searchQuery": "technology",
    "companyType": "",
    "companyStatus": "",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/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 = {
    "mode": "searchCompanies",
    "searchQuery": "technology",
    "companyType": "",
    "companyStatus": "",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/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 '{
  "mode": "searchCompanies",
  "searchQuery": "technology",
  "companyType": "",
  "companyStatus": "",
  "maxItems": 10
}' |
apify call crawlerbros/companies-house-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crawlerbros/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 company profiles, registered addresses, SIC codes, accounts, officers, and filing history.",
        "version": "1.0",
        "x-build-id": "gWAdlM8nrF6CIGtpb"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~companies-house-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-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/crawlerbros~companies-house-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-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/crawlerbros~companies-house-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-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": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "searchCompanies",
                            "getCompanyDetail"
                        ],
                        "type": "string",
                        "description": "Operation mode: search companies by name or fetch full detail for specific company numbers.",
                        "default": "searchCompanies"
                    },
                    "apiKey": {
                        "title": "Companies House API Key",
                        "type": "string",
                        "description": "Free API key from https://developer.company-information.service.gov.uk. Required for all requests. Registration is free."
                    },
                    "searchQuery": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Company name or keywords to search for (e.g. 'technology', 'consulting', 'Amazon')."
                    },
                    "companyNumbers": {
                        "title": "Company Numbers (getCompanyDetail mode)",
                        "type": "array",
                        "description": "List of UK company registration numbers (e.g. ['01234567', '09876543']). Used in getCompanyDetail mode.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "companyType": {
                        "title": "Company Type Filter",
                        "enum": [
                            "",
                            "ltd",
                            "plc",
                            "llp",
                            "partnership",
                            "sole-trader"
                        ],
                        "type": "string",
                        "description": "Filter results by company type. Leave blank for all types.",
                        "default": ""
                    },
                    "companyStatus": {
                        "title": "Company Status Filter",
                        "enum": [
                            "",
                            "active",
                            "dissolved",
                            "liquidation",
                            "administration"
                        ],
                        "type": "string",
                        "description": "Filter results by company status. Leave blank for all statuses.",
                        "default": ""
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of company records to return.",
                        "default": 10
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
