{
  "openapi": "3.0.1",
  "info": {
    "title": "Government Tender Awards: Winners, Values & Bids",
    "description": "Government contracts already awarded, not open opportunities: who won, for how much, and how many bidders they beat, from the US, UK and EU registers in one schema. Flags contracts labelled openly competed that drew a single bid, ranks repeat winners per buyer, never fills a blank with zero.",
    "version": "0.1",
    "x-build-id": "2nJ1pr9DVR6O8pk7m"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aiqlabs~government-tender-awards/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aiqlabs-government-tender-awards",
        "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/aiqlabs~government-tender-awards/runs": {
      "post": {
        "operationId": "runs-sync-aiqlabs-government-tender-awards",
        "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/aiqlabs~government-tender-awards/run-sync": {
      "post": {
        "operationId": "run-sync-aiqlabs-government-tender-awards",
        "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": [
          "sources"
        ],
        "properties": {
          "sources": {
            "title": "Registers to read",
            "type": "array",
            "description": "US = USAspending.gov federal contracts. UK = Find a Tender. EU = TED contract award notices. All three are official APIs and none needs a key.",
            "items": {
              "type": "string",
              "enum": [
                "us",
                "uk",
                "eu"
              ],
              "enumTitles": [
                "US - USAspending.gov (federal contracts, includes bid counts)",
                "UK - Find a Tender (includes the list of bidders)",
                "EU - TED (award notices, no bid counts published)"
              ]
            },
            "default": [
              "us",
              "uk",
              "eu"
            ]
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Any of these words. Matched by the register itself for US and EU; matched here against title, description, buyer and winner for UK, because Find a Tender has no keyword parameter. Leave empty for everything in the date range.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "awardedFrom": {
            "title": "From date",
            "type": "string",
            "description": "yyyy-mm-dd. US filters on the date the contract was signed, UK on the day the notice was published or updated, EU on the publication date. Defaults to 30 days ago.",
            "default": ""
          },
          "awardedTo": {
            "title": "To date",
            "type": "string",
            "description": "yyyy-mm-dd. Defaults to today.",
            "default": ""
          },
          "countries": {
            "title": "EU buyer countries",
            "type": "array",
            "description": "Three-letter codes such as DEU, FRA, ESP. EU register only; ignored for US and UK.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cpvCodes": {
            "title": "EU CPV codes",
            "type": "array",
            "description": "Eight-digit CPV codes such as 72000000 for IT services. EU register only.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minAwardAmount": {
            "title": "Minimum award value",
            "minimum": 0,
            "type": "integer",
            "description": "In the currency each register publishes - no conversion is done. Awards whose value was never published are kept, because \"not published\" is not \"below the minimum\".",
            "default": 0
          },
          "maxRecordsPerSource": {
            "title": "Awards per register",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "The main control over how long a run takes. The US register also costs one extra request per award when bid counts are on.",
            "default": 200
          },
          "maxAwardsPerNotice": {
            "title": "Awards to take from any one notice",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "A UK framework notice can carry over a hundred lot awards - one of them alone would fill the whole run and hide every other contract in the window. Anything left out is counted in SUMMARY, and every row carries awardsOnThisNotice so the real size is visible. Set 0 to take them all.",
            "default": 25
          },
          "includeUsCompetitionDetail": {
            "title": "Read US bid counts",
            "type": "boolean",
            "description": "The number of offers received and the competition label live only in the US award detail endpoint, so this costs one extra request per award. Turning it off makes the run much faster and removes the single-bid analysis for US rows.",
            "default": true
          },
          "onlyUncontested": {
            "title": "Only awards labelled open that drew one bid",
            "type": "boolean",
            "description": "Output just the contradictions. The rankings in the key-value records are still built from every award found.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Applies to the US detail lookups. Lower it if the register starts refusing requests.",
            "default": 5
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "How long to wait for one response. The US search endpoint is slow on wide date ranges.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}