{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Companies House Lead Scraper - Directors & PSC",
    "description": "UK Companies House scraper for B2B lead enrichment: company search, directors, PSC beneficial owners, SIC codes, filing history, and AI summaries. Official API records for sales, compliance, and research. x402-ready PPE at $0.005/company.",
    "version": "0.1",
    "x-build-id": "TawTKeAxfcvrNFYrW"
  },
  "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."
          },
          "query": {
            "title": "Query (CLI alias)",
            "type": "string",
            "description": "Alias for searchQuery. Hidden from Console form."
          },
          "companyNumbers": {
            "title": "Company numbers",
            "type": "array",
            "description": "List of UK company numbers for direct lookup. E.g. ['00445790', 'OC315819']. Can be combined with Search Query.",
            "items": {
              "type": "string"
            }
          },
          "companyNumber": {
            "title": "Company number (CLI alias)",
            "type": "string",
            "description": "Alias for companyNumbers when looking up a single UK company number. Hidden from Console form."
          },
          "url": {
            "title": "Company URL (CLI alias)",
            "type": "string",
            "description": "Alias for a Companies House company profile URL. Hidden from Console form."
          },
          "startUrls": {
            "title": "Start URLs (CLI alias)",
            "type": "array",
            "description": "Alias for direct lookup URLs using Apify startUrls-style objects. Hidden from Console form.",
            "items": {
              "type": "object",
              "required": [],
              "properties": {
                "url": {
                  "title": "URL",
                  "description": "Companies House company profile URL.",
                  "type": "string"
                },
                "companyNumber": {
                  "title": "Company number",
                  "description": "Companies House company number.",
                  "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 for AI analysis. Set OPENROUTER_API_KEY env var OR openrouterApiKey input. Get one at https://openrouter.ai/keys."
          },
          "anthropicApiKey": {
            "title": "Anthropic API key",
            "type": "string",
            "description": "Anthropic API key for AI analysis. Set ANTHROPIC_API_KEY env var OR anthropicApiKey input. Get one at https://console.anthropic.com/settings/keys."
          },
          "googleApiKey": {
            "title": "Google AI API key",
            "type": "string",
            "description": "Google AI API key for Gemini analysis. Set GOOGLE_API_KEY env var OR googleApiKey input. Get one at https://aistudio.google.com/app/apikey."
          },
          "openaiApiKey": {
            "title": "OpenAI API key",
            "type": "string",
            "description": "OpenAI API key for AI analysis. Set OPENAI_API_KEY env var OR openaiApiKey input. Get one at https://platform.openai.com/api-keys."
          },
          "ollamaBaseUrl": {
            "title": "Ollama base URL",
            "type": "string",
            "description": "Ollama base URL for self-hosted analysis. Set ollamaBaseUrl input or run Ollama locally. Install at https://ollama.com/download. Default: http://localhost:11434."
          },
          "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}