{
  "openapi": "3.0.1",
  "info": {
    "title": "GovData Labs — UK Companies House Enrichment",
    "description": "GovData Labs enriches UK companies and lists new incorporations from the official Companies House API.",
    "version": "1.0",
    "x-build-id": "qfBhlj0uhKolAl0vd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/govdatalabs~govdata-labs-companies-house-enrichment/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-govdatalabs-govdata-labs-companies-house-enrichment",
        "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/govdatalabs~govdata-labs-companies-house-enrichment/runs": {
      "post": {
        "operationId": "runs-sync-govdatalabs-govdata-labs-companies-house-enrichment",
        "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/govdatalabs~govdata-labs-companies-house-enrichment/run-sync": {
      "post": {
        "operationId": "run-sync-govdatalabs-govdata-labs-companies-house-enrichment",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "enrich",
              "incorporations"
            ],
            "type": "string",
            "description": "enrich looks up companies you list. incorporations lists companies incorporated in a date range.",
            "default": "enrich"
          },
          "companyNumbers": {
            "title": "Company numbers",
            "type": "array",
            "description": "Companies House numbers. Digits are padded to 8 characters. Scottish and other prefixed numbers such as SC123456 are kept.",
            "items": {
              "type": "string"
            }
          },
          "companyNames": {
            "title": "Company names",
            "type": "array",
            "description": "Names to search. The best fuzzy match above the threshold is enriched. Up to three close matches are returned when scores are nearly tied.",
            "items": {
              "type": "string"
            }
          },
          "apiKey": {
            "title": "Companies House API key",
            "type": "string",
            "description": "Your REST API key from https://developer.company-information.service.gov.uk/manage-applications. You can also set COMPANIES_HOUSE_API_KEY. The key is not logged."
          },
          "incorporatedFrom": {
            "title": "Incorporated from",
            "type": "string",
            "description": "Start date YYYY-MM-DD for the incorporations feed. Defaults to 7 days before today."
          },
          "incorporatedTo": {
            "title": "Incorporated to",
            "type": "string",
            "description": "End date YYYY-MM-DD, inclusive. Defaults to today."
          },
          "sicCodes": {
            "title": "SIC codes",
            "type": "array",
            "description": "Optional 4 or 5 digit SIC codes for the incorporations feed.",
            "items": {
              "type": "string"
            }
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "Optional location string passed to Companies House advanced search, for example London or Manchester."
          },
          "incorporationSource": {
            "title": "Incorporation source",
            "enum": [
              "advanced-search",
              "stream"
            ],
            "type": "string",
            "description": "advanced-search backfills a date range. stream follows the Companies House streaming API from streamTimepoint and is meant for forward polling, not history.",
            "default": "advanced-search"
          },
          "streamTimepoint": {
            "title": "Stream timepoint",
            "type": "integer",
            "description": "Required for stream mode. Use the nextTimepoint from the previous run's output."
          },
          "enrichIncorporations": {
            "title": "Fully enrich each incorporation",
            "type": "boolean",
            "description": "Off by default. When on, each new company also loads officers, PSCs, and charges. That uses more of the 600 requests / 5 minutes quota.",
            "default": false
          },
          "includeOfficers": {
            "title": "Include officers",
            "type": "boolean",
            "description": "Load the officers list during enrichment.",
            "default": true
          },
          "includePersonsWithSignificantControl": {
            "title": "Include persons with significant control",
            "type": "boolean",
            "description": "Load the PSC list during enrichment.",
            "default": true
          },
          "includeCharges": {
            "title": "Include charges",
            "type": "boolean",
            "description": "Load the charges summary during enrichment.",
            "default": true
          },
          "nameMatchThreshold": {
            "title": "Name match threshold",
            "minimum": 0.5,
            "maximum": 1,
            "type": "number",
            "description": "Minimum fuzzy score for a name search. Active companies get a small boost.",
            "default": 0.84
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on output rows. Enrichment defaults to 25 because each company can take several API calls. Each row is billed as company-result.",
            "default": 25
          },
          "maxSectionItems": {
            "title": "Max officers, PSCs, or charges",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Cap on related records stored on each company.",
            "default": 50
          },
          "maxRequestsPerFiveMinutes": {
            "title": "Request budget per 5 minutes",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Companies House allows 600 requests per 5 minutes per key. The default of 500 leaves headroom if the key is shared.",
            "default": 500
          },
          "maxStreamEvents": {
            "title": "Max stream events to scan",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Stop reading the stream after this many events even if fewer companies matched.",
            "default": 2000
          },
          "onlyChangesSinceLastRun": {
            "title": "Only changes since last run",
            "type": "boolean",
            "description": "The first run stores a baseline and bills company-result only. Later runs emit new or changed profiles and also bill change-detected.",
            "default": false
          },
          "snapshotStoreName": {
            "title": "Snapshot store name",
            "type": "string",
            "description": "Named key-value store for the company snapshot and the stream timepoint.",
            "default": "companies-house-snapshots"
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}