{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Company Accounts Feed: Net Assets & Distress",
    "description": "Daily Companies House accounts, one row per filing: net assets, cash and employees vs last year, plus signals such as net assets turned negative.",
    "version": "1.0",
    "x-build-id": "h6dk4jo7tUqidfkXC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mastazee_data_lab~uk-company-accounts-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mastazee_data_lab-uk-company-accounts-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/mastazee_data_lab~uk-company-accounts-feed/runs": {
      "post": {
        "operationId": "runs-sync-mastazee_data_lab-uk-company-accounts-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/mastazee_data_lab~uk-company-accounts-feed/run-sync": {
      "post": {
        "operationId": "run-sync-mastazee_data_lab-uk-company-accounts-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": {
          "signals": {
            "title": "Only filings with these signals",
            "type": "array",
            "description": "Keep a filing only if it has at least one of these signals. net_assets_turned_negative: net assets were zero or more last year and are below zero now. net_liabilities: net assets are below zero. cash_down_over_50pct: cash fell by more than half. dormant: the company reports itself dormant. first_accounts: no prior-year figures in the file. Clear the list to get every filing.",
            "items": {
              "type": "string",
              "enum": [
                "net_assets_turned_negative",
                "net_liabilities",
                "cash_down_over_50pct",
                "dormant",
                "first_accounts"
              ]
            },
            "default": [
              "net_assets_turned_negative"
            ]
          },
          "companyNumbers": {
            "title": "Watchlist of company numbers",
            "type": "array",
            "description": "Only return filings by these companies (8-character Companies House numbers such as 00445790 or SC123456; shorter numbers are zero-padded). Up to 10,000. With monitor mode on, you get a row the day any of them files accounts. Leave empty for the whole feed.",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "From file date",
            "type": "string",
            "description": "First daily file to read (YYYY-MM-DD). Leave empty to read only the most recent daily file. Companies House publishes Tuesday to Saturday; each file holds the accounts registered the previous day (Tuesday's: Saturday to Monday). A range may cover at most 14 days (about 10 daily files), counted up to 'To file date' or today."
          },
          "dateTo": {
            "title": "To file date",
            "type": "string",
            "description": "Last daily file to read (YYYY-MM-DD). Leave empty for today."
          },
          "latestFiles": {
            "title": "Number of latest daily files",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "When 'From file date' is empty: how many of the most recent daily files to read (1 = the latest only, at most 10). Each file is 50-600 MB.",
            "default": 1
          },
          "nameContains": {
            "title": "Company name contains",
            "type": "string",
            "description": "Only companies whose name, as tagged in the accounts, contains this text (not case-sensitive)."
          },
          "minNetAssets": {
            "title": "Minimum net assets",
            "type": "integer",
            "description": "Only filings with net assets of at least this amount, in the accounts' currency (usually GBP). Filings with no net assets figure are dropped when this is set."
          },
          "maxNetAssets": {
            "title": "Maximum net assets",
            "type": "integer",
            "description": "Only filings with net assets of at most this amount. Use 0 to find companies with net liabilities. Filings with no net assets figure are dropped when this is set."
          },
          "minEmployees": {
            "title": "Minimum average employees",
            "minimum": 0,
            "type": "integer",
            "description": "Only filings reporting at least this many average employees. Filings that do not report employees are dropped when this is set."
          },
          "monitorMode": {
            "title": "Monitor mode (each filing once)",
            "type": "boolean",
            "description": "For scheduled runs: remember the last daily file processed and the filings already delivered (under the state key below and your filters), and on every run process only later files, at most 10 per run. Schedule it Tuesday to Saturday after 07:00 UK time.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Name of this monitor's memory when monitor mode is on. Each set of filters keeps its own memory under this key; a second run of the same monitor while one is still running stops without output.",
            "default": "default"
          },
          "maxResults": {
            "title": "Maximum filings",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many rows. In monitor mode the next run continues where this one stopped.",
            "default": 500
          },
          "maxRuntimeSeconds": {
            "title": "Maximum run time (seconds)",
            "minimum": 60,
            "maximum": 36000,
            "type": "integer",
            "description": "Stop reading after this long and output what was found. The summary says whether the run stopped early.",
            "default": 1500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}