{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Public Contracts Lookup: Find a Tender and Contracts Finder",
    "description": "Search, look up and monitor UK public procurement notices from Find a Tender and Contracts Finder (Public Contracts Scotland opt-in) in one fixed row per notice. Official data under the OGL, built to hold no personal data. Pay per event: $0.005 a notice plus $0.005 a run.",
    "version": "0.1",
    "x-build-id": "HYSp7vwsc2EAvSHZ4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yappman~contracts-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yappman-contracts-lookup",
        "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/yappman~contracts-lookup/runs": {
      "post": {
        "operationId": "runs-sync-yappman-contracts-lookup",
        "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/yappman~contracts-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-yappman-contracts-lookup",
        "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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "lookup",
              "alert"
            ],
            "type": "string",
            "description": "Search filters notices; lookup returns the notices you name; alert returns only notices this alert has never sent before.",
            "default": "search"
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Which official service(s) to read. Public Contracts Scotland is read only when chosen. A procurement published on two services is two notices, two rows (Scottish above-threshold notices also appear on Find a Tender).",
            "items": {
              "type": "string",
              "enum": [
                "fts",
                "cf",
                "pcs"
              ],
              "enumTitles": [
                "Find a Tender",
                "Contracts Finder",
                "Public Contracts Scotland"
              ]
            },
            "default": [
              "fts",
              "cf"
            ]
          },
          "noticeIds": {
            "title": "Notice ids (lookup)",
            "maxItems": 20,
            "type": "array",
            "description": "Find a Tender notice ids (094494-2026), Contracts Finder notice GUIDs, Find a Tender OCIDs or Public Contracts Scotland OCIDs (ocds-r6ebe6-0000845164); at most 20. Lookup mode only. If the source rate-limits the run, the ids not yet looked up come back as \"retry after\" in the run summary and are not charged.",
            "items": {
              "type": "string"
            }
          },
          "publishedFrom": {
            "title": "Published from",
            "type": "string",
            "description": "First publication day (UTC), inclusive. Default: 30 days before \"Published to\", so the window is 31 days. The window can be at most 92 days; a longer one is refused before anything is read."
          },
          "publishedTo": {
            "title": "Published to",
            "type": "string",
            "description": "Last publication day (UTC), inclusive. Default: today. A future date is treated as today."
          },
          "deadlineFrom": {
            "title": "Deadline on or after",
            "type": "string",
            "description": "Only notices whose deadline is on or after this day; set it to today for opportunities still open. Notices without a deadline are left out when this is set."
          },
          "buyers": {
            "title": "Buyers",
            "type": "array",
            "description": "Case-insensitive part of the buyer's name, e.g. \"NHS\" or \"Highland Council\". Any one matching is enough.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Whole words matched in the title and description (the description is matched only, never returned). Any one matching is enough.",
            "items": {
              "type": "string"
            }
          },
          "cpvCodes": {
            "title": "CPV codes",
            "type": "array",
            "description": "CPV code prefixes: \"72\" matches all of division 72, and \"72212000\" matches itself and the codes beneath it.",
            "items": {
              "type": "string"
            }
          },
          "valueMin": {
            "title": "Minimum value (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Notices in another currency or without a value are left out when a value bound is set."
          },
          "valueMax": {
            "title": "Maximum value (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Notices in another currency or without a value are left out when a value bound is set."
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "UK regions (ITL1) of delivery. Any one matching is enough.",
            "items": {
              "type": "string",
              "enum": [
                "North East",
                "North West",
                "Yorkshire and the Humber",
                "East Midlands",
                "West Midlands",
                "East of England",
                "London",
                "South East",
                "South West",
                "Wales",
                "Scotland",
                "Northern Ireland",
                "Outside UK"
              ]
            }
          },
          "stages": {
            "title": "Stages",
            "type": "array",
            "description": "Planning, tender, award, contract or termination. Any one matching is enough.",
            "items": {
              "type": "string",
              "enum": [
                "planning",
                "tender",
                "award",
                "contract",
                "termination"
              ]
            }
          },
          "alertId": {
            "title": "Alert id (alert mode)",
            "pattern": "^[a-z0-9-]{1,40}$",
            "type": "string",
            "description": "Names this alert. Its ledger lives in the key-value store contracts-alert-<alertId> in your own account."
          },
          "firstRunLookbackDays": {
            "title": "First-run lookback (days)",
            "minimum": 1,
            "maximum": 14,
            "type": "integer",
            "description": "On an alert's first run, notices from this many days are returned; the rest of the 14-day window is recorded as seen without charge.",
            "default": 1
          },
          "maxItems": {
            "title": "Maximum notices",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on rows returned, and so on charges. Prefilled at 20, so a first run costs about $0.10; raise it (up to 100,000) for more. When it is left out, as in an API call with no maxItems, it is 1,000.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}