# UK Company Intelligence — Companies House Analysis (`perryay/uk-company-intelligence`) Actor

Enterprise-grade UK company intelligence on the official Companies House API. Five modes: profile, filing analysis, director network, portfolio monitor, search. Overdue detection, filing classification, PSC data, baseline monitoring. Free API key required. Per-success charging only.

- **URL**: https://apify.com/perryay/uk-company-intelligence.md
- **Developed by:** [Perry AY](https://apify.com/perryay) (community)
- **Categories:** Developer tools, 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 $0.01 / actor start

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/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 Company Intelligence 🏛️ — Companies House Analysis

**The analysis layer for UK Companies House data — overdue accounts detection, filing-history classification, director appointment networks, PSC overview, and portfolio change monitoring against baselines.**

Existing Companies House actors scrape or extract raw registry records. This actor does the layer above: it turns raw Companies House API data into **decisions**. It flags accounts that are overdue and by how many days, classifies the last 50 filings into meaningful buckets, maps which directors sit on multiple companies at once, tracks Persons with Significant Control, and diffs your watched portfolio against a stored baseline to surface exactly what changed since the last run.

This actor consumes the **official Companies House API** — you provide your own **free API key** (registration takes ~10 minutes). No Apify proxy, no website scraping, no HTML parsing. Honest metadata-only analysis: filing dates, statuses, counts, and patterns.

***

### ✨ Features

- **Accounts overdue detection** — `accounts_overdue` flag with exact `days_overdue` computed from the accounts due date, plus confirmation-statement due-soon warning (< 14 days)
- **Filing regularity metrics** — average days between the last 3 accounts filings, and accounts filing delay (days between period end and filing date)
- **Filing classification** — last N filings bucketed into accounts, confirmation-statement, accounts-capital, change-of-name, incorporation, charges, and other, with gap-trend analysis (lengthening / shortening / stable)
- **Director appointment networks** — cross-company officer edges with roles on both sides and `overlap_days` (the period a person simultaneously held both appointments)
- **PSC overview** — persons with significant control with ownership share and voting rights
- **Charges summary** — active charge count plus full status breakdown (active / satisfied / released / partially-satisfied)
- **Portfolio monitoring** — baseline snapshot diffing with KVS persistence: new filings, status changes, and overdue transitions between runs
- **Graceful degradation** — one bad company number, one 404, or one timeout never kills the run; per-company error rows instead
- **Rate-limit aware** — concurrency of 2, automatic 429 backoff honoring `Retry-After` (max 3 retries), 600 req/10min budget respected

### 🚀 Quick Start

#### 1. Get your free Companies House API key (~10 minutes)

1. Register at <https://developer.company-information.service.gov.uk>
2. Request an API key (free, immediate for most applicants — you may need to confirm your identity by phone for anti-fraud purposes)
3. Copy the key and paste it into the `api_key` input field

The key is yours, free, and rate-limited to 600 requests per 10 minutes. The actor never stores it anywhere except the run's input.

#### 2. Run a company profile

**Input:**

```json
{
  "mode": "company-profile",
  "company_numbers": ["00000000", "SC123456"],
  "api_key": "your-key"
}
```

#### 3. Monitor a portfolio for changes

First run establishes the baseline (persisted in the actor's key-value store); subsequent runs emit only what changed:

```json
{
  "mode": "portfolio-monitor",
  "company_numbers": ["00000000", "12345678", "OC987654"],
  "api_key": "your-key",
  "use_kvs_baseline": true
}
```

#### 4. Map director networks

```json
{
  "mode": "director-network",
  "company_numbers": ["00000000"],
  "api_key": "your-key",
  "max_officer_lookups": 10
}
```

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `mode` | select | `company-profile` | One of: `company-profile`, `filing-analysis`, `director-network`, `portfolio-monitor`, `search` |
| `company_numbers` | array | `[]` | UK company numbers (8 chars, e.g. `00000000`, `SC123456`). Spaces stripped, uppercased automatically |
| `query` | string | `""` | Company name to search (search mode only) |
| `api_key` | string | — | **Required.** Your free Companies House API key |
| `max_officer_lookups` | number | `5` | director-network: officers per company to fetch full appointment histories for (1–20) |
| `max_filings` | number | `50` | filing-analysis: number of recent filings to classify per company (1–100) |
| `use_kvs_baseline` | boolean | `true` | portfolio-monitor: persist/reload baseline via the actor key-value store |
| `baseline` | array | `[]` | Optional manual baseline: `[{company_number, accounts_filed_on, last_filing_date, status, accounts_overdue}]`. Takes precedence over KVS |

### Output Format

Rows are pushed to the default dataset. Row type is in the `type` field.

**Company profile row** (mode `company-profile`):

```json
{
  "type": "company",
  "company_number": "00000000",
  "name": "Example Manufacturing Ltd",
  "status": "active",
  "incorporated": "2018-06-15",
  "sic_codes": ["25990", "46900"],
  "age_years": 8.4,
  "accounts_overdue": true,
  "days_overdue": 32,
  "confirmation_due_soon": false,
  "officer_count": 2,
  "psc_count": 1,
  "active_charges": 2,
  "charge_statuses": {"active": 2, "satisfied": 1},
  "filing_regularity_days": 355,
  "last_accounts_delay_days": 71,
  "error": null
}
```

**Filing analysis row** (mode `filing-analysis`):

```json
{
  "type": "filing-analysis",
  "company_number": "00000000",
  "last_accounts_days_ago": 32,
  "last_confirmation_days_ago": 79,
  "accounts_overdue": true,
  "confirmation_overdue": false,
  "filing_buckets": {"accounts": 3, "confirmation-statement": 2, "accounts-capital": 0, "change-of-name": 1, "incorporation": 1, "charges": 0, "other": 4},
  "recent_filings": [{"date": "2026-09-30", "category": "accounts", "description": "Annual accounts made up to 31 March 2026", "bucket": "accounts"}],
  "filing_gap_days": [364, 365],
  "gap_trend": "stable",
  "error": null
}
```

**Officer edge row** (mode `director-network`):

```json
{
  "type": "officer-edge",
  "officer_name": "Alice Smith",
  "company_number_a": "00000000",
  "company_a_name": "Example Manufacturing Ltd",
  "company_number_b": "SC999999",
  "company_b_name": "Other Holdings Ltd",
  "role_a": "director",
  "role_b": "director",
  "overlap_days": 672
}
```

**Change row** (mode `portfolio-monitor`):

```json
{
  "type": "change",
  "company_number": "00000000",
  "change_type": "new_filing",
  "detail": "Annual accounts made up to 31 March 2026 (2026-09-30)",
  "baseline_date": "2026-06-01"
}
```

**Search result row** (mode `search`):

```json
{
  "type": "search-result",
  "company_number": "00000000",
  "title": "Example Ltd",
  "status": "active",
  "incorporated": "2020-01-01"
}
```

**Error row** (any mode — one bad company never kills the run):

```json
{"type": "error", "company_number": "99999999", "stage": "company-profile", "error": "HTTP 404: Not found: /company/99999999"}
```

**Summary row** (always last):

```json
{"type": "summary", "companies": 10, "errors": 1, "mode": "company-profile"}
```

### API Usage

Run the actor programmatically via the Apify API.

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/perryay~uk-company-intelligence/runs?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "company-profile",
    "company_numbers": ["00000000"],
    "api_key": "YOUR_COMPANIES_HOUSE_API_KEY"
  }'
```

#### Python (ApifyClient)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("perryay~uk-company-intelligence").call(
    run_input={
        "mode": "portfolio-monitor",
        "company_numbers": ["00000000"],
        "api_key": "YOUR_COMPANIES_HOUSE_API_KEY",
    }
)

dataset = client.dataset(run["defaultDatasetId"]).list_items()
for item in dataset.items:
    if item["type"] == "company" and item["accounts_overdue"]:
        print(f'{item["company_number"]} {item["name"]}: accounts {item["days_overdue"]} days overdue')
```

### Use Cases

1. **Due diligence** — Before signing a contract, pull a company profile: age, filing regularity, overdue accounts, active charges, and PSC ownership in one row. A 30-day-old accounts filing delay on a 10-year-old company is a negotiation fact.

2. **Credit risk monitoring** — Run `company-profile` over debtor companies weekly. `accounts_overdue` + `days_overdue` + `charge_statuses` feed straight into credit-score adjustments and limit reviews.

3. **Supplier onboarding** — Batch-check new suppliers: overdue accounts, confirmation-statement lapses, and dissolution risk surface before the first purchase order is issued.

4. **Competitor filing tracking** — `filing-analysis` on competitors reveals filing cadence (`filing_regularity_days`), name changes, capital statements, and charging activity — early signals of restructuring or distress.

5. **Director conflict checks** — `director-network` exposes cross-company appointments with `overlap_days`, supporting conflict-of-interest reviews, related-party detection, and onboarding compliance for your own board candidates.

### MCP Integration

UK Company Intelligence is available as a remote MCP server. Connect with OAuth using a URL-only configuration — no client ID or secret needed in the client config:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com"
    }
  }
}
```

Alternatively, authenticate with a Bearer token:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

Example prompts:

1. "Look up company 12345678 on Companies House and tell me if any accounts are overdue"
2. "Search for companies named 'Acme' and summarize their filing history"

You will need your own free Companies House API key (https://developer.company-information.service.gov.uk) to run lookups.

On first connection, your browser opens to sign in to Apify and authorize access.

Learn more: https://mcp.apify.com and https://docs.apify.com/integrations/mcp

### FAQ

**Q: Where do I get the Companies House API key?**
A: Register at [developer.company-information.service.gov.uk](https://developer.company-information.service.gov.uk). Registration is free and takes about 10 minutes (identity confirmation by phone may be required for anti-fraud purposes). Paste the key into the `api_key` input.

**Q: Is the API key really free?**
A: Yes — Companies House provides API keys free of charge for reasonable use. You pay only Apify's event charges for running this actor. The actor never stores or transmits your key anywhere except the Companies House API.

**Q: What are the rate limits?**
A: 600 requests per 10 minutes per API key. The actor uses concurrency of 2, retries 429 responses honoring the `Retry-After` header (up to 3 retries), and fails fast after a 401 so a bad key can't burn your quota. Budget roughly 6 requests per company in profile mode (~100 companies per 10-minute window per key).

**Q: Does this actor parse financial statements (revenue, profit, balance sheet)?**
A: **No — and it never fakes them.** The Companies House accounts endpoints expose filing metadata only (dates, types, overdue status). The API does not return financial statement figures, so this actor computes metadata-derived metrics instead: filing regularity, filing delay, overdue detection, counts, and trends. Any actor claiming financial ratios from this API is fabricating data.

**Q: How does portfolio-monitor baseline work?**
A: On the first run (no baseline found), the actor establishes a baseline snapshot per company — accounts filed date, last filing date, status, overdue flag — and emits a `baseline_established` row. With `use_kvs_baseline: true` (default), the snapshot is persisted to the actor's key-value store and reloaded on the next run, so each run reports only what changed since the previous one. You can also supply a manual `baseline` array (takes precedence), useful for backfilling history or CI pipelines.

**Q: What does `days_overdue` mean exactly?**
A: Calendar days between today and the next accounts due date from the Companies House accounts endpoint, floored at 0. `accounts_overdue` is the registry's own overdue flag, OR'd across the profile and accounts endpoints.

**Q: What is `filing_regularity_days`?**
A: The average number of days between the last 3 accounts filings found in the company's filing history. A company filing every ~365 days is regular; erratic gaps (e.g., 400, 200, 410) show up as a high-variance pattern. Requires at least 2 historical accounts filings; otherwise `null`.

**Q: What is `last_accounts_delay_days`?**
A: Days between the last accounts' period end date and the date they were actually filed (e.g., period ended 31 March, filed 10 June = 71 days). The statutory filing deadline is 9 months after period end for private companies — use this to gauge how close to the wire a company files.

**Q: Why is `officer_count` capped at 10?**
A: Profile mode fetches the first 10 officers and first 10 PSC entries to keep runs fast and cheap. The count reflects what was retrieved. For full officer lists, use the Companies House website or increase via the API directly.

**Q: How are filings classified into buckets?**
A: Each filing-history item is classified by its `category`, `sub_category`, and `description` into: `accounts`, `confirmation-statement`, `accounts-capital` (statements of capital), `change-of-name`, `incorporation`, `charges` (including satisfactions), and `other` (officer changes, registered-office changes, resolutions, etc.).

**Q: What happens with invalid company numbers?**
A: Each invalid number produces a `type: "error"` row with `stage: "validation"` and a clear message. Valid numbers in the same run continue unaffected. Numbers are normalized first (whitespace stripped, uppercased) and must be exactly 8 alphanumeric characters (including prefixes like `SC`, `OC`, `NI`, `FC`).

**Q: What happens if my API key is wrong or missing?**
A: A missing key produces a single friendly error row explaining how to register — never a crash. A rejected key (401) produces an error row for the first company and fails fast for the rest of the run without further requests, protecting your rate-limit budget.

**Q: Are 404s (company not found) charged?**
A: No. Errors of any kind — 404, 401, validation, network, timeout — are never charged. You pay only for successful analysis.

**Q: How is `overlap_days` in director-network computed?**
A: It is the inclusive number of days the officer's appointment at the queried company overlapped with their appointment at the other company, using appointed_on/resigned_on on both sides (an open-ended appointment counts as ongoing through today). 0 means the roles never overlapped; `null` means a start date was unknown.

**Q: Does the actor follow pagination for officers and PSC?**
A: Profile mode uses the first page (10 items) per endpoint by design. Filing history fetches up to `max_filings` (default 50). The Companies House API supports pagination via `start_index` if you need deeper history — a natural extension point.

**Q: Can I monitor dissolved or insolvent companies?**
A: Yes. The API returns records for dissolved companies; profile mode reports their status and metrics as-is. Charges and PSC data may be empty for dissolved entities — that is reflected honestly as zero counts, not errors.

**Q: Where does the baseline snapshot live?**
A: In the actor's default key-value store under the key `baseline` (JSON array of per-company snapshots). Clearing the actor's storage resets monitoring to first-run behavior.

### SEO Keywords

UK company intelligence, Companies House API, Companies House analysis, accounts overdue detection, UK company filing history, director appointment network, PSC significant control, company charges monitor, portfolio baseline monitoring, UK due diligence API, company age calculator, filing regularity analysis, Companies House rate limit, director conflict check, Apify actor UK companies

# Changelog

This Actor's version history is a separate document: https://apify.com/perryay/uk-company-intelligence/changelog.md

# Actor input Schema

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

company-profile: deep dive with overdue detection and filing metrics. filing-analysis: classify recent filings and compute gap trends. director-network: cross-company officer appointment edges. portfolio-monitor: diff current state vs a baseline snapshot. search: find companies by name.

## `company_numbers` (type: `array`):

UK company numbers to analyze (8 characters, e.g. 00000000, SC123456, OC123456). Spaces are stripped and letters uppercased automatically.

## `query` (type: `string`):

Company name or partial name to search for (search mode only).

## `api_key` (type: `string`):

Your FREE Companies House API key. Register in ~10 minutes at https://developer.company-information.service.gov.uk. Required at runtime.

## `max_officer_lookups` (type: `number`):

director-network mode: how many officers per company to fetch full appointment histories for (1-20).

## `max_filings` (type: `number`):

filing-analysis mode: how many recent filings to classify per company (1-100).

## `use_kvs_baseline` (type: `boolean`):

portfolio-monitor mode: persist and reload the baseline snapshot in the actor's key-value store between runs. Set false to rely solely on the manual 'baseline' input.

## `baseline` (type: `array`):

Optional manual baseline for portfolio-monitor mode: array of {company_number, accounts_filed_on, last_filing_date, status, accounts_overdue}. Takes precedence over the KVS baseline when provided.

## Actor input object example

```json
{
  "mode": "company-profile",
  "company_numbers": [
    "00000000"
  ],
  "query": "",
  "api_key": "your-key",
  "max_officer_lookups": 5,
  "max_filings": 50,
  "use_kvs_baseline": true,
  "baseline": []
}
```

# Actor output Schema

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

Per-company analysis rows (company, filing-analysis, officer-edge, change, search-result), error rows, and a final summary row in the default dataset

# 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": "company-profile",
    "company_numbers": [
        "00000000"
    ],
    "query": "",
    "api_key": "your-key",
    "baseline": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("perryay/uk-company-intelligence").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": "company-profile",
    "company_numbers": ["00000000"],
    "query": "",
    "api_key": "your-key",
    "baseline": [],
}

# Run the Actor and wait for it to finish
run = client.actor("perryay/uk-company-intelligence").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 '{
  "mode": "company-profile",
  "company_numbers": [
    "00000000"
  ],
  "query": "",
  "api_key": "your-key",
  "baseline": []
}' |
apify call perryay/uk-company-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,perryay/uk-company-intelligence"
        }
    }
}
```

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/PYS2cXSiiISndT3vl/builds/a7kdh1uYRbtUOaOkV/openapi.json
