{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Tenders Scraper: Contracts Finder & Find a Tender Notices",
    "description": "Search UK tenders and public sector contract notices from Find a Tender and Contracts Finder in one schema: buyer, value, CPV codes, dates, region. New-notice alerts for daily schedules and a renewals mode for contracts ending soon. Not affiliated with the Government.",
    "version": "0.1",
    "x-build-id": "XKcMzzdKWZgJL1cjT"
  },
  "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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "pipeline",
              "lookup",
              "alert",
              "profile",
              "renewals",
              "renewalsAlert"
            ],
            "type": "string",
            "description": "Search filters notices; pipeline is a search of planning notices (Find a Tender UK1 pipeline, UK2 preliminary market engagement and UK3 planned procurement notices, and planning notices on the other services), sorted by the date the buyer expects to publish its next notice (futureNoticeDate), soonest first, charged as search; lookup returns the notices you name; alert returns only notices this alert has never sent before; profile summarises what each buyer you name put out to tender and awarded over the last 365 days (Contracts Finder and Find a Tender). Renewals lists contracts whose stated end date (or maximum extension) falls in a window, from Contracts Finder awards and Find a Tender contract notices; it names no suppliers. Renewals alert sends a contract when it first matches, and again (charged again) only when a later notice changes its end date, maximum extension date or renewal flag (a modification notice of a Find a Tender older-regulations contract is its own row, sent and charged even with unchanged dates); its first run sends everything in the window up to maxItems, and it sends and charges nothing when under 85% of the Contracts Finder day files, or under 85% of the Find a Tender day files, could be read.",
            "default": "search"
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Which service(s) to read. Public Contracts Scotland is read only when chosen (opt-in). Its API is currently not working for anyone (PCS support, 28 Oct 2026; no fix date), so pcs returns nothing and is not charged; Scotland-only notices below the Find a Tender threshold are unavailable while it is down. A procurement published on two services is two notices, two rows (Scottish above-threshold notices also appear on Find a Tender). Renewals mode reads Find a Tender and Contracts Finder only and refuses Public Contracts Scotland.",
            "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-0000791963); 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. Example: a day within the last 92 days, as YYYY-MM-DD."
          },
          "publishedTo": {
            "title": "Published to",
            "type": "string",
            "description": "Last publication day (UTC), inclusive. Default: today. A future date is treated as today."
          },
          "lastDays": {
            "title": "Last N days",
            "minimum": 1,
            "maximum": 92,
            "type": "integer",
            "description": "Search and pipeline modes: a relative window of the last N UTC days, today included (7 = today and the 6 days before it; 1 = today only; 92 = the largest window). It is worked out when the run starts, so a saved Task or schedule with lastDays 7 always reads the last week. Use it instead of \"Published from\" and \"Published to\": giving lastDays together with either is refused before anything is read (nothing is charged). Whole number from 1 to 92; 0, 93 or more are refused. Leave it empty to use the published dates (default: the last 31 days). Alert mode has its own fixed 14-day window and Renewals modes filter by contract end date, so both refuse lastDays."
          },
          "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."
          },
          "expectedFrom": {
            "title": "Next notice expected from (pipeline)",
            "type": "string",
            "description": "Pipeline mode only: keep planning notices whose expected next notice (futureNoticeDate, its day in UK time) is on or after this day, YYYY-MM-DD (a full timestamp is read by its date part). When this or \"Next notice expected to\" is set, notices that state no expected date are left out and counted as noFutureNoticeDate in the run summary. Search, alert and the renewals modes refuse it."
          },
          "expectedTo": {
            "title": "Next notice expected to (pipeline)",
            "type": "string",
            "description": "Pipeline mode only: keep planning notices whose expected next notice (futureNoticeDate, its day in UK time) is on or before this day, YYYY-MM-DD (a full timestamp is read by its date part); it must not be before \"Next notice expected from\". Example: the last day of next quarter, to see what is expected to come to tender by then. Search, alert and the renewals modes refuse it."
          },
          "buyers": {
            "title": "Buyers",
            "type": "array",
            "description": "Search and alert: a case-insensitive part of the buyer's name, e.g. \"NHS\" or \"Highland Council\"; any one matching is enough. Profile: 1 to 10 buyers, each an exact buyer name (case and punctuation aside, never a part of a name) or a Contracts Finder buyer id such as GB-CFS-53257. Renewals: as search.",
            "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. Example: [\"bridge\", \"highway\"].",
            "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. Example: [\"72\", \"45233141\"].",
            "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. Example: 100000 for notices worth at least 100,000 GBP."
          },
          "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. Example: 500000 for notices worth at most 500,000 GBP."
          },
          "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. Pipeline mode reads planning notices only: leave this empty there (any other stage is refused).",
            "items": {
              "type": "string",
              "enum": [
                "planning",
                "tender",
                "award",
                "contract",
                "termination"
              ]
            }
          },
          "endWithinMonths": {
            "title": "Ends within (months, renewals)",
            "minimum": 1,
            "maximum": 24,
            "type": "integer",
            "description": "Renewals mode: contracts whose end date falls between today and this many months from today. 12 when neither this nor an end-date window is given. Give this or endFrom/endTo, not both."
          },
          "endFrom": {
            "title": "End date from (renewals)",
            "type": "string",
            "description": "Renewals mode: first day of the end-date window (UTC), inclusive. Default: today. The window can be at most 24 months."
          },
          "endTo": {
            "title": "End date to (renewals)",
            "type": "string",
            "description": "Renewals mode: last day of the end-date window (UTC), inclusive. Default: 12 months after endFrom."
          },
          "matchOn": {
            "title": "Match on (renewals)",
            "enum": [
              "endDate",
              "maxExtentDate",
              "either"
            ],
            "type": "string",
            "description": "Renewals mode: which date must fall in the window. maxExtentDate is stated only by some Find a Tender notices; a contract without one never matches on it."
          },
          "buyerIds": {
            "title": "Buyer ids (renewals)",
            "type": "array",
            "description": "Renewals mode: the buyer's own published reference, matched exactly (case aside), e.g. GB-CFS-53257. Optional; any one matching is enough.",
            "items": {
              "type": "string"
            }
          },
          "lookbackMonths": {
            "title": "Look-back (months, renewals)",
            "minimum": 1,
            "maximum": 24,
            "type": "integer",
            "description": "Renewals mode: how many months of Contracts Finder and Find a Tender day files are read, by publication date, ending the day before yesterday. 12 when left out. When Find a Tender is among the sources, at most 12 months are read: 13 to 24 are accepted but cut to 12, and the run says so (lookbackClampedFrom in RUN_SUMMARY). Contracts Finder alone reads up to 24. The newer days (today, and yesterday until its file is out) come from the Find a Tender API."
          },
          "includePlanned": {
            "title": "Include planned procurements (renewals)",
            "type": "boolean",
            "description": "Renewals mode: also list the planned contract periods of Find a Tender planning and tender notices (UK1 to UK4). These are new procurements, not current contracts. Off when left out."
          },
          "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. Example: \"highways-north-west\" (lower-case letters, digits and hyphens, 1 to 40 characters). A renewals alert keeps its ledger in contracts-renewals-<alertId> instead."
          },
          "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
          },
          "ocids": {
            "title": "Track procurements by OCID (alert mode)",
            "maxItems": 200,
            "type": "array",
            "description": "Alert mode only: keep only notices of these procurements, by their exact OCID (the row's ocid), for example \"ocds-h6vhtk-06ef19\" (Find a Tender) or \"ocds-b5fd17-<id>\" (Contracts Finder). 1 to 200; a repeated OCID counts once. Combined with any other filter. Older-regulations Find a Tender notices have no OCID and cannot be tracked this way. Refused in other modes.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on rows returned, and so on row charges; in an alert, per run. Prefilled at 3; when left out, as in an API call with no maxItems, it is 1,000. Search, lookup and alert: $0.005 a run plus $0.005 a notice, so 3 cost up to $0.020, 20 up to $0.105 and 1,000 up to $5.005; at most 100,000. Renewals and renewals alert: $0.005 a run plus $0.02 a row, so 20 cost up to $0.405 and 1,000 up to $20.005; at most 20,000 (up to $400.005). Profile ignores it: $0.10 a buyer profile plus $0.005 a run.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}