{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Public Tenders & Contract Expiry Feed",
    "description": "One clean, deduplicated feed of UK public sector tenders, awards and soon-to-expire contracts from the official Find a Tender and Contracts Finder OCDS APIs. Contact-person data is stripped by default.",
    "version": "0.1",
    "x-build-id": "fkGhmDF4pNSO1VDUG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/larches~uk-public-tenders-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-larches-uk-public-tenders-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/larches~uk-public-tenders-feed/runs": {
      "post": {
        "operationId": "runs-sync-larches-uk-public-tenders-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/larches~uk-public-tenders-feed/run-sync": {
      "post": {
        "operationId": "run-sync-larches-uk-public-tenders-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": {
          "mode": {
            "title": "What to collect",
            "enum": [
              "opportunities",
              "awards",
              "expiringContracts",
              "all"
            ],
            "type": "string",
            "description": "opportunities = new/open tenders and pipeline (planning) notices; awards = contract award notices (who won, for how much); expiringContracts = awarded contracts whose end date falls in the next N months (re-tender leads).",
            "default": "opportunities"
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "fts = Find a Tender (above-threshold), cf = Contracts Finder (below-threshold, England).",
            "items": {
              "type": "string",
              "enum": [
                "fts",
                "cf"
              ],
              "enumTitles": [
                "Find a Tender",
                "Contracts Finder"
              ]
            },
            "default": [
              "fts",
              "cf"
            ]
          },
          "lookbackDays": {
            "title": "Look back (days)",
            "minimum": 1,
            "maximum": 1460,
            "type": "integer",
            "description": "Notices published/updated in the last N days. For expiringContracts use a long window (e.g. 365-1095), since contracts are awarded years before they expire.",
            "default": 2
          },
          "keywords": {
            "title": "Keywords (any match)",
            "type": "array",
            "description": "Case-insensitive whole-word match on title + description. Use a trailing * for prefix match, e.g. cyber*.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop notices whose title or description matches any of these words.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywordScope": {
            "title": "Match keywords in",
            "enum": [
              "titleAndDescription",
              "title"
            ],
            "type": "string",
            "description": "Title-only matching cuts false positives from long descriptions that mention a keyword in passing.",
            "default": "titleAndDescription"
          },
          "cpvPrefixes": {
            "title": "CPV code prefixes",
            "type": "array",
            "description": "e.g. 72 = IT services, 48 = software, 79 = business services, 45 = construction. Matches main or additional CPV codes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cpvPreset": {
            "title": "CPV preset",
            "enum": [
              "none",
              "it",
              "cyber",
              "construction",
              "facilities"
            ],
            "type": "string",
            "description": "Adds a ready-made CPV prefix list (and, for cyber, security keywords) to your own filters.",
            "default": "none"
          },
          "minValueGbp": {
            "title": "Minimum value (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop notices with a known value below this. Notices with no value are kept unless 'Require value' is on."
          },
          "requireValue": {
            "title": "Require a stated value",
            "type": "boolean",
            "description": "Drop notices that state no estimated or awarded value.",
            "default": false
          },
          "smeSuitableOnly": {
            "title": "SME-suitable only",
            "type": "boolean",
            "description": "Keep only notices the buyer marked as suitable for SMEs.",
            "default": false
          },
          "openOnly": {
            "title": "Only tenders still open for bids",
            "type": "boolean",
            "description": "Opportunities mode: drop notices whose submission deadline has passed.",
            "default": true
          },
          "expiringWithinMonths": {
            "title": "Expiring within (months)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "expiringContracts mode: keep awards whose contract end date is between now and N months from now.",
            "default": 12
          },
          "regions": {
            "title": "Regions contain",
            "type": "array",
            "description": "Case-insensitive substring match on delivery region, e.g. London, UKI, Scotland.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Remembers delivered notice IDs (per input) so scheduled runs only output new rows.",
            "default": false
          },
          "maxItems": {
            "title": "Max output rows",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many output rows (shared fairly across sources).",
            "default": 500
          },
          "maxRequestsPerSource": {
            "title": "Max API pages per source",
            "minimum": 1,
            "type": "integer",
            "description": "Each page = up to 100 notices. Hard cap to control run time.",
            "default": 50
          },
          "includeContacts": {
            "title": "Include buyer contact-person details",
            "type": "boolean",
            "description": "Off by default. When on, the buyer's contact name/email/phone from the notice is included. These are personal data under UK GDPR: only enable if you have a lawful basis and will comply with the GDPR yourself.",
            "default": false
          },
          "includeRaw": {
            "title": "Include raw OCDS release",
            "type": "boolean",
            "description": "Attach the full OCDS release (contactPoint removed unless contacts are enabled; free text is not scrubbed).",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}