# UK Companies House Scraper — Directors, PSCs & Filings (`stone_jadex/uk-companies-house-scraper`) Actor

Export UK company profiles by number, keyword or filters: several SIC codes, status, type, office and dates, plus optional officers, PSCs, charges and filings. For supplier checks and CRM cleanup. $2 per 1,000 companies.

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

## Pricing

from $1.70 / 1,000 company rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## UK Companies House Scraper

Retrieve public Companies House profiles for UK supplier research, company matching and due-diligence preparation. Search names, apply advanced register filters (including several SIC codes), or supply company numbers, profile URLs or a pasted advanced-search results URL. No Companies House API key is required.

### What you gain

- Match company number, name and status before adding an entity to a CRM or supplier list.
- Narrow a search by company name, registered office, one or more SIC codes, status, type, or incorporation and dissolution dates before you pay for a profile.
- Review registered office, SIC codes and incorporation date alongside filing due dates.
- Optionally add officers, persons with significant control, charges and filing history on the same company-row charge.
- Re-run a saved search in incremental mode and pay only for companies not already written.
- Use the source profile link to verify current register information.

### Ways to use the data

- A procurement analyst can check a shortlist of company numbers and review status and registered office.
- A CRM team can match named companies to register numbers and inspect optional previous names.
- A researcher building a filtered shortlist can combine a name or several SIC codes with incremental mode, so later runs skip companies already collected.

### Delivery preview

These four rows were parsed with this Actor's parser from archived public Companies House HTML fixtures in this repository, captured on 1 November 2026 (`test/fixtures/company_tesco.html` and `test/fixtures/qa-e25494c/`). They are profile fields only, not a live run. Dates of birth and personal correspondence or home addresses are not collected. Fields may be missing in other records.

| Company | Number | Status | Incorporated | SIC |
|---|---|---|---|---|
| TESCO PLC | 00445790 | Active | 1947-11-27 | 47110 |
| BAKERY ALTERNATIVE LTD | 16303163 | Active | 2025-03-10 | 10710, 47240 |
| BAKERY ANDANTE LIMITED | SC241685 | Liquidation | 2002-12-31 | 47240 |
| BAKERY AND SERVICES LLP | OC446488 | Dissolved | 2023-03-23 | |

Main output fields include `companyNumber`, `companyName`, `companyStatus`, `companyType`, `incorporatedOn`, `dissolvedOn`, `registeredOfficeAddress`, `sicCodes`, `directorNames`, `pscNames`, `enrichmentIncomplete`, `isNew`, `source` and `scrapedAt`. Optional sections add `officers`, `pscs`, `charges` and `filingHistory`. A finished run also writes one free run-notice row (`recordType`).

`directorNames` lists current directors only (when `includeOfficers` is on). `pscNames` lists current, non-ceased persons with significant control (when `includePsc` is on); it is an empty array when the company is exempt from the PSC register. When a sub-page is blocked, `directorNames` or `pscNames` may be empty; use `enrichmentIncomplete=true` to distinguish that case from a company that really has no current directors or PSCs. An empty list alone does not mean none were found.

### Why choose this Actor

- Search by name, exact company number or profile URL, paste a Companies House advanced-search results URL (`/advanced-search/get-results?...`), or combine advanced-search filters: company name includes or excludes, registered office text (town or postcode), SIC codes, status, company type, and incorporation or dissolution dates (`YYYY-MM-DD`). Each SIC code is searched separately, with the other filters applied every time; a single `sicCodes` value may contain several codes separated by commas or whitespace; empty pieces are dropped and duplicates are removed. Results are de-duplicated by `companyNumber`, only unique written rows are charged, and `maxItems` is shared across all SIC searches.
- Officers, PSCs, charges and recent filings can be attached to the same company row at the same event price.
- Individual birth dates and personal correspondence or home addresses are stripped; registered office remains available.
- If an officers, PSC, charges or filing-history page is blocked, that company row is still charged and written with `enrichmentIncomplete` true, and the run then stops, so you can see which profile was left incomplete.

### Pricing

Prices in **USD**. This Actor charges $2 per 1,000 company records (`result-row` at $0.002 each). Check the current Pricing tab before running.

| Result type | Event price |
| --- | ---: |
| Company record | $2 per 1,000 results |

Compared with the leading single-site Store Actor on 30-day users, that is $2 vs $4 per 1,000 company records (scrapesage/companies-house-scraper, 11 November 2026). That Actor also charges $0.002 per officer record separately.

For example, 1,000 results at the company record rate incur $2 in result-event charges. This calculation covers Actor event charges. The free `run-notice` row is not charged. Review Pricing for any separately listed platform usage; later access to stored data follows Apify's applicable storage pricing.

**Store subscription tier discounts:** Apify Store subscription plans (Bronze, Silver, Gold and Platinum) apply tiered pricing discounts where configured; check the Pricing tab for your current tier rate.

### Try it in three steps

1. Enter company names, company numbers or public Companies House URLs, paste an advanced-search results URL (`/advanced-search/get-results?...`), or set advanced-search filters.
2. Set `maxItems`; select officers, persons with significant control, charges or filing history as needed. Turn on `onlyNew` if you want later runs to skip companies already seen.
3. Run the Actor, review the dataset and export the results in your preferred available format.

#### Small keyword shortlist

For researchers building a small keyword-based company shortlist, search for up to five Tesco-related records.

```json
{
  "searchQueries": ["tesco"],
  "maxItems": 5,
  "requestDelaySecs": 1
}
```

#### Review officers and ownership

For analysts reviewing a known company’s officers and ownership, include officer and PSC data for one company.

```json
{
  "companyNumbers": ["00445790"],
  "maxItems": 1,
  "includeOfficers": true,
  "includePsc": true,
  "requestDelaySecs": 1
}
```

#### Filtered advanced search

```json
{
  "companyNameIncludes": "BAKERY",
  "companyStatus": ["active"],
  "sicCodes": ["10710"],
  "incorporatedFrom": "2020-01-01",
  "incorporatedTo": "2025-12-31",
  "maxItems": 10,
  "requestDelaySecs": 1
}
```

#### Paste an advanced-search results URL

```json
{
  "startUrls": [
    "https://find-and-update.company-information.service.gov.uk/advanced-search/get-results?companyNameIncludes=BAKERY&status=active"
  ],
  "maxItems": 20,
  "requestDelaySecs": 1
}
```

#### Only new companies

```json
{
  "searchQueries": ["tesco"],
  "maxItems": 20,
  "onlyNew": true,
  "stateRecordName": "companies-house-seen",
  "requestDelaySecs": 1
}
```

### Coverage and FAQ

**What are the limits?** The hard limit is 1,000 companies per run; use official bulk data for full-register exports. Optional sections can be truncated. Individual birth dates and personal correspondence/home addresses are stripped.

**Can I paste an advanced-search URL?** Yes. A Companies House advanced-search results URL (`/advanced-search/get-results?...`) is crawled. All query parameters are kept. The Actor continues at 20 companies per page until results run out or `maxItems` is reached.

For a pasted `/advanced-search/get-results` or `/search/companies` start URL, `page=N` must be a whole number of at least 1. If that parameter is missing, the Actor starts at page 1. If the value is invalid — a decimal, a negative number, `0`, a non-numeric value, or an empty `page=` — the Actor requests page 1 and adds a warning.

A trailing slash on a supported path is accepted and normalized (for example `/advanced-search/get-results/`, `/search/companies/` or `/company/00445790/`). The `/advanced-search` form page (with or without a trailing slash or query parameters) is not supported and is not requested. It adds a warning and an `errors[]` entry, and any other inputs still run. If it is the only input, the run is Failed (`stopReason` `errors`), with 0 company rows and no event charge. Unsupported start URLs are not silently dropped.

**What if Companies House rejects the search filters?** If an advanced-search results page shows a form validation error (for example "Enter a valid SIC code"), the run stops immediately with `stopReason` `errors`. `errors[]` quotes the site's own text. Remaining SIC searches are not run. If no company row was written, the run is Failed, the status message is `Run failed (errors)`, and nothing is charged. If company rows were already written, they are kept and charged, a run-notice row is pushed, `OUTPUT.failed` is true, the platform status is SUCCEEDED, and the status message is `Stopped early (errors) after N companies: …`. To tell whether the run stopped part-way, check `OUTPUT.failed` and `stopReason`; do not rely on the platform status alone. A `blocked-*` stop after rows have been written is different: `OUTPUT.failed` stays false.

**What if `sicCodes` contains only commas or whitespace?** If the value splits to an empty list, the run is invalid input (`stopReason` `invalid-input`): Failed, with 0 company rows, no event charge and no run-notice. The same applies when other advanced-search filters are also set. This is not a Companies House form-validation error, and it is not the same as pasting the `/advanced-search` form page.

**Is this a live feed or an alert service?** Each run captures data available at that time. Repeated collection and any comparison, alerting or decisions require your own workflow.

**Will every field be populated?** No. The source may omit values, change a page or restrict access; check the original record before relying on it. A configured maximum does not guarantee that many results.

**What happens if Companies House blocks the run?** HTTP 403, 412 or 429 on robots.txt, a search page, a company overview or an enrichment page is retried after a 30 s backoff and then a 60 s backoff (two retries). If the block persists, the whole run stops with `blocked-<status>` (for example `blocked-429`). Rows already charged and written are kept. A login or sign-in redirect stops the run the same way (`blocked-<status>`, such as `blocked-302`, or `blocked-login-redirect` when no status is available). The Actor does not switch proxy or IP after a block. HTTP 5xx is retried with the same backoff and then recorded as an error while the run continues.

**What if a sub-page is blocked?** If the company overview succeeded but an officers, PSC, charges or filing-history page is then blocked, that company row is still charged and written with `enrichmentIncomplete` true, and the run then stops. In that situation `directorNames` or `pscNames` may be an empty array; use `enrichmentIncomplete=true` to distinguish a blocked sub-page from a company that really has no current directors or PSCs.

**Are empty searches charged?** If a block or error stops the run before any company is saved, the run is marked Failed and nothing is charged. A search that simply has no matching companies finishes successfully with 0 company rows and no event charge.

**What is the run-notice row?** At the end of every finished run except invalid input, the dataset includes one free `run-notice` row (`recordType` is `run-notice`, `charged` is false). Filter it out with `items.filter((i) => i.recordType !== 'run-notice')`.

**How does incremental mode work?** With `onlyNew` set, company numbers already stored under `stateRecordName` (default `companies-house-seen`, record `seenCompanyNumbers`; legacy input name `stateKey` is also accepted for backward compatibility) are skipped at the list stage: they are not requested or charged, and they are counted in `alreadySeenSkipped`. Only companies that were charged and written successfully are added to the seen set. In this mode, written rows have `isNew` true. When `onlyNew` is off, `isNew` is null and `alreadySeenSkipped` is 0.

**Is it legal to scrape Companies House?** This Actor reads publicly available pages on the Companies House find-and-update website. It does not log in or bypass access controls. You are responsible for whether your use of the data complies with applicable law and the site's terms. Companies House also offers an official API and a free bulk data product.

### API & SDK quickstart

Run this Actor programmatically via the official Apify Client libraries. Filter out the trailing free `run-notice` record (`item.recordType !== 'run-notice'`) when reading company rows.

#### JavaScript (`apify-client`)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });

const run = await client.actor('Stone_JadeX/uk-companies-house-scraper').call({
    searchQueries: ['tesco'],
    maxItems: 10,
    includeOfficers: true,
    onlyNew: true,
    stateRecordName: 'companies-house-seen',
    requestDelaySecs: 1,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
const companies = items.filter((item) => item.recordType !== 'run-notice');
console.log(`Collected ${companies.length} companies`);
```

#### Python (`apify-client`)

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])

run = client.actor("Stone_JadeX/uk-companies-house-scraper").call(run_input={
    "searchQueries": ["tesco"],
    "maxItems": 10,
    "includeOfficers": True,
    "onlyNew": True,
    "stateRecordName": "companies-house-seen",
    "requestDelaySecs": 1,
})

items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
companies = [item for item in items if item.get("recordType") != "run-notice"]
print(f"Collected {len(companies)} companies")
```

### Changelog

#### 2026-11-21

- Renamed incremental state store input `stateKey` to `stateRecordName` to avoid secret-field false positives in input validation while keeping full backward-compatible fallback for legacy `stateKey` inputs.
- Added explicit `prefill` defaults and organized `sectionCaption` input groupings across the input form.
- Added Store subscription tier discount note, JavaScript/Python `ApifyClient` SDK quickstart examples, and Changelog section to README.

# Changelog

This Actor's version history is a separate document: https://apify.com/stone_jadex/uk-companies-house-scraper/changelog.md

# Actor input Schema

## `searchQueries` (type: `array`):

Keywords to search on /search/companies?q=... (20 companies per page). Each keyword is searched in turn until maxItems is reached.

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

Company numbers to fetch directly (e.g. 00445790 or SC241685). All-digit numbers shorter than 8 digits are padded with leading zeros (445790 becomes 00445790).

## `startUrls` (type: `array`):

Optional Companies House search or company profile URLs on find-and-update.company-information.service.gov.uk. Also accepted: company sub-page URLs (/officers, /persons-with-significant-control, /charges, /filing-history), which are read as the company profile, and pasted advanced-search results URLs (/advanced-search/get-results?<filters>): these are crawled; all query parameters are kept, starting at the page=N in the URL (page 1 when absent) and moving on page by page (20 companies per page) until results run out or maxItems is reached. A /advanced-search form page (the search form, with no results) passes input validation but is not crawled: it adds a warning and an errors\[] entry in OUTPUT and the other inputs still run. If it is the only input, the run ends with stopReason errors, status Failed, 0 rows, and nothing is charged. Use the advanced-search filter fields instead, or paste the results page URL after running the search. A trailing slash on a supported path is accepted and removed (for example /advanced-search/get-results/, /search/companies/, /company/00445790/); /advanced-search/ (with a trailing slash) is the same form page as above (warning and errors\[], sole input → stopReason errors, Failed, 0 rows, no charge), not invalid-input. The page=N parameter in a start URL must be a whole number of at least 1; otherwise (for example 2.5, -1, 0 or foo) a warning "Ignored invalid page parameter ... starting at page 1." is added, the invalid page parameter is removed and the first request is page 1, for both /search/companies and /advanced-search/get-results start URLs. An empty page= counts as invalid (warning, page 1); a missing page parameter starts at page 1 without a warning. If an advanced-search results page shows a Companies House form validation error (for example Enter a valid SIC code), the run stops with stopReason errors and errors\[] quotes the Companies House text, a run-notice row is still pushed, and it is not no-results (0 rows: Failed, nothing charged; after rows were written the platform status is SUCCEEDED, with OUTPUT failed true, stopReason errors, and the written rows kept and charged).

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

Stop after this many company rows. Default 50; hard cap 1000. For bulk register exports use the official free Companies House bulk data product instead.

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

When true, fetch the company filing-history page and attach recent filing items to the row.

## `maxFilingHistoryPages` (type: `integer`):

Only used with includeFilingHistory. How many filing-history pages to read per company, newest first (25 filings per page, one request of about 2.4 s each). Default and hard cap 10 pages (250 filings): 0 or anything above 10 is treated as 10 (a warning is logged). Full history is not offered yet. filingHistoryTruncated is true when more filings exist.

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

When true, fetch officers/directors. Date of birth and individual correspondence/home addresses are stripped.

## `includePsc` (type: `boolean`):

When true, fetch persons with significant control. Date of birth and residential addresses are stripped.

## `includeCharges` (type: `boolean`):

When true, fetch the charges (mortgages) page and attach charge summaries.

## `requestDelaySecs` (type: `number`):

Minimum seconds between HTTP requests. Default 1 to stay polite; GOV.UK acceptable use discourages bulk scraping of the website.

## `companyNameIncludes` (type: `string`):

Optional advanced-search filter: company name must contain this text. Setting any advanced-search filter adds one combined advanced search (/advanced-search/get-results) to the run, after companyNumbers and before searchQueries/startUrls; all filters set are combined in that search. With several sicCodes there is one search per SIC code instead, and all other filters set (name, address, status, type, dates) are carried to each of them. An advanced search alone is enough input.

## `companyNameExcludes` (type: `string`):

Optional advanced-search filter: company name must not contain this text.

## `registeredOfficeAddress` (type: `string`):

Optional advanced-search filter: text matched against the registered office address, such as a town or postcode.

## `sicCodes` (type: `array`):

Optional advanced-search filter: SIC 2007 nature-of-business codes; each code is searched separately (Companies House accepts one SIC code per search), with the other advanced-search filters carried to every one of these searches; results are merged and de-duplicated by companyNumber, and only the unique rows actually written are charged. maxItems is shared across all SIC searches. A single entry holding several codes (for example "62012, 47110" or "62012 47110") is split on commas and whitespace first, with empty parts dropped and duplicates removed, and each code is then searched separately; the name and address filters are not split. If a provided sicCodes value contains only commas or whitespace and splits to an empty list, the run stops as invalid-input (platform Failed, 0 rows, nothing is charged, no run-notice), including when other advanced-search filters are also set.

## `companyStatus` (type: `array`):

Optional advanced-search filter: Companies House status values passed through as-is, such as active, dissolved, liquidation or administration (alias status: an input field named status is used when companyStatus is absent).

## `companyTypes` (type: `array`):

Optional advanced-search filter: Companies House company type values passed through as-is, such as ltd, plc or llp (alias type: an input field named type is used when companyTypes is absent).

## `incorporatedFrom` (type: `string`):

Optional advanced-search filter: earliest incorporation date. Format YYYY-MM-DD (any other format stops the run as invalid input). Sent to /advanced-search/get-results as day, month and year fields.

## `incorporatedTo` (type: `string`):

Optional advanced-search filter: latest incorporation date. Format YYYY-MM-DD (any other format stops the run as invalid input). Sent to /advanced-search/get-results as day, month and year fields.

## `dissolvedFrom` (type: `string`):

Optional advanced-search filter: earliest dissolution date. Format YYYY-MM-DD (any other format stops the run as invalid input). Sent to /advanced-search/get-results as day, month and year fields.

## `dissolvedTo` (type: `string`):

Optional advanced-search filter: latest dissolution date. Format YYYY-MM-DD (any other format stops the run as invalid input). Sent to /advanced-search/get-results as day, month and year fields.

## `onlyNew` (type: `boolean`):

Default false. When true, company numbers already recorded in the named key-value store stateRecordName (legacy alias stateKey) are skipped at the list stage (search results and companyNumbers): they are not requested or charged, and are counted in OUTPUT alreadySeenSkipped. Only companies that were charged and written successfully are added to the seen set, so a failed or blocked company is retried next run. Rows written in this mode carry isNew true.

## `stateRecordName` (type: `string`):

Only used with onlyNew. Name of the named key-value store that keeps the seen set under the record seenCompanyNumbers (an array of 8-character company numbers). Default companies-house-seen. Use a different name per saved search/task to keep separate seen sets; the named store persists between runs. Legacy alias: stateKey.

## Actor input object example

```json
{
  "searchQueries": [
    "tesco"
  ],
  "maxItems": 50,
  "includeFilingHistory": false,
  "maxFilingHistoryPages": 10,
  "includeOfficers": false,
  "includePsc": false,
  "includeCharges": false,
  "requestDelaySecs": 1,
  "companyNameIncludes": "BAKERY",
  "companyNameExcludes": "HOLDINGS",
  "registeredOfficeAddress": "Leeds",
  "sicCodes": [
    "62012"
  ],
  "companyStatus": [
    "active"
  ],
  "companyTypes": [
    "ltd"
  ],
  "incorporatedFrom": "2020-01-01",
  "incorporatedTo": "2020-12-31",
  "dissolvedFrom": "2023-01-01",
  "dissolvedTo": "2023-12-31",
  "onlyNew": false,
  "stateRecordName": "companies-house-seen"
}
```

# Actor output Schema

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

UK Companies House company rows in the default dataset. Officers, PSCs, charges and filing history are present only when the matching include option is enabled and the source page was read. The dataset also ends with one free run-notice row per finished run (recordType run-notice, except after invalid input).

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

Run statistics, HTTP counters, warnings, per-company errors, stop reason and status message saved to the key-value store record OUTPUT. Failed companies are reported here, not as dataset rows. Since the block-stop release: OUTPUT also has rowsPushed, charged, chargedButNotPushed (rows charged under pay-per-event whose pushData still failed after retries; they are not in the dataset), alreadySeenSkipped (onlyNew: already-seen company numbers skipped at the list stage; always 0 when onlyNew is off; not part of any duplicate count) and blockedHttpStatus (the blocking HTTP status, only when the run stopped on a block with a numeric status). stopReason values: no-more-results (finished, at least one row), maxItems, max-charge-reached, time-limit (stopped early before the run timeout, rows kept), no-results (nothing matched, nothing charged), invalid-input (bad input, no run-notice), errors, not-found-404, gone-410, http-5xx (no row written and the last company/search error was of that kind; the run fails; errors is also used for a Companies House form-validation stop, see below), and blocked-403, blocked-412, blocked-429, blocked-<status>, blocked-login-redirect. Blocking: HTTP 403, 412 or 429 on robots.txt, a search page, a company overview or an enrichment page is retried with a backoff of at least 30 s then 60 s (two retries); if it persists, the whole run stops with blocked-<status> (no proxy switch). Rows already charged and written are kept; an enrichment block still writes and charges that company with enrichmentIncomplete true, then stops. The run fails only when no row was written. A login/sign-in redirect stops the run the same way: with a redirect status it is reported as blocked-<status> (for example blocked-302), without a status as blocked-login-redirect. HTTP 5xx is retried with the same 30 s backoff and then recorded as an error while the run continues. Incremental mode: with onlyNew, company numbers in the named key-value store stateRecordName (legacy alias stateKey; record seenCompanyNumbers) are skipped at the list stage, so they are not requested or charged; the seen set is updated only with companies that were charged and written successfully. A free run-notice row is pushed to the dataset at the end of every finished run except invalid input, with reason = stopReason, rowsPushed, charged false, and httpStatus only when the run stopped on a block. An unsupported start URL (the /advanced-search form page) is not requested; it is recorded in warnings and errors and, if nothing else produces a row, the run fails with stopReason errors and nothing is charged. Companies House form validation: if an advanced-search results page shows a validation error, errors\[] gets "Companies House rejected the advanced-search filters: <Companies House text>" and the run stops at once (later SIC searches are not run) with stopReason errors and failed true; a run-notice row is still pushed. With 0 rows the run fails (platform status Failed) and nothing is charged. On a form validation error after rows were written the platform status SUCCEEDED (Actor.fail is not called), while OUTPUT failed true and stopReason errors are kept, the written rows are kept and charged, and the run-notice row is still pushed. So the platform run status and OUTPUT failed can differ: Actor.fail is called only when OUTPUT failed is true and no row was written; read OUTPUT failed and stopReason to detect a partial run (blocked-\* stops after rows also end SUCCEEDED, with failed false). This is not reported as no-results. A page=N in a start URL that is not a whole number of at least 1 adds the warning "Ignored invalid page parameter "<value>" in start URL; starting at page 1."

# 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 = {
    "searchQueries": [
        "tesco"
    ],
    "maxItems": 50,
    "stateRecordName": "companies-house-seen"
};

// Run the Actor and wait for it to finish
const run = await client.actor("stone_jadex/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 = {
    "searchQueries": ["tesco"],
    "maxItems": 50,
    "stateRecordName": "companies-house-seen",
}

# Run the Actor and wait for it to finish
run = client.actor("stone_jadex/uk-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 '{
  "searchQueries": [
    "tesco"
  ],
  "maxItems": 50,
  "stateRecordName": "companies-house-seen"
}' |
apify call stone_jadex/uk-companies-house-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,stone_jadex/uk-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/ijgKhFImQJ7Fmxbi0/builds/xtc85tnwiCLZsFuuP/openapi.json
