{
  "openapi": "3.0.1",
  "info": {
    "title": "Government Tenders API: EU TED, UK Find a Tender & SAM.gov beta",
    "description": "New public tenders from EU TED and UK Find a Tender, plus SAM.gov (beta, your own key), in one clean schema. Filter by keyword, CPV, NAICS, country and deadline. Official APIs only.",
    "version": "0.1",
    "x-build-id": "Gi52BNDgBDs3aNIqQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/markdemian~gov-tenders-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-markdemian-gov-tenders-feed",
        "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/markdemian~gov-tenders-feed/runs": {
      "post": {
        "operationId": "runs-sync-markdemian-gov-tenders-feed",
        "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/markdemian~gov-tenders-feed/run-sync": {
      "post": {
        "operationId": "run-sync-markdemian-gov-tenders-feed",
        "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": "Which official sources to read. TED and UK Find a Tender work without a key. SAM.gov is BETA (not yet verified against the live API) and needs your own free SAM.gov public API key (below); without a key it is skipped. CanadaBuys is currently disabled pending permission from its publisher, so it is not offered.",
            "items": {
              "type": "string",
              "enum": [
                "ted",
                "uk-fts",
                "sam"
              ],
              "enumTitles": [
                "EU TED (Tenders Electronic Daily)",
                "UK Find a Tender",
                "SAM.gov (US federal) - BETA, needs your own API key"
              ]
            },
            "default": [
              "ted",
              "uk-fts"
            ]
          },
          "keywords": {
            "title": "Keywords (any)",
            "type": "array",
            "description": "Keep notices whose title, description or buyer contains ANY of these (case-insensitive). On TED the keywords use TED's own full-text search, which also matches other EU languages. Empty = all notices.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop notices whose title, description or buyer contains any of these.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cpvCodes": {
            "title": "CPV codes (EU and UK)",
            "type": "array",
            "description": "Prefix match, so 72000000 means all of division 72 (IT services). Used by TED and UK Find a Tender. If you set any code filter, notices must match at least one code in any scheme, so add codes for each source you use.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes (SAM.gov)",
            "type": "array",
            "description": "Prefix match, so 5415 matches 541511, 541512 and the rest. Used by SAM.gov.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "unspscCodes": {
            "title": "UNSPSC codes (CanadaBuys)",
            "type": "array",
            "description": "Prefix match (trailing 00 pairs are ignored). Reserved for CanadaBuys, which is currently disabled pending permission, so this filter has no effect today.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries (ISO-2)",
            "type": "array",
            "description": "Buyer or place-of-performance country, e.g. US, GB, DE, FR. Sources with no matching country are skipped. Empty = all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "noticeStages": {
            "title": "Notice stages",
            "type": "array",
            "description": "tender = open for bids (default). planning = prior information, market engagement, sources sought, requests for information. award = award and intent-to-award notices.",
            "items": {
              "type": "string",
              "enum": [
                "tender",
                "planning",
                "award"
              ],
              "enumTitles": [
                "Tender (open for bids)",
                "Planning / early notice",
                "Award"
              ]
            },
            "default": [
              "tender"
            ]
          },
          "publishedWithinDays": {
            "title": "Published in the last N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Fetch window. In monitor mode the window also reaches back to the previous complete run (up to 31 days), so a daily or weekly schedule never misses notices.",
            "default": 2
          },
          "deadlineMinDays": {
            "title": "Deadline at least N days away",
            "minimum": 0,
            "type": "integer",
            "description": "Skip notices that close sooner than this. 0 = no limit.",
            "default": 0
          },
          "deadlineMaxDays": {
            "title": "Deadline at most N days away",
            "minimum": 0,
            "type": "integer",
            "description": "Skip notices that close later than this. 0 = no limit.",
            "default": 0
          },
          "includeNoDeadline": {
            "title": "Keep notices without a deadline when a deadline filter is set",
            "type": "boolean",
            "description": "Many notices (especially planning notices) have no deadline. Keep them (default) or drop them when a deadline filter is set.",
            "default": true
          },
          "onlyNewSinceLastRun": {
            "title": "Only new notices since last run (monitor mode)",
            "type": "boolean",
            "description": "Remembers notices already output (in a named key-value store) and outputs only new ones. Schedule the Actor daily for a new-tenders alert feed.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "Keeps separate memory for different monitors. If empty, a name is derived from your sources and filters."
          },
          "samApiKey": {
            "title": "SAM.gov API key (BETA)",
            "type": "string",
            "description": "BETA. Your own free public API key from SAM.gov (sam.gov > Profile > Account Details > Public API Key). Only used when SAM.gov is selected. Stored encrypted by Apify and never logged or output."
          },
          "samMaxRequests": {
            "title": "Max SAM.gov API calls per run",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Each call returns up to 1,000 notices. SAM.gov allows 10 calls a day for a personal key without an entity role and 1,000 with one, so keep this low for scheduled runs.",
            "default": 2
          },
          "maxNoticesPerSource": {
            "title": "Max notices per source",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on output notices per source after filters. 0 = no cap. The example input uses 10 to keep the first run cheap.",
            "default": 0
          },
          "maxRequestsPerSource": {
            "title": "Max API pages per source",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety limit for TED and UK Find a Tender (100 notices per page). Raise it for large back-fills.",
            "default": 20
          },
          "includeDescription": {
            "title": "Include description",
            "type": "boolean",
            "description": "Plain-text description. Emails and phone numbers are removed. SAM.gov's API returns only a keyed link, so SAM.gov descriptions are empty.",
            "default": true
          },
          "descriptionMaxChars": {
            "title": "Max description length",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no limit.",
            "default": 3000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}