{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Companies House Feed: New Companies, Directors, Insolvency",
    "description": "New UK companies filtered by SIC code and region, plus director appointments and resignations, insolvency cases and overdue accounts, straight from the official Companies House APIs with your own free key. Built for scheduled runs.",
    "version": "0.1",
    "x-build-id": "8nL12W4jM0HmSFqSV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/longlever~uk-companies-house-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-longlever-uk-companies-house-feed",
        "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/longlever~uk-companies-house-feed/runs": {
      "post": {
        "operationId": "runs-sync-longlever-uk-companies-house-feed",
        "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/longlever~uk-companies-house-feed/run-sync": {
      "post": {
        "operationId": "run-sync-longlever-uk-companies-house-feed",
        "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": {
          "apiKey": {
            "title": "Companies House REST API key",
            "type": "string",
            "description": "Your own free key from developer.company-information.service.gov.uk (create an application, then a REST key). Needed for new incorporations, and for SIC or region filtering of officer and insolvency events. Stored encrypted by Apify."
          },
          "streamKey": {
            "title": "Companies House Streaming API key",
            "type": "string",
            "description": "Your own free Streaming key from the same developer hub (a separate key type; REST keys do not work here). Needed for officer, insolvency and overdue-accounts events."
          },
          "includeIncorporations": {
            "title": "New incorporations",
            "type": "boolean",
            "description": "Companies newly registered at Companies House, from the advanced company search. Needs the REST key.",
            "default": true
          },
          "includeOfficerChanges": {
            "title": "Director and officer appointments and resignations",
            "type": "boolean",
            "description": "From the officers stream. Needs the Streaming key.",
            "default": false
          },
          "includeInsolvency": {
            "title": "Insolvency cases",
            "type": "boolean",
            "description": "New and updated insolvency cases (liquidations, administrations, voluntary arrangements) from the insolvency stream. Needs the Streaming key.",
            "default": false
          },
          "includeOverdue": {
            "title": "Overdue accounts and confirmation statements",
            "type": "boolean",
            "description": "Companies whose accounts or confirmation statement Companies House marks as overdue, tracked from the company profile stream (needs the Streaming key). With a watchlist and the REST key, each listed company is checked directly instead.",
            "default": false
          },
          "sicCodes": {
            "title": "SIC codes",
            "type": "array",
            "description": "Keep companies with any of these SIC codes. Use full 5-digit codes (62012) or shorter prefixes (62 for all computer programming and consultancy). Leave empty for every industry.",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Keep companies whose registered office postcode is in any of these UK regions. Matching is by postcode area, so areas on a border count for both regions.",
            "items": {
              "type": "string",
              "enum": [
                "london",
                "south-east",
                "south-west",
                "east-of-england",
                "east-midlands",
                "west-midlands",
                "north-east",
                "north-west",
                "yorkshire-and-the-humber",
                "wales",
                "scotland",
                "northern-ireland"
              ],
              "enumTitles": [
                "London",
                "South East",
                "South West",
                "East of England",
                "East Midlands",
                "West Midlands",
                "North East",
                "North West",
                "Yorkshire and the Humber",
                "Wales",
                "Scotland",
                "Northern Ireland"
              ]
            }
          },
          "postcodePrefixes": {
            "title": "Postcode prefixes",
            "type": "array",
            "description": "Keep companies whose registered office postcode starts with any of these, for example M, LS1, EC2A or SW1. Combined with Regions as either-or.",
            "items": {
              "type": "string"
            }
          },
          "location": {
            "title": "Location text (incorporations only)",
            "type": "string",
            "description": "Free text that Companies House matches against the registered office address, for example a town name. Applied by Companies House's own search."
          },
          "companyStatus": {
            "title": "Company status (incorporations only)",
            "type": "array",
            "description": "Company statuses to include. New companies are almost always active.",
            "default": [
              "active"
            ],
            "items": {
              "type": "string"
            }
          },
          "companyTypes": {
            "title": "Company types (incorporations only)",
            "type": "array",
            "description": "Limit to these Companies House company types, for example ltd, llp, plc, private-limited-guarant-nsc. Leave empty for all types.",
            "items": {
              "type": "string"
            }
          },
          "companyNumbers": {
            "title": "Watchlist of company numbers (change feeds only)",
            "type": "array",
            "description": "Only return officer, insolvency and overdue events for these companies, for example 00445790 or SC123456. Overrides the SIC and region filters for those feeds and needs no company lookups.",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only companies not returned before",
            "type": "boolean",
            "description": "Skip new incorporations an earlier run with the same filters already returned, so a schedule gives you each company once. Turn off for a full list of the window every run.",
            "default": true
          },
          "lookbackDays": {
            "title": "Days to look back",
            "minimum": 1,
            "maximum": 31,
            "type": "integer",
            "description": "Search companies incorporated today and this many days before. Companies House search can index a company a day or two after it is registered, so 3 or more catches late arrivals; with Only new on, they are still returned once.",
            "default": 3
          },
          "maxIncorporations": {
            "title": "Max new companies per run",
            "minimum": 0,
            "type": "integer",
            "description": "0 means no limit. Newest companies first. With Only new on, companies over the limit are returned by the next run.",
            "default": 0
          },
          "officerDetail": {
            "title": "Officer detail level",
            "enum": [
              "minimal",
              "standard",
              "full"
            ],
            "type": "string",
            "description": "How much officer data to output. Minimal is name, role and dates. Standard adds nationality, occupation and country of residence. Full adds month and year of birth and the correspondence address. All of it is published by Companies House; only output what your use needs (see the README on UK GDPR).",
            "default": "minimal"
          },
          "appointmentRecencyDays": {
            "title": "Appointment counts as new within days",
            "minimum": 1,
            "type": "integer",
            "description": "An officer record edit is reported as an appointment only if the appointment date is within this many days. Older records that change (for example an address update) are skipped unless the option below is on.",
            "default": 30
          },
          "includeOfficerUpdates": {
            "title": "Also report other officer record edits",
            "type": "boolean",
            "description": "Report edits to existing officer records (address, name or occupation changes) as officer_updated events.",
            "default": false
          },
          "lookupCompanyDetails": {
            "title": "Add company details to officer and insolvency events",
            "type": "boolean",
            "description": "Look up the company name, SIC codes and address for each event. This happens anyway when SIC or region filters are set. Uses your REST key and quota.",
            "default": false
          },
          "maxCompanyLookups": {
            "title": "Max company lookups per run",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on REST lookups for officer and insolvency events (Companies House allows 600 calls per 5 minutes per key). When filtering needs more, the run stops reading and the next run continues from there. Lookups are cached for 30 days.",
            "default": 2000
          },
          "maxStreamSeconds": {
            "title": "Max seconds per stream",
            "minimum": 15,
            "maximum": 3000,
            "type": "integer",
            "description": "Time limit for reading each stream in one run, including company lookups. A stream stops earlier once it has caught up with the present. The next run continues where this one stopped.",
            "default": 600
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Optional name for the saved progress. By default it comes from your filters, so changing them starts fresh. Set the same key in two tasks only if they should share progress."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}