{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Public Sector Tenders (Contracts Finder) – OCDS",
    "description": "Open tenders, contract awards and pipeline notices from the UK government's Contracts Finder, via its official OCDS API: buyer, CPV categories, value, deadline, region and documents. Open Government Licence data; contact details masked by default.",
    "version": "0.1",
    "x-build-id": "cvhZSEj8xOAHodL1B"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/signalrows~tenders-uk-contracts-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-signalrows-tenders-uk-contracts-finder",
        "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/signalrows~tenders-uk-contracts-finder/runs": {
      "post": {
        "operationId": "runs-sync-signalrows-tenders-uk-contracts-finder",
        "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/signalrows~tenders-uk-contracts-finder/run-sync": {
      "post": {
        "operationId": "run-sync-signalrows-tenders-uk-contracts-finder",
        "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": {
          "query": {
            "title": "Text filter",
            "type": "string",
            "description": "Optional. Keep only notices whose title or description contains this text (case-insensitive). Applied client-side; the OCDS API has no text search, so a narrow query can need more pages.",
            "default": ""
          },
          "stages": {
            "title": "Notice stages",
            "uniqueItems": true,
            "type": "array",
            "description": "Which OCDS stages to fetch: tender (open opportunities, incl. amendments), award (contract award notices), planning (early engagement / future opportunities). Default: tender.",
            "items": {
              "type": "string",
              "enum": [
                "tender",
                "award",
                "planning"
              ],
              "enumTitles": [
                "Tender (opportunities)",
                "Award (contract awards)",
                "Planning (early engagement / pipeline)"
              ]
            },
            "default": [
              "tender"
            ]
          },
          "publishedFrom": {
            "title": "Published from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional ISO date (YYYY-MM-DD). Notices published on Contracts Finder from this date. Default: the last 7 days."
          },
          "publishedTo": {
            "title": "Published to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional ISO date (YYYY-MM-DD). Notices published up to this date (inclusive). Default: now."
          },
          "openOnly": {
            "title": "Open only",
            "type": "boolean",
            "description": "Keep only notices that are still open: tender deadline (tenderPeriod.endDate) in the future, or planning notices without a past deadline. Turn off for award notices and closed tenders.",
            "default": true
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Optional. Keep only notices delivered in these regions (substring match, e.g. \"London\", \"North West\", \"Scotland\") or postcode areas (e.g. \"SW\", \"M\", \"EH\"). Empty = all of the UK.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "buyers": {
            "title": "Buyers",
            "type": "array",
            "description": "Optional. Buyer (contracting authority) names, substring match, e.g. \"NHS\", \"Borough of Haringey\", \"Ministry of Defence\". Empty = all buyers.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minValueGBP": {
            "title": "Minimum value (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only notices with an estimated/awarded value of at least this many pounds. Notices without a published value are dropped when this is set."
          },
          "maxValueGBP": {
            "title": "Maximum value (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only notices with an estimated/awarded value of at most this many pounds. Notices without a published value are dropped when this is set."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "monitor"
            ],
            "type": "string",
            "description": "search: return matching notices. monitor: fetch the whole window, compare with the previous run's STATE (key-value store) and return only new/changed/awarded/closed notices with a changeType.",
            "default": "search"
          },
          "maxItems": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Stop after this many records. You are charged per record extracted.",
            "default": 100
          },
          "maskContacts": {
            "title": "Mask contact details",
            "type": "boolean",
            "description": "Default on: contact names, e-mails and phone numbers of buyer staff are removed (contact.name/email = null; role kept when it is a generic role such as \"Procurement Team\"), e-mails/phones redacted in text, supplier names that may be individuals masked, and the raw OCDS release dropped. Personal data is not covered by the Open Government Licence; turn off only with a declared, lawful purpose.",
            "default": true
          },
          "proxy": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Contracts Finder is reachable without a proxy; use Apify Proxy only if your runs are blocked.",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxPages": {
            "title": "Max API pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Safety cap on OCDS API pages (100 notices each) fetched per run. 25 pages cover 2,500 notices, i.e. more than the maximum maxItems.",
            "default": 25
          },
          "stateStore": {
            "title": "Monitor state store name",
            "type": "string",
            "description": "Optional named key-value store for monitor STATE so it persists across runs (the run's default store is per run on the platform). Example: uk-contracts-finder-state"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}