{
  "openapi": "3.0.1",
  "info": {
    "title": "Government Tender & Contract Scraper",
    "description": "Public sector tenders from TED (EU) and both UK procurement portals in one feed. Filter by CPV code, country, value and deadline, separate open opportunities from already-awarded contracts, and get the buying officer's name, email and phone where the portal publishes them.",
    "version": "0.0",
    "x-build-id": "SDQl3B2Iih2eFShIX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/eiv~tender-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-eiv-tender-scraper",
        "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/eiv~tender-scraper/runs": {
      "post": {
        "operationId": "runs-sync-eiv-tender-scraper",
        "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/eiv~tender-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-eiv-tender-scraper",
        "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": "Sources",
            "type": "array",
            "description": "Leave empty for all three. ted covers the EU and 30+ countries; uk-contracts-finder covers UK public sector including below-threshold work; uk-find-a-tender covers UK high-value notices.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Any one matching is enough. Searched in the title, description and buyer name. Leave empty to rely on CPV codes alone.",
            "items": {
              "type": "string"
            }
          },
          "cpvCodes": {
            "title": "CPV codes",
            "type": "array",
            "description": "Common Procurement Vocabulary — how buyers actually file a tender. A division is enough: 48 is software, 45 construction, 72 IT services, 85 health, 79 business services. Short codes are padded to eight digits for TED, which rejects them otherwise, and matched as prefixes everywhere else.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "ISO codes such as DE, FR, GB, PL. Leave empty for all. TED is told directly; the UK portals are UK-only, so this mainly narrows TED.",
            "items": {
              "type": "string"
            }
          },
          "noticeTypes": {
            "title": "Notice types",
            "type": "array",
            "description": "tender is an open opportunity, award names a winner, contract is a signed agreement, planning is an early heads-up. Leave empty for all four. Set it to tender if you are looking for work to bid on — the portals mix all four into one stream, and in a typical run only about a third are open tenders.",
            "items": {
              "type": "string"
            }
          },
          "onlyOpen": {
            "title": "Only notices still open",
            "type": "boolean",
            "description": "Drop anything whose deadline has already passed. Notices with no published deadline are kept — no date is not evidence of a closed door.",
            "default": false
          },
          "requireContactDetails": {
            "title": "Only notices with a contact email",
            "type": "boolean",
            "description": "Keep only notices naming someone you can write to. TED does not publish contact emails, so this narrows a run to the UK portals in practice.",
            "default": false
          },
          "minValue": {
            "title": "Minimum value",
            "minimum": 0,
            "type": "integer",
            "description": "In the notice's own currency. Notices that publish no value are kept, because an undisclosed budget is not a small one.",
            "default": 0
          },
          "maxValue": {
            "title": "Maximum value",
            "minimum": 0,
            "type": "integer",
            "description": "In the notice's own currency. 0 disables.",
            "default": 0
          },
          "publishedFrom": {
            "title": "Published from (YYYY-MM-DD)",
            "type": "string",
            "description": "Defaults to seven days ago. TED has no sort parameter, so this date floor is what makes a run recent rather than returning notices from a decade ago."
          },
          "publishedTo": {
            "title": "Published to (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional. A range that runs backwards is rejected with a warning rather than searched, because every one of these APIs answers an impossible window with silence."
          },
          "language": {
            "title": "Preferred language",
            "type": "string",
            "description": "Two-letter code. TED publishes descriptions, buyer cities and CPV labels in twenty-four languages; this picks one, falling back to English and then to whatever exists. Titles are the exception — TED never translates them, so a title stays in the buyer's language and titleLanguage records which that is.",
            "default": "en"
          },
          "maxPerSource": {
            "title": "Max notices per source",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "TED alone can match hundreds of thousands. Summary rows carry totalAvailable where the source reports one, so you can see what was left behind.",
            "default": 250
          },
          "includeSourceSummary": {
            "title": "Include a summary per source",
            "type": "boolean",
            "description": "Add one rollup per source: counts by notice type, median value, top buyers, top CPV codes, how many close within a week and how many carry a contact email. Not billed as a notice.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "Sources searched in parallel. These are public sector APIs; three is plenty.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Per-request timeout. A TED page of 250 notices is several megabytes.",
            "default": 60
          },
          "maxRetries": {
            "title": "Retries per request",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries for connection resets and 5xx responses.",
            "default": 2
          },
          "flattenOutput": {
            "title": "Flatten output for CSV",
            "type": "boolean",
            "description": "Emit flat dot-notation columns. Mainly affects the CPV list and the top-buyer list on summary rows.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. All three are public government APIs and none of them blocks.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}