{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Contract Winners: Contracts Finder + Companies House",
    "description": "Who won UK public contracts? Contracts Finder and Find a Tender awards in one table, complete over long date ranges, with supplier Companies House numbers, an expiring-contracts (re-tender) mode and delta runs. Official open data (OGL). MCP-ready.",
    "version": "0.2",
    "x-build-id": "rZoCyYqI7brwYCDPY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zaphod-b~uk-contract-winners/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zaphod-b-uk-contract-winners",
        "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/zaphod-b~uk-contract-winners/runs": {
      "post": {
        "operationId": "runs-sync-zaphod-b-uk-contract-winners",
        "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/zaphod-b~uk-contract-winners/run-sync": {
      "post": {
        "operationId": "run-sync-zaphod-b-uk-contract-winners",
        "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": [
              "recentAwards",
              "expiringContracts"
            ],
            "type": "string",
            "description": "Recent awards returns awards published in the date window. Expiring contracts scans awards from the last lookbackMonths and returns those whose contract ends within endingWithinMonths.",
            "default": "recentAwards"
          },
          "daysBack": {
            "title": "Days back (recent awards)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Ignored if dateFrom is set.",
            "default": 7
          },
          "dateFrom": {
            "title": "Published from (ISO date)",
            "type": "string",
            "description": "Optional, e.g. 2026-11-01."
          },
          "dateTo": {
            "title": "Published to (ISO date)",
            "type": "string",
            "description": "Optional; defaults to now."
          },
          "lookbackMonths": {
            "title": "Lookback months (expiring contracts)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Expiring-contracts mode: how many months of past awards to scan for contract end dates.",
            "default": 24
          },
          "endingWithinMonths": {
            "title": "Ending within months (expiring contracts)",
            "minimum": 1,
            "maximum": 36,
            "type": "integer",
            "description": "Expiring-contracts mode: return contracts ending within this many months from now.",
            "default": 12
          },
          "keywords": {
            "title": "Keywords (any)",
            "type": "array",
            "description": "Match in title or description, case-insensitive.",
            "items": {
              "type": "string"
            }
          },
          "cpvPrefixes": {
            "title": "CPV code prefixes",
            "type": "array",
            "description": "e.g. 72 (IT services), 4881 (medical software).",
            "items": {
              "type": "string"
            }
          },
          "minValue": {
            "title": "Minimum value (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum award value in GBP."
          },
          "maxValue": {
            "title": "Maximum value (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum award value in GBP."
          },
          "buyerContains": {
            "title": "Buyer name contains",
            "type": "string",
            "description": "Only awards whose buyer name contains this text."
          },
          "supplierContains": {
            "title": "Supplier name contains",
            "type": "string",
            "description": "Track a competitor's wins."
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Which official portals to read.",
            "items": {
              "type": "string",
              "enum": [
                "contracts_finder",
                "find_a_tender"
              ]
            },
            "default": [
              "contracts_finder",
              "find_a_tender"
            ]
          },
          "onlyNew": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "For scheduled runs: skips awards already returned under the same stateKey, so you only pay for new rows.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Separate watch lists keep separate memories.",
            "default": "default"
          },
          "companiesHouseApiKey": {
            "title": "Companies House API key (optional)",
            "type": "string",
            "description": "Your own free key from developer.company-information.service.gov.uk. Adds status, SIC codes, incorporation date, registered postcode and accounts type, and finds company numbers by exact name where the notice did not publish one."
          },
          "matchByName": {
            "title": "Match missing company numbers by exact name",
            "type": "boolean",
            "description": "Only with an API key. Accepts a single exact normalised-name match among active companies; never guesses.",
            "default": true
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum rows returned. You are charged per row, so this is your cost ceiling.",
            "default": 1000
          },
          "maxPagesPerSource": {
            "title": "Max pages per source (100 notices each)",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety limit on API pages (100 notices each) per source.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}