{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Tenders API — Find a Tender + Contracts Finder in One Feed",
    "description": "UK public-sector tenders and awards from Find a Tender + Contracts Finder in one feed; notices on both sources merged when title, buyer, region and value match. Filter by CPV, value, region, keyword; daily onlyNew alerts, including amendment re-sends.",
    "version": "0.1",
    "x-build-id": "eIWRO1ko9RnIObK67"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/celestjux~celestjux-uk-tenders/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-celestjux-celestjux-uk-tenders",
        "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/celestjux~celestjux-uk-tenders/runs": {
      "post": {
        "operationId": "runs-sync-celestjux-celestjux-uk-tenders",
        "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/celestjux~celestjux-uk-tenders/run-sync": {
      "post": {
        "operationId": "run-sync-celestjux-celestjux-uk-tenders",
        "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": {
          "sources": {
            "title": "Sources",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Contracts Finder (England, mostly below-threshold) and/or Find a Tender (UK-wide, above-threshold, Procurement Act 2023).",
            "items": {
              "type": "string",
              "enum": [
                "contracts_finder",
                "find_a_tender"
              ],
              "enumTitles": [
                "Contracts Finder",
                "Find a Tender"
              ]
            },
            "default": [
              "contracts_finder",
              "find_a_tender"
            ]
          },
          "stages": {
            "title": "Stages",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "tender = open opportunities (incl. amendments/cancellations); award = awarded contracts with suppliers; planning = pre-market / pipeline notices. Reading more stages means more Find a Tender API pages per run — combine with a short publishedFrom window (see below) to avoid its rate limit.",
            "items": {
              "type": "string",
              "enum": [
                "tender",
                "award",
                "planning"
              ],
              "enumTitles": [
                "Tender",
                "Award",
                "Planning"
              ]
            },
            "default": [
              "tender"
            ]
          },
          "publishedFrom": {
            "title": "Published from",
            "type": "string",
            "description": "YYYY-MM-DD, or relative like '7 days' / '2 weeks' / '1 month' (= that long before today, UK time). Contracts Finder: published or last edited; Find a Tender: last updated. This is NOT the tender's closing/deadline date — there is no field to filter by tenderDeadline; fetch a window and check each item's tenderDeadline yourself. A wide window with multiple stages/sources reads more Find a Tender API pages and risks its rate limit; a 429 with a usable Retry-After is retried automatically (up to 4 times per request, 10min total per run by default — see maxRateLimitWaitSec), so it usually recovers on its own — the run only fails once that cap is reached, with no partial dataset. Keep the window to 7 days or less to make hitting the cap unlikely.",
            "default": "7 days"
          },
          "publishedTo": {
            "title": "Published to",
            "type": "string",
            "description": "Optional end date (inclusive) on the same publication/last-updated date as publishedFrom, not on tenderDeadline. Empty = up to now."
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Only notices whose title or description contains this exact text (case-insensitive substring, filtered by this actor — the APIs have no keyword search). For a category of work rather than an exact phrase (e.g. \"IT services\", \"construction\"), prefer cpvPrefixes: it matches the notice's official classification instead of literal wording, so it won't miss notices that don't happen to use your words."
          },
          "cpvPrefixes": {
            "title": "CPV code prefixes",
            "type": "array",
            "description": "Match any CPV code starting with one of these digit prefixes. Common ones: 72 = IT services (software, hosting, cloud, support), 48 = software packages, 45 = construction, 79 = business services (incl. consulting, HR, admin), 71 = architecture/engineering, 85 = health/social work. Prefer this over keyword when the ask names a category of work.",
            "items": {
              "type": "string"
            }
          },
          "minValue": {
            "title": "Minimum value (GBP)",
            "minimum": 0,
            "type": "number",
            "description": "Keep notices with value >= this. Non-GBP and valueless notices follow 'Include notices without value'."
          },
          "maxValue": {
            "title": "Maximum value (GBP)",
            "minimum": 0,
            "type": "number",
            "description": "Keep notices with value <= this."
          },
          "includeNoValue": {
            "title": "Include notices without value",
            "type": "boolean",
            "description": "When a min/max value is set, still keep notices that publish no (GBP) value.",
            "default": true
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Region names (e.g. London, North West, Scotland) or NUTS/ITL code prefixes (e.g. UKI, UKD3, TLI). Matches delivery region or buyer region.",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new notices",
            "type": "boolean",
            "description": "Skip notices delivered by an earlier onlyNew run (remembered in KV store celestjux-uk-tenders-seen). Amendments to an already-delivered notice are re-sent (see resendUpdates). Only detects a change relative to a PREVIOUS onlyNew run of this same actor — it has no baseline for a notice it has never seen before, so it can't answer \"what changed since last week\" the first time it looks at a tender; run it on a schedule to build that history.",
            "default": false
          },
          "resendUpdates": {
            "title": "Re-send updated notices",
            "type": "boolean",
            "description": "With onlyNew: when a later release of an already-delivered notice appears (amendment, cancellation, deadline/value change), send it again with isUpdate=true. false = old behaviour, a seen notice id is always skipped.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on items pushed.",
            "default": 1000
          },
          "maxTotalChargeUsd": {
            "title": "Max total charge (USD)",
            "minimum": 0.001,
            "type": "number",
            "description": "Optional extra spending cap under the platform's own. Run stops cleanly before exceeding it."
          },
          "maxRateLimitWaitSec": {
            "title": "Max rate-limit wait (seconds)",
            "minimum": 1,
            "type": "integer",
            "description": "Cap on total time spent on all rate-limit waits across the whole run — Find a Tender's Retry-After waits AND a Contracts Finder 403 cooldown, added together (default 600s/10min). Up to 4 Retry-After waits are honoured per request; hitting either that per-request cap or this run-wide one fails the run loud (URL + wait counts in the error, no partial dataset)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}