# Uk Companies House Scraper (`smorgi_apps/uk-companies-house-scraper`) Actor

- **URL**: https://apify.com/smorgi\_apps/uk-companies-house-scraper.md
- **Developed by:** [Smorgi Apps](https://apify.com/smorgi_apps) (community)
- **Categories:** Lead generation, Business, Other
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 companies house companies

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## UK Companies House Scraper — Pay Per Result

Fetch **UK company profiles** (and optional **officers**) through the official Companies House REST API (`api.company-information.service.gov.uk`). Pass company numbers directly or search by name.

**Store search keywords:** Companies House scraper · UK company registry · company officers · company number lookup · Companies House API

***

### Why this Actor

| Need | What you get |
|------|----------------|
| Known company numbers | Batch `09446231`, `SC123456`, etc. in one run |
| Name discovery | Optional `searchQuery` via `/search/companies` |
| Due diligence | Registered office, SIC codes, status, accounts/confirmation dates |
| People data | Optional directors & secretaries from `/officers` |
| Failures that shouldn't bill | 404 / invalid numbers → **not charged** |

Requires a **free** Companies House API key ([register here](https://developer.company-information.service.gov.uk/)).

***

### API endpoints used

| Method | Endpoint | Purpose |
|--------|----------|---------|
| `GET` | `/company/{company_number}` | Full company profile |
| `GET` | `/company/{company_number}/officers` | Directors, secretaries (when `includeOfficers`) |
| `GET` | `/search/companies?q=…` | Name search (when `searchQuery` set) |

Base URL: `https://api.company-information.service.gov.uk`

Authentication: HTTP Basic — API key as username, empty password.

***

### Input

```json
{
  "companyNumbers": ["09446231"],
  "searchQuery": "monzo",
  "includeOfficers": true,
  "maxItems": 25,
  "apiKey": "<YOUR_COMPANIES_HOUSE_API_KEY>",
  "requestDelayMs": 500
}
```

Provide at least one of `companyNumbers` or `searchQuery`. Direct numbers are fetched first; search results fill remaining slots up to `maxItems`.

***

### Output fields

| Field | Description |
|-------|-------------|
| `companyNumber` | Registration number |
| `companyName` | Legal name |
| `companyStatus` | e.g. `active`, `dissolved` |
| `companyType` | e.g. `ltd` |
| `dateOfCreation` | Incorporation date |
| `registeredOfficeAddress` | Structured address object |
| `sicCodes` | Standard Industrial Classification codes |
| `previousCompanyNames` | Former names with dates |
| `accountsNextDue` / `accountsLastMadeUpTo` | Accounts summary |
| `confirmationStatementNextDue` / `confirmationStatementLastMadeUpTo` | CS summary |
| `hasCharges` / `hasInsolvencyHistory` | Flags from profile |
| `officers` | Array when `includeOfficers` is true |
| `profileUrl` | Public Companies House web profile |
| `source` | `direct` or `search` |
| `scrapedAt` | ISO timestamp |

***

### Pricing

Pay-per-event for each **delivered** company row (`apify-default-dataset-item`).

- 404 companies, invalid numbers, and empty search pages → **not charged**
- Turn `includeOfficers` off for profile-only pulls (one fewer API call per company)

**~$0.50 / 1,000 companies** on the Store pricing tab (HTTP-only; failures free).

***

### Local development

```bash
npm install
npm run test:parser          # fixture tests (no API key)
COMPANIES_HOUSE_API_KEY=xxx npm run dry-run   # live run (skipped if env unset)
```

Companies House rate limit: ~600 requests per 5 minutes. Increase `requestDelayMs` for large batches.

***

### Limitations (honest)

- Requires your own free API key (not shared across users on Apify — each run uses the key you provide)
- Search returns matching companies only; it does not fuzzy-match dissolved/off-register edge cases perfectly
- Officers list is paginated on the API; this Actor fetches the first page (up to API default page size)
- Scottish (`SC`) and other prefixed numbers supported; invalid formats are skipped

***

Issues / feature requests: use the Actor **Issues** tab.

# Actor input Schema

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

UK company registration numbers (e.g. "09446231", "SC123456"). Leading zeros preserved.

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

Optional company name search. With an API key uses GET /search/companies; without a key uses the public Find-and-update HTML search. Combined with companyNumbers; capped by maxItems.

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

If true (and apiKey is set), attach directors/secretaries from GET /company/{number}/officers. Ignored in public HTML mode.

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

Cap total companies returned (direct numbers + search results).

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

Optional free API key from developer.company-information.service.gov.uk for richer JSON profiles + officers. Without a key the Actor uses the public Find-and-update HTML pages (enough for Try Actor / QA).

## `requestDelayMs` (type: `integer`):

Throttle between API calls. Companies House rate limits apply (~600 req/5 min).

## `proxyConfiguration` (type: `object`):

Optional. Companies House API usually works without proxies.

## Actor input object example

```json
{
  "companyNumbers": [
    "09446231",
    "00000006"
  ],
  "includeOfficers": true,
  "maxItems": 5,
  "requestDelayMs": 500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

# 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 = {
    "companyNumbers": [
        "09446231",
        "00000006"
    ],
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("smorgi_apps/uk-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 = {
    "companyNumbers": [
        "09446231",
        "00000006",
    ],
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("smorgi_apps/uk-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 '{
  "companyNumbers": [
    "09446231",
    "00000006"
  ],
  "maxItems": 5
}' |
apify call smorgi_apps/uk-companies-house-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/HhQBBD8b9qw2XZADh/builds/hefrdL3bENBhkpZnU/openapi.json
