{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Government Tenders & Awards (Contracts Finder & FTS)",
    "description": "Extract live UK public sector tenders, pipeline notices, and awarded contracts from both official OCDS portals (Contracts Finder & Find a Tender) with buyer contact emails, CPV codes, GBP values, and SME filters.",
    "version": "0.1",
    "x-build-id": "bpR8FKMzXY6zcvFFD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/blueoceanstar~uk-gov-tenders-intel/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-blueoceanstar-uk-gov-tenders-intel",
        "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/blueoceanstar~uk-gov-tenders-intel/runs": {
      "post": {
        "operationId": "runs-sync-blueoceanstar-uk-gov-tenders-intel",
        "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/blueoceanstar~uk-gov-tenders-intel/run-sync": {
      "post": {
        "operationId": "run-sync-blueoceanstar-uk-gov-tenders-intel",
        "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": "Official Portals to Query",
            "type": "array",
            "description": "Choose contracts_finder (lower-value & local councils), find_a_tender (above-threshold UK-wide contracts), or both.",
            "default": [
              "contracts_finder",
              "find_a_tender"
            ],
            "items": {
              "type": "string"
            }
          },
          "stages": {
            "title": "Procurement Stages",
            "type": "array",
            "description": "Notice stages to fetch: planning (future pipeline), tender (open opportunities), award (won contracts & suppliers).",
            "default": [
              "tender",
              "award"
            ],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keyword Filter (Optional)",
            "type": "array",
            "description": "Optional case-insensitive keywords matched against title, description, buyer name, CPV description, and awarded suppliers.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cpvPrefixes": {
            "title": "CPV Code Prefixes (Optional)",
            "type": "array",
            "description": "Filter by CPV industry prefixes (e.g. [\"72\", \"48\"] for IT & software, [\"45\"] for construction).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "procurementCategories": {
            "title": "Procurement Categories (Optional)",
            "type": "array",
            "description": "Optional categories: services, goods, works.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "smeOnly": {
            "title": "SME-Suitable Opportunities Only",
            "type": "boolean",
            "description": "When enabled, keeps only notices explicitly flagged as suitable for Small & Medium Enterprises.",
            "default": false
          },
          "minValueGbp": {
            "title": "Minimum Value (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep notices with estimated or awarded value >= this GBP amount."
          },
          "maxValueGbp": {
            "title": "Maximum Value (GBP)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep notices with estimated or awarded value <= this GBP amount."
          },
          "publishedFrom": {
            "title": "Published / Updated From (YYYY-MM-DD)",
            "type": "string",
            "description": "Inclusive start date (YYYY-MM-DD). Defaults to 7 days ago UTC if omitted.",
            "default": ""
          },
          "publishedTo": {
            "title": "Published / Updated To (YYYY-MM-DD)",
            "type": "string",
            "description": "Inclusive end date (YYYY-MM-DD). Defaults to today UTC if omitted.",
            "default": ""
          },
          "maxTenders": {
            "title": "Max Tenders to Extract",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum matching notices pushed across selected sources (1-1000).",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}