{
  "openapi": "3.0.1",
  "info": {
    "title": "Scrape HNW in the UK",
    "description": "HNW UK — Find British Millionaires by Name, Every Morning.",
    "version": "0.1",
    "x-build-id": "FubEIttFO5222fBpD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/belcaidsaad~hnw-uk-pipeline/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-belcaidsaad-hnw-uk-pipeline",
        "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/belcaidsaad~hnw-uk-pipeline/runs": {
      "post": {
        "operationId": "runs-sync-belcaidsaad-hnw-uk-pipeline",
        "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/belcaidsaad~hnw-uk-pipeline/run-sync": {
      "post": {
        "operationId": "run-sync-belcaidsaad-hnw-uk-pipeline",
        "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": [
          "companiesHouseApiKey"
        ],
        "properties": {
          "companiesHouseApiKey": {
            "title": "Companies House API Key",
            "type": "string",
            "description": "Free REST API key from https://developer.company-information.service.gov.uk/. Not the OAuth client secret."
          },
          "minPersonalWealth": {
            "title": "Minimum Estimated Personal Wealth (£)",
            "minimum": 0,
            "type": "integer",
            "description": "Only emit individuals at or above this estimated wealth (EBITDA × industry multiple × ownership %). Default £5M.",
            "default": 5000000
          },
          "wealthBands": {
            "title": "Wealth Bands (filter)",
            "type": "array",
            "description": "Restrict output to specific wealth bands. Empty = all bands above the minimum. Pick from: £1M+, £5M+, £10M+, £25M+, £50M+, £100M+",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "ebitdaPreThreshold": {
            "title": "EBITDA Pre-Threshold (£) — advanced",
            "minimum": 0,
            "type": "integer",
            "description": "Skip companies below this EBITDA before any API enrichment. Leave at 0 to auto-derive from your minimum personal wealth (recommended).",
            "default": 0
          },
          "ownershipBands": {
            "title": "Ownership Bands (filter)",
            "type": "array",
            "description": "Only emit individuals in these ownership bands. Empty = all. Pick from: 25-50%, 50-75%, 75-100%",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "pscStatus": {
            "title": "PSC Status",
            "enum": [
              "all",
              "active",
              "ceased"
            ],
            "type": "string",
            "description": "active = current owners only. ceased = recent exits only (people who just sold and got paid — fresh liquidity). all = both, with each row labeled.",
            "default": "all"
          },
          "ukResidentOnly": {
            "title": "UK Residents Only",
            "type": "boolean",
            "description": "Drop individuals whose country of residence is not UK / England / Scotland / Wales / Northern Ireland.",
            "default": false
          },
          "regionPostcodePrefixes": {
            "title": "Region — Postcode Prefixes",
            "type": "array",
            "description": "Restrict to companies registered at these UK postcode prefixes. e.g. ['SW','W1','EC'] for central London, ['M'] for Manchester, ['EH'] for Edinburgh. Empty = whole UK.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "targetSicCodes": {
            "title": "Industry — Exact SIC Codes",
            "type": "array",
            "description": "Only include companies with these exact 5-digit SIC codes. Empty = all sectors.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "targetSicPrefixes": {
            "title": "Industry — SIC Prefixes",
            "type": "array",
            "description": "Match SIC code prefixes. e.g. ['62'] for IT/software, ['64','65','66'] for finance, ['86','87'] for healthcare.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "backfillDays": {
            "title": "Backfill Days",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Process the last N days of filings in addition to today. 0 = today only. 7 = past week. Useful for the first run when you want volume.",
            "default": 0
          },
          "bulkFileDate": {
            "title": "Bulk File Date Override",
            "type": "string",
            "description": "Override the end date (YYYY-MM-DD). Defaults to today. Combine with backfillDays to re-process a historical window."
          },
          "maxCorporatePscHops": {
            "title": "Max Corporate PSC Hops",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How deep to trace holding-company ownership chains. 3 covers most UK corporate structures.",
            "default": 3
          },
          "skipWeekendCheck": {
            "title": "Skip Weekend Check",
            "type": "boolean",
            "description": "Run even on Sun/Mon (CH won't have published, but useful for testing the actor end-to-end).",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}