# Companies House Scraper - UK company search (`marekhartmann/companies-house-scraper`) Actor

Search the UK Companies House register and get company number, status, address, incorporation date and officers. Tells you explicitly when the register itself reported no results instead of guessing from an empty page.

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

## Pricing

from $3.00 / 1,000 results

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/actors/running/actors-in-store.md#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

## Companies House Scraper

Vyhľadá firmy v britskom obchodnom registri (Companies House) a stiahne ich údaje —
číslo, názov, stav, dátum vzniku, predchádzajúce názvy, sídlo, voliteľne aj typ
firmy a SIC kódy z karty firmy.

Bez API kľúča. Register je verejná služba a Actor ide na verejnú stránku, takže
zákazník si nemusí nič zakladať.

### Čím sa líši: prázdny výsledok nie je faktúra

Väčšina scraperov na prázdno vráti prázdny dataset — a nedozvieš sa, či firma
naozaj neexistuje, alebo sa len niečo pokazilo. Tento rozlišuje tri stavy:

| čo sa stalo | ako to skončí |
|-------------|---------------|
| register sám povie **„No results found"** | beh **uspeje**, dataset prázdny, v `RUN_REPORT` dôvod. Pri účtovaní za výsledok **neplatíš nič** |
| register vráti stránku, ktorú nepoznáme | beh **zlyhá** — najprv sa ešte spýta kontrolnú otázku na známu firmu, aby sa vedelo, či je problém v zadaní alebo v registri |
| zoznam výsledkov je, ale nedá sa prečítať | beh **zlyhá** — zmenené značkovanie sa nevydáva za „nič sa nenašlo" |

Rozlíšenie nie je domnienka: odmerané na živých stránkach 21. 8. 2026 —
dotaz `tesco` vráti `<ul class="results-list">` s 21 položkami, dotaz na nezmysel
ten zoznam nemá vôbec a namiesto neho má `id="no-results"`.

Jeden dotaz, ktorý nič nenájde, **nezhodí celý beh** — ostatné dotazy zo zoznamu
dobehnú normálne.

### Vstup

| pole | čo to je |
|------|----------|
| `queries` | názvy firiem alebo čísla v registri |
| `maxResultsPerQuery` | strop na jeden dotaz (predvolene 200) |
| `withCompanyDetail` | doplní stav, typ a SIC kódy z karty firmy — presnejšie, ale pomalšie |
| `proxyConfiguration` | Apify proxy |

### Výstup

Riadky v datasete + `RUN_REPORT` v key-value store behu.

### Vývoj

```
npm install
npm test                  # 15 testov, bez siete
node scripts/smoke.mjs    # ostrý test proti živému registru
```

Postavené na `Marek-Actor-Kit` — spoločné jadro je v `src/core` a needituje sa tu,
ale v kite; rozvezie sa cez `node sync.mjs`.

### Need a scraper for something else?

I build custom Apify Actors and browser automation the same way this one is built:
a verified result or an explicit failure, never an empty dataset sold as a success.

- My other Actors: https://apify.com/marekhartmann
- Code and test suites: https://github.com/marekhartmann-creator

Tell me the site and what you need out of it.

# Actor input Schema

## `queries` (type: `array`):

Company name or its registration number. When a query finds nothing, the run does NOT fail — you get the reason in the RUN\_REPORT and are not charged for that query.

## `maxResultsPerQuery` (type: `integer`):

Hard cap on how many results are collected per query. The run stops at this number even if more pages exist, so a broad query cannot run away with your credits.

## `withCompanyDetail` (type: `boolean`):

More accurate data, but one extra request per company — so slower.

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

Apify Proxy configuration. Leave the default unless the source starts rate-limiting your datacenter IP; residential is rarely needed here.

## Actor input object example

```json
{
  "queries": [
    "tesco"
  ],
  "maxResultsPerQuery": 200,
  "withCompanyDetail": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `items` (type: `string`):

One row per company: company number, name, status, type, incorporation date and registered address; officers when detail is requested.

## `runReport` (type: `string`):

Per-query outcome, and for empty results the explicit no-results marker the register returned.

# 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 = {
    "queries": [
        "tesco"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("marekhartmann/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 = { "queries": ["tesco"] }

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

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

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

```

## CLI example

```bash
echo '{
  "queries": [
    "tesco"
  ]
}' |
apify call marekhartmann/companies-house-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,marekhartmann/companies-house-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

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