# UK Companies House Enrichment & B2B Intel API (`based_data/uk-companies-query-actor`) Actor

Two-tier UK company search & B2B enrichment. Tier 1: Fuzzy name search ($0.005/event). Tier 2: Deep profiles including financials, technographics, DNS/email security auditing, PECR compliance, and live hiring activity ($0.15/event). Pay-Per-Event (PPE) model.

- **URL**: https://apify.com/based\_data/uk-companies-query-actor.md
- **Developed by:** [Adam Beaumont](https://apify.com/based_data) (community)
- **Categories:** Agents, Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 company searches

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 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 Enrichment & B2B Intel API

Exposes an enterprise-grade, two-tiered business intelligence query interface for UK Companies House records under the **Pay-Per-Event (PPE)** pricing model. Ideal for sales intelligence, automated lead enrichment, cold outreach compliance auditing, cybersecurity risk assessment, and HR tech integrations.

---

### ⚡ What This Actor Does

This actor bypasses basic registry lookups by returning a fully enriched, commercial-ready profile of active, medium-to-large UK corporate entities. It integrates multi-source intelligence—combining official government registry details, corporate financial statements, email/DNS security auditing, active web technographics, and live applicant tracking systems (ATS) hiring data.

> [!IMPORTANT]
> **Enrichment Scope Constraint**
> Comprehensive enrichment profiles (Tier 2) are **strictly generated and stored only for active, medium-to-large corporate targets** (e.g., companies that file detailed financial statements, have active digital footprints, or run active recruitment). 
> 
> Queries for micro-entities, small businesses, sole traders, or dormant/inactive entities **will return a 404-style error payload** (and will NOT charge you the premium Tier 2 billing event rate).

The actor operates in two cost-optimized tiers:

#### 🔍 Tier 1: Fuzzy Name Search (`company-search`)
*   **Purpose**: Resolve partial or fuzzy company names to absolute identifiers.
*   **Performance**: Sub-100ms response times powered by a pre-indexed Key-Value store (with native Google BigQuery fallback).
*   **Data Returned**: Company name, registration number, registration status, and postcode.

#### 💎 Tier 2: Detailed Enrichment (`company-detail`)
*   **Purpose**: Retrieve the full B2B intelligence profile using an 8-digit company number.
*   **Target Scope**: **Limited to active, medium-to-large corporate targets.** Queries for companies outside this scope return a 404-style error message to avoid charging premium billing events.

*   **Data Returned**: Comprehensive corporate profiling containing:
    *   **Registry & Financials**: Net assets, annual turnover, employee counts, and balance sheet dates.
    *   **Web Technographics**: Instantly detects active frameworks and trackers on their domain (WordPress, Shopify, Next.js, Webflow, Google Tag Manager, GA4, HubSpot, Hotjar, Meta Pixel, Intercom, Zendesk).
    *   **Email & DNS Audit**: Identifies active ESP providers (Google Workspace, Office 365, etc.) and performs a real-time SPF, DMARC, and DKIM selector safety audit to generate an aggregate **Cyber Hygiene Score (0-100)** and risk tier.
    *   **ATS & Recruiting Scans**: Queries live recruitment endpoints (Greenhouse, Workday, Lever, Workable, etc.) to fetch the exact count of active job listings and details of open roles.
    *   **PECR Cold Email Compliance**: Calculates corporate eligibility and provides legal justification for cold B2B outreach under UK PECR laws.
    *   **ICO Triangulation**: Verifies registration status on the official UK Information Commissioner's Office data protection register.

---

### ⚙️ Input Schema

The actor accepts the following parameters. You must supply either `companyName` (for Tier 1 Search) or `companyNumber` (for Tier 2 Detail lookup).

| Field | Type | Title | Description |
| :--- | :--- | :--- | :--- |
| `companyName` | `string` | Company Name (Fuzzy Search) | Fuzzy or partial company name (e.g., `"Tesco"`). Activates **Tier 1 Search Mode**. |
| `companyNumber` | `string` | Company Number (Premium Lookup) | Exact 8-digit UK company number (e.g., `"01234567"`). Activates **Tier 2 Detail Mode**. *Note: Enriched profiles only exist for active, larger corporate targets (medium/large enterprises).* |
| `maxSearchResults` | `integer` | Max Search Results | Maximum results to return in Tier 1 Search (Default: `10`, Max: `100`). |

#### Input JSON Examples

##### 1. Fuzzy Name Search (Tier 1)
```json
{
  "companyName": "Tesco",
  "maxSearchResults": 5
}
````

##### 2. Detailed B2B Profile Lookup (Tier 2)

```json
{
  "companyNumber": "00471817"
}
```

***

### 📊 Output Schema (Tier 2 Example)

When querying via `companyNumber` in Tier 2, the actor yields a rich, structured intelligence profile formatted as a JSON object:

```json
{
  "company_number": "00471817",
  "company_name": "TESCO PLC",
  "last_enriched_at": "2026-07-05T12:30:45Z",
  "enrichment_status": "completed",
  "resolved_domain": "tescoplc.com",
  "email_provider": "Microsoft Office 365",
  "dns_security": {
    "cyber_hygiene_score": 85,
    "cyber_security_risk_tier": "Low Risk",
    "spf": {
      "valid": true,
      "record": "v=spf1 include:spf.protection.outlook.com -all",
      "warnings": []
    },
    "dmarc": {
      "valid": true,
      "record": "v=DMARC1; p=reject; pct=100; rua=mailto:dmarc-rua@tescoplc.com",
      "warnings": []
    },
    "dkim": {
      "has_active_selector": true,
      "selectors_checked": {
        "selector1": "active"
      }
    },
    "mx_hosts": [
      "tescoplc-com.mail.protection.outlook.com"
    ],
    "issues": []
  },
  "compliance": {
    "is_corporate_subscriber": true,
    "legal_entity_type": "plc"
  },
  "technographics": {
    "wordpress": false,
    "shopify": false,
    "gtm": true,
    "hubspot": false,
    "ga4": true,
    "meta_pixel": true,
    "hotjar": false,
    "intercom": false,
    "zendesk": false,
    "nextjs": true,
    "webflow": false
  },
  "recruiting": {
    "is_hiring": true,
    "ats_source": "Workday",
    "roles_count": 18,
    "roles_extracted": [
      {
        "title": "Lead Software Engineer - Python",
        "location": "Welwyn Garden City",
        "url": "https://tesco.wd3.myworkdayjobs.com/Careers/job/Lead-Software-Engineer"
      }
    ]
  },
  "ico_triangulation": {
    "registered": true,
    "registration_number": "Z6294371",
    "tier": "Tier 3",
    "expiry_date": "2027-01-20"
  },
  "financial_metrics": {
    "net_assets": 11842000000.0,
    "turnover": 68193000000.0,
    "employee_count": 330000,
    "balance_sheet_date": "2026-02-28"
  },
  "commercial_insights": {
    "company_size_segment": "Enterprise",
    "outreach_eligibility": {
      "can_cold_email": true,
      "compliance_reason": "Legitimate interest allowed for UK corporate entities (LTD, PLC, LLP) under PECR rules"
    },
    "cyber_security_risk_tier": "Low Risk",
    "growth_hiring_indicator": "High Growth"
  }
}
```

***

### 💡 Key Use Cases

1. **Lead Enrichment & Scoring**: Automatically feed Companies House numbers from forms into the actor to instantly qualify prospects by employee size, technology stack, and hiring status.
2. **Cold Outreach Compliance Filters**: Filter out sole traders and partnerships automatically to ensure your email campaigns strictly adhere to UK PECR regulations.
3. **Cyber Hygiene Analysis**: Audit the DNS records (SPF, DMARC, DKIM) of target lists to score domain safety and identify prospects in need of cybersecurity solutions.
4. **Technographic Profiling**: Target companies using specific technologies (e.g., Next.js, HubSpot, Shopify) for hyper-targeted product positioning.
5. **Recruiting & Growth Signals**: Track active roles on target company boards to identify hiring expansion and allocate resources or outreach efforts effectively.

# Actor input Schema

## `companyName` (type: `string`):

A fuzzy, partial, or full company name (e.g., 'Tesco'). Activates Tier 1 Search Mode for rapid lookup (sub-100ms response).

## `companyNumber` (type: `string`):

An 8-digit UK company registration number (e.g., '01234567'). Activates Tier 2 Detailed Enrichment. Note: Enriched profiles are strictly generated for active, larger corporate targets (e.g., medium/large enterprises with filed accounts, digital footprints, or active recruitment). Queries for micro-entities, dormant, or inactive businesses will return a 404-style error payload (no event charges apply).

## `maxSearchResults` (type: `integer`):

The maximum number of search records to return in Tier 1 Search Mode (capped at 100).

## Actor input object example

```json
{
  "maxSearchResults": 10
}
```

# Actor output Schema

## `defaultDatasetUrl` (type: `string`):

The dataset containing either the list of search results (Tier 1) or the detailed B2B corporate profile (Tier 2).

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("based_data/uk-companies-query-actor").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("based_data/uk-companies-query-actor").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 '{}' |
apify call based_data/uk-companies-query-actor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "UK Companies House Enrichment & B2B Intel API",
        "description": "Two-tier UK company search & B2B enrichment. Tier 1: Fuzzy name search ($0.005/event). Tier 2: Deep profiles including financials, technographics, DNS/email security auditing, PECR compliance, and live hiring activity ($0.15/event). Pay-Per-Event (PPE) model.",
        "version": "1.0",
        "x-build-id": "MpPbLniCkd7VUxsX9"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/based_data~uk-companies-query-actor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-based_data-uk-companies-query-actor",
                "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/based_data~uk-companies-query-actor/runs": {
            "post": {
                "operationId": "runs-sync-based_data-uk-companies-query-actor",
                "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/based_data~uk-companies-query-actor/run-sync": {
            "post": {
                "operationId": "run-sync-based_data-uk-companies-query-actor",
                "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",
                "properties": {
                    "companyName": {
                        "title": "Company Name (Fuzzy Search)",
                        "type": "string",
                        "description": "A fuzzy, partial, or full company name (e.g., 'Tesco'). Activates Tier 1 Search Mode for rapid lookup (sub-100ms response)."
                    },
                    "companyNumber": {
                        "title": "Company Number (Premium Lookup)",
                        "type": "string",
                        "description": "An 8-digit UK company registration number (e.g., '01234567'). Activates Tier 2 Detailed Enrichment. Note: Enriched profiles are strictly generated for active, larger corporate targets (e.g., medium/large enterprises with filed accounts, digital footprints, or active recruitment). Queries for micro-entities, dormant, or inactive businesses will return a 404-style error payload (no event charges apply)."
                    },
                    "maxSearchResults": {
                        "title": "Max Search Results",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "The maximum number of search records to return in Tier 1 Search Mode (capped at 100).",
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
