{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Companies House - Company Search + Officers + PSC",
    "description": "Search 5M UK companies by name or number. Extract directors, beneficial owners (PSC), SIC codes, filing history. AI enrichment. EU B2B 6-country suite with KvK+KBO+Handelsregister+Sirene+Bolagsverket. x402-ready.",
    "version": "0.1",
    "x-build-id": "n1kEhI4Z3KIReUQUT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/harvestlab~companies-house-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-harvestlab-companies-house-scraper",
        "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/harvestlab~companies-house-scraper/runs": {
      "post": {
        "operationId": "runs-sync-harvestlab-companies-house-scraper",
        "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/harvestlab~companies-house-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-harvestlab-companies-house-scraper",
        "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": {
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Company name or keyword to search on Companies House. E.g. 'Barclays Bank' or 'fintech London'."
          },
          "q": {
            "title": "Search query (alias)",
            "type": "string",
            "description": "Alias for searchQuery — short form for CLI use."
          },
          "companyNumbers": {
            "title": "Company numbers",
            "type": "array",
            "description": "List of UK company numbers for direct lookup. E.g. ['00445790', 'OC315819']. Overrides Search Query.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of companies to return in search mode (default: 10, max: 100).",
            "default": 10
          },
          "maxItems": {
            "title": "Max items (alias)",
            "minimum": 1,
            "type": "integer",
            "description": "Alias for maxResults — short form for CLI use."
          },
          "companiesHouseApiKey": {
            "title": "Companies House API key",
            "type": "string",
            "description": "Free API key from Companies House. Register at https://developer-specs.company-information.service.gov.uk/ — takes ~1 minute."
          },
          "includeOfficers": {
            "title": "Include officers",
            "type": "boolean",
            "description": "Fetch directors and company secretaries for each company. Adds 1 API call per company.",
            "default": false
          },
          "includePscs": {
            "title": "Include persons with significant control",
            "type": "boolean",
            "description": "Fetch beneficial owners (PSC) for each company — who owns 25%+ of shares or voting rights. Adds 1 API call per company.",
            "default": false
          },
          "includeFilingHistory": {
            "title": "Include filing history",
            "type": "boolean",
            "description": "Fetch the 10 most recent Companies House filings per company (accounts, confirmation statements, etc.). Adds 1 API call per company.",
            "default": false
          },
          "enableAiAnalysis": {
            "title": "Enable AI business analysis",
            "type": "boolean",
            "description": "Run AI business profile scoring and sector classification on each company. Requires an LLM API key. Charged as ai-analysis-completed ($0.005) per company analysed.",
            "default": false
          },
          "llmProvider": {
            "title": "LLM provider",
            "enum": [
              "openrouter",
              "anthropic",
              "google",
              "openai",
              "ollama"
            ],
            "type": "string",
            "description": "AI provider for business analysis.",
            "default": "openrouter"
          },
          "llmModel": {
            "title": "LLM model override",
            "type": "string",
            "description": "Override the default model for your chosen provider. Leave empty to use the recommended default."
          },
          "openrouterApiKey": {
            "title": "OpenRouter API key",
            "type": "string",
            "description": "OpenRouter API key. Get one at https://openrouter.ai/keys — or set OPENROUTER_API_KEY env var."
          },
          "anthropicApiKey": {
            "title": "Anthropic API key",
            "type": "string",
            "description": "Anthropic API key. Get one at https://console.anthropic.com/settings/keys — or set ANTHROPIC_API_KEY env var."
          },
          "googleApiKey": {
            "title": "Google AI API key",
            "type": "string",
            "description": "Google AI Studio API key. Get one at https://aistudio.google.com/app/apikey — or set GOOGLE_API_KEY env var."
          },
          "openaiApiKey": {
            "title": "OpenAI API key",
            "type": "string",
            "description": "OpenAI API key. Get one at https://platform.openai.com/api-keys — or set OPENAI_API_KEY env var."
          },
          "ollamaBaseUrl": {
            "title": "Ollama base URL",
            "type": "string",
            "description": "Ollama server URL. Default: http://localhost:11434. Install Ollama at https://ollama.com/download."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy. Companies House API is public — proxy not required but may help avoid rate limits."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}