{
  "openapi": "3.0.1",
  "info": {
    "title": "Companies House Search: UK Company Lookup & Monitor",
    "description": "Look up UK companies on the Companies House register by number, name or LEI, without an API key: status, address, SIC codes, filing due dates, overdue flags, previous names, LEI and parent companies. Monitor mode reports changes. Add your free API key for officers, PSC, filings and charges.",
    "version": "0.1",
    "x-build-id": "VbfsScggJdG0OctDS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fernandosord~uk-company-lookup-companies-house/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fernandosord-uk-company-lookup-companies-house",
        "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/fernandosord~uk-company-lookup-companies-house/runs": {
      "post": {
        "operationId": "runs-sync-fernandosord-uk-company-lookup-companies-house",
        "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/fernandosord~uk-company-lookup-companies-house/run-sync": {
      "post": {
        "operationId": "run-sync-fernandosord-uk-company-lookup-companies-house",
        "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",
        "required": [
          "companies"
        ],
        "properties": {
          "companies": {
            "title": "Companies",
            "type": "array",
            "description": "One company per line: a Companies House number (<code>00445790</code>, <code>SC045551</code>), a company name (<code>Marks and Spencer Group</code>) or a 20-character LEI. The type is detected automatically; start a line with <code>number:</code>, <code>name:</code> or <code>lei:</code> to force it.",
            "items": {
              "type": "string"
            }
          },
          "maxCandidates": {
            "title": "Candidates listed per name search",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "For each company name, the closest matches are listed in <code>candidates</code> with their company number and match score. Set to 0 to leave the list out.",
            "default": 5
          },
          "minNameScore": {
            "title": "Minimum name match score",
            "minimum": 30,
            "maximum": 100,
            "type": "integer",
            "description": "A name search returns a company only when its name scores at least this much (0 to 100) against the name you entered. Below it, the row is <code>not_found</code> and lists the candidates, so you can pick one by number.",
            "default": 60
          },
          "lookupAllCandidates": {
            "title": "Return every matching candidate in full",
            "type": "boolean",
            "description": "Off: a name search returns the best match only. On: every candidate above the minimum score (up to the number listed) gets its own full row, and each is charged as a lookup.",
            "default": false
          },
          "includeLei": {
            "title": "Add LEI and parent companies (GLEIF)",
            "type": "boolean",
            "description": "Look up the company's Legal Entity Identifier and its direct and ultimate parents in the GLEIF database. Free and keyless; turn off for slightly faster runs.",
            "default": true
          },
          "companiesHouseApiKey": {
            "title": "Companies House API key",
            "type": "string",
            "description": "Optional. Your own free REST API key from the Companies House Developer Hub. With it, each company also gets officers, persons with significant control, recent filings and charges, and name search covers dissolved companies. The key is stored encrypted and only sent to Companies House."
          },
          "includeOfficers": {
            "title": "Officers",
            "type": "boolean",
            "description": "Directors, secretaries and LLP members: name, role, appointment date, nationality, occupation and country of residence. Addresses and dates of birth are never included.",
            "default": true
          },
          "includePsc": {
            "title": "Persons with significant control",
            "type": "boolean",
            "description": "People and companies that control the company, with the nature of their control. Addresses and dates of birth are never included.",
            "default": true
          },
          "includeFilingHistory": {
            "title": "Filing history",
            "type": "boolean",
            "description": "The most recent filings, with date, type and a readable description.",
            "default": true
          },
          "filingHistoryLimit": {
            "title": "Filings per company",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many of the most recent filings to include.",
            "default": 10
          },
          "includeCharges": {
            "title": "Charges",
            "type": "boolean",
            "description": "Registered charges (mortgages and other security): status, dates and lenders.",
            "default": true
          },
          "includeResigned": {
            "title": "Include resigned officers and ceased PSCs",
            "type": "boolean",
            "description": "Off: only current officers and persons with significant control.",
            "default": false
          },
          "monitor": {
            "title": "Monitor mode",
            "type": "boolean",
            "description": "Compare each company with the version saved by the previous run under the same watch list name, and report changes to name, status, registered address, SIC codes, filing due dates, overdue flags, LEI and ultimate parent, plus officers and PSCs when you use an API key. The first run saves a baseline.",
            "default": false
          },
          "stateKey": {
            "title": "Watch list name",
            "type": "string",
            "description": "Saved versions are kept per watch list in the key-value store <code>plainsource-uk-company-lookup-state</code> of your account. Use a different name for each task. Renaming starts a fresh baseline.",
            "default": "default"
          },
          "onlyChanges": {
            "title": "Only output changed companies",
            "type": "boolean",
            "description": "In monitor mode, push rows only for companies that changed. Useful when an integration acts on every new dataset row. Unchanged companies are still looked up and charged.",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional. When at least one company changed, the run sends a POST to this https URL: a Slack or Discord incoming-webhook URL, or any endpoint that accepts JSON (Zapier, Make, n8n, your own server)."
          },
          "webhookFormat": {
            "title": "Webhook format",
            "enum": [
              "json",
              "slack",
              "discord"
            ],
            "type": "string",
            "description": "<b>JSON</b> sends the changes as data. <b>Slack</b> and <b>Discord</b> send a readable message.",
            "default": "json"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}