{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Late Payers & Payment Practices Scraper",
    "description": "Official UK payment practices reports joined with Companies House: days to pay, % paid late, trend vs prior report, e-invoicing / supply chain finance gaps, terms over 60 days. Filters by sector, region, size. Monitor mode returns only changes.",
    "version": "1.3",
    "x-build-id": "m5MnfxZrq4T3HPzMh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/battles_2026~uk-late-payer-signals/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-battles_2026-uk-late-payer-signals",
        "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/battles_2026~uk-late-payer-signals/runs": {
      "post": {
        "operationId": "runs-sync-battles_2026-uk-late-payer-signals",
        "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/battles_2026~uk-late-payer-signals/run-sync": {
      "post": {
        "operationId": "run-sync-battles_2026-uk-late-payer-signals",
        "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": [
              "snapshot",
              "monitor"
            ],
            "type": "string",
            "description": "Snapshot returns every matching company (charged per company signal). Monitor stores state in a named key-value store and returns only changes (charged per change alert). Schedule monitor runs daily or weekly.",
            "default": "snapshot"
          },
          "watchlistName": {
            "title": "Watchlist name (monitor mode)",
            "type": "string",
            "description": "Separate state is kept per watchlist name. Use a different name for each set of filters you monitor.",
            "default": "default"
          },
          "alertOn": {
            "title": "Alert on (monitor mode)",
            "enum": [
              "materialChange",
              "anyChange"
            ],
            "type": "string",
            "description": "Which changes produce an alert.",
            "default": "materialChange"
          },
          "emitBaselineOnFirstRun": {
            "title": "Emit all companies on first monitor run",
            "type": "boolean",
            "description": "Off (recommended): the first monitor run only saves a baseline and returns nothing (no charge). On: the first run returns every matching company as NEW_COMPANY (charged as change alerts).",
            "default": false
          },
          "companyNumbers": {
            "title": "Company numbers (watchlist)",
            "type": "array",
            "description": "Optional. Restrict to these Companies House numbers, e.g. 00784278, SC123456.",
            "items": {
              "type": "string",
              "pattern": "^\\s*[A-Za-z0-9]{1,8}\\s*$"
            }
          },
          "companyNameContains": {
            "title": "Company name contains",
            "type": "string",
            "description": "Optional case-insensitive substring."
          },
          "maxReportAgeMonths": {
            "title": "Latest report filed within (months)",
            "minimum": 0,
            "type": "integer",
            "description": "Only companies whose latest report was filed within this many months. 0 = no limit.",
            "default": 18
          },
          "sicPrefixes": {
            "title": "SIC code prefixes (sector)",
            "type": "array",
            "description": "E.g. 41, 42, 43 (construction) or 62 (IT). Matches any of the company's SIC codes from Companies House.",
            "items": {
              "type": "string",
              "pattern": "^\\s*\\d{1,5}\\s*$"
            }
          },
          "regions": {
            "title": "Regions (registered office)",
            "type": "array",
            "description": "Derived from the registered-office postcode area (approximate at region borders).",
            "items": {
              "type": "string",
              "enum": [
                "London",
                "South East",
                "East of England",
                "South West",
                "West Midlands",
                "East Midlands",
                "Yorkshire and The Humber",
                "North West",
                "North East",
                "Wales",
                "Scotland",
                "Northern Ireland",
                "Channel Islands and Isle of Man"
              ]
            }
          },
          "postcodeAreas": {
            "title": "Postcode areas",
            "type": "array",
            "description": "E.g. M, LS, EC, G.",
            "items": {
              "type": "string",
              "pattern": "^\\s*[A-Za-z]{1,2}\\s*$"
            }
          },
          "accountsCategories": {
            "title": "Size: accounts category",
            "type": "array",
            "description": "Companies House accounts category of the last accounts filed (proxy for size).",
            "items": {
              "type": "string",
              "enum": [
                "FULL",
                "GROUP",
                "MEDIUM",
                "SMALL",
                "TOTAL EXEMPTION FULL",
                "TOTAL EXEMPTION SMALL",
                "AUDIT EXEMPTION SUBSIDIARY",
                "UNAUDITED ABRIDGED",
                "AUDITED ABRIDGED",
                "DORMANT",
                "NO ACCOUNTS FILED",
                "ACCOUNTS TYPE NOT AVAILABLE"
              ]
            }
          },
          "activeOnly": {
            "title": "Active companies only",
            "type": "boolean",
            "description": "Keep only companies with status 'Active' in the Companies House snapshot.",
            "default": false
          },
          "minAvgDaysToPay": {
            "title": "Min average days to pay",
            "minimum": 0,
            "type": "integer",
            "description": "E.g. 60."
          },
          "minPctNotPaidWithinTerms": {
            "title": "Min % invoices not paid within agreed terms",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "E.g. 30 = at least 30% of payments due were not paid within agreed terms."
          },
          "minPctPaidOver60Days": {
            "title": "Min % invoices paid after 60 days",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "E.g. 20 = at least 20% of invoices took more than 60 days to pay."
          },
          "minMaxContractualTermDays": {
            "title": "Min maximum contractual payment term (days)",
            "minimum": 0,
            "type": "integer",
            "description": "E.g. 61 to find companies with terms longer than the 60-day cap proposed in the Commercial Payments Bill."
          },
          "minAvgDaysToPayChange": {
            "title": "Min change in average days to pay vs prior report",
            "type": "integer",
            "description": "E.g. 5 = paying at least 5 days slower than in the previous report."
          },
          "minLatePaymentScore": {
            "title": "Min late-payment score (0-100)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Heuristic 0-100 score (see README). E.g. 50."
          },
          "onlyNoEInvoicing": {
            "title": "Only companies NOT offering e-invoicing",
            "type": "boolean",
            "description": "Prospects for e-invoicing / AP automation vendors.",
            "default": false
          },
          "onlyNoSupplyChainFinance": {
            "title": "Only companies NOT offering supply chain finance",
            "type": "boolean",
            "description": "Prospects for supply chain finance / early-payment providers.",
            "default": false
          },
          "trends": {
            "title": "Trend",
            "type": "array",
            "description": "Trend of latest vs prior report.",
            "items": {
              "type": "string",
              "enum": [
                "WORSENING",
                "IMPROVING",
                "STABLE",
                "NO_PRIOR_REPORT",
                "NO_PAYMENT_DATA"
              ]
            }
          },
          "requireAnyFlags": {
            "title": "Require ANY of these flags",
            "type": "array",
            "description": "Keep companies having at least one of these flags.",
            "items": {
              "type": "string",
              "enum": [
                "AVG_DAYS_OVER_THRESHOLD",
                "MAX_TERM_OVER_THRESHOLD",
                "STANDARD_TERM_OVER_THRESHOLD",
                "HIGH_SHARE_PAID_LATE",
                "NO_E_INVOICING",
                "NO_SUPPLY_CHAIN_FINANCE",
                "WORSENING",
                "CHARGED_SUPPLIERS_TO_STAY_ON_LIST",
                "NO_PAYMENT_DATA",
                "SUSPECT_DATA",
                "REGISTER_STATUS_NOT_ACTIVE"
              ]
            }
          },
          "requireAllFlags": {
            "title": "Require ALL of these flags",
            "type": "array",
            "description": "Keep companies having all of these flags.",
            "items": {
              "type": "string",
              "enum": [
                "AVG_DAYS_OVER_THRESHOLD",
                "MAX_TERM_OVER_THRESHOLD",
                "STANDARD_TERM_OVER_THRESHOLD",
                "HIGH_SHARE_PAID_LATE",
                "NO_E_INVOICING",
                "NO_SUPPLY_CHAIN_FINANCE",
                "WORSENING",
                "CHARGED_SUPPLIERS_TO_STAY_ON_LIST",
                "NO_PAYMENT_DATA",
                "SUSPECT_DATA",
                "REGISTER_STATUS_NOT_ACTIVE"
              ]
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "latePaymentScore",
              "avgDaysToPay",
              "avgDaysToPayChange",
              "pctNotPaidWithinAgreedTerms",
              "filingDate",
              "companyName"
            ],
            "type": "string",
            "description": "Sort order of results.",
            "default": "latePaymentScore"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Caps rows and therefore cost. Snapshot mode: max company signals. Monitor mode: max change alerts per run (alerts over the cap are kept pending and delivered next run). Snapshot runs of up to 200 rows without sector/region/size/status filters look up register data per company and finish in about a minute even on a cold start.",
            "default": 100
          },
          "termThresholdDays": {
            "title": "Late threshold (days)",
            "minimum": 1,
            "type": "integer",
            "description": "Used for the *_OVER_THRESHOLD flags.",
            "default": 60
          },
          "worseningThresholdDays": {
            "title": "Worsening threshold (days)",
            "minimum": 1,
            "type": "integer",
            "description": "Average-days-to-pay increase that counts as WORSENING.",
            "default": 5
          },
          "worseningThresholdPctPoints": {
            "title": "Worsening threshold (% points late)",
            "minimum": 1,
            "type": "integer",
            "description": "Increase in % paid late (percentage points) that counts as WORSENING.",
            "default": 10
          },
          "highLateSharePct": {
            "title": "High late share (% not paid within terms)",
            "minimum": 1,
            "type": "integer",
            "description": "High late share (% not paid within terms).",
            "default": 30
          },
          "includeCompaniesHouse": {
            "title": "Join Companies House data",
            "type": "boolean",
            "description": "Adds SIC codes, status, size category, town, region from the free Companies House bulk snapshot (cached per monthly snapshot; the first run of each month takes a few extra minutes).",
            "default": true
          },
          "chEnrichment": {
            "title": "Companies House lookup method (advanced)",
            "enum": [
              "auto",
              "bulk",
              "perCompany"
            ],
            "type": "string",
            "description": "Auto: snapshot runs with Max results <= 200 and no sector/region/size/status filters look up only the returned companies (cached subset, then the Companies House API if you gave a key, then the public Companies House company page). Other runs read the free monthly bulk snapshot (~500 MB; a cold read takes a few minutes and is then cached).",
            "default": "auto"
          },
          "companiesHouseApiKey": {
            "title": "Companies House API key (optional)",
            "type": "string",
            "description": "Optional free key from developer.company-information.service.gov.uk. Only used to look up companies missing from the live-company snapshot (e.g. dissolved). If empty, the COMPANIES_HOUSE_API_KEY environment variable of the Actor is used when set."
          },
          "maxApiLookups": {
            "title": "Max Companies House API lookups",
            "minimum": 0,
            "type": "integer",
            "description": "Max Companies House API lookups.",
            "default": 300
          },
          "cacheHours": {
            "title": "Payment data cache (hours)",
            "minimum": 0,
            "type": "integer",
            "description": "Re-download the official CSV if the cached copy is older than this.",
            "default": 12
          },
          "forceRefresh": {
            "title": "Force refresh all sources",
            "type": "boolean",
            "description": "Force refresh all sources.",
            "default": false
          },
          "paymentPracticesCsvUrl": {
            "title": "Payment practices CSV URL (advanced)",
            "type": "string",
            "description": "Override for testing. Leave empty: the Actor uses the official source URL."
          },
          "companiesHouseBulkUrl": {
            "title": "Companies House bulk ZIP URL (advanced)",
            "type": "string",
            "description": "Override for testing. Leave empty: the Actor uses the official source URL."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}