{
  "openapi": "3.0.1",
  "info": {
    "title": "Global Tenders & Grants Monitor — EU TED, UK & US Grants",
    "description": "Monitor EU TED public tenders, UK Contracts Finder, and US Grants.gov / SAM.gov in one unified schema. Auto-classifies into 7 sectors, supports cross-run delta tracking (only NEW notices on schedules), and sends Telegram/webhook digests. Zero API keys.",
    "version": "0.1",
    "x-build-id": "v3GsSsZ0PRdvP80Ab"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/memo23~global-tenders-grants-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-memo23-global-tenders-grants-monitor",
        "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/memo23~global-tenders-grants-monitor/runs": {
      "post": {
        "operationId": "runs-sync-memo23-global-tenders-grants-monitor",
        "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/memo23~global-tenders-grants-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-memo23-global-tenders-grants-monitor",
        "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 to monitor",
            "type": "array",
            "description": "Which official free government APIs to query in this run. All selected sources run in one unified pipeline with zero API keys needed.",
            "items": {
              "type": "string",
              "enum": [
                "eu-ted",
                "uk-contracts",
                "us-grants",
                "us-sam"
              ],
              "enumTitles": [
                "EU TED (Tenders Electronic Daily)",
                "UK Contracts Finder (OCDS)",
                "US Grants.gov (Federal Grants)",
                "US SAM.gov (Federal Contracts)"
              ]
            },
            "default": [
              "eu-ted",
              "uk-contracts",
              "us-grants"
            ]
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Optional search keyword or phrase applied across all selected portals (e.g. `cybersecurity`, `cloud infrastructure`, `renewable energy`, `medical devices`). Leave empty to fetch latest notices."
          },
          "sectors": {
            "title": "Filter by sector (optional)",
            "type": "array",
            "description": "Keep only notices classified into these sectors. Leave empty to keep all 7 sectors.",
            "items": {
              "type": "string",
              "enum": [
                "IT/Software",
                "Construction",
                "Healthcare",
                "Energy",
                "Consulting",
                "Defense/Security",
                "Other"
              ],
              "enumTitles": [
                "IT / Software",
                "Construction",
                "Healthcare",
                "Energy",
                "Consulting",
                "Defense / Security",
                "Other"
              ]
            }
          },
          "countries": {
            "title": "EU TED countries (optional)",
            "type": "array",
            "description": "Optional country filter for EU TED (accepts ISO-2 like `DE`, `FR`, `NL` or ISO-3 like `DEU`, `FRA`, `NLD`). Ignored for UK/US portals.",
            "items": {
              "type": "string"
            }
          },
          "cpvCodes": {
            "title": "CPV codes (optional)",
            "type": "array",
            "description": "Optional Common Procurement Vocabulary codes applied to EU TED and UK Contracts Finder (e.g. `72000000`, `48000000`, `45000000`).",
            "items": {
              "type": "string"
            }
          },
          "publishedAfter": {
            "title": "Published after (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional lower date bound (`YYYY-MM-DD`). Defaults to the last 30 days for EU TED when no keywords/CPV filters are provided."
          },
          "publishedBefore": {
            "title": "Published before (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional upper date bound (`YYYY-MM-DD`)."
          },
          "activeOnly": {
            "title": "Active / open opportunities only",
            "type": "boolean",
            "description": "On (default): focuses UK Contracts Finder on active `tender` stage and US Grants.gov / SAM.gov on open/forecasted notices.",
            "default": true
          },
          "minBudget": {
            "title": "Minimum budget amount (optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional minimum numeric budget threshold (in the notice's local currency). Notices without a disclosed budget are skipped when this is set."
          },
          "stateStoreName": {
            "title": "Delta state store name (optional)",
            "type": "string",
            "description": "Named Apify Key-Value Store used to persist seen notice IDs across runs (e.g. `my-cyber-tenders-state`). Leave empty for stateless one-off runs."
          },
          "onlyNew": {
            "title": "Emit only NEW notices (when state store is set)",
            "type": "boolean",
            "description": "On (default): skips previously seen notices when `stateStoreName` is configured, so scheduled nightly runs emit only newly published notices (`isNew: true`). Turn off to emit all matched notices with `isNew` flagged true/false.",
            "default": true
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "Optional HTTP POST webhook URL receiving a JSON summary payload plus top new notices whenever new notices are found."
          },
          "telegramBotToken": {
            "title": "Telegram Bot Token (optional)",
            "type": "string",
            "description": "Optional Telegram bot token (from @BotFather) to send a formatted digest message of new tenders & grants."
          },
          "telegramChatId": {
            "title": "Telegram Chat ID (optional)",
            "type": "string",
            "description": "Target Telegram chat, group, or channel ID (required when `telegramBotToken` is provided)."
          },
          "maxItemsPerSource": {
            "title": "Max notices per source",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum normalized notices fetched from each enabled source (default 50).",
            "default": 50
          },
          "maxItems": {
            "title": "Max total notices",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on total emitted dataset rows across all sources combined (default 150). Non-paying Apify accounts are capped at 100.",
            "default": 150
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}