{
  "openapi": "3.0.1",
  "info": {
    "title": "Government Contract Award Change Report",
    "description": "Track TED and USASpending contract awards. No API key / no login. Open Input → leave defaults → Start (1 feed + 1 award ≈ USD 0.01–0.03): https://console.apify.com/actors/pTYhoc5g0hcN6chCd/input",
    "version": "0.1",
    "x-build-id": "ZmhtgqxGxT5NlXPnD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/taroyamada~government-contract-award-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-taroyamada-government-contract-award-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/taroyamada~government-contract-award-monitor/runs": {
      "post": {
        "operationId": "runs-sync-taroyamada-government-contract-award-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/taroyamada~government-contract-award-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-taroyamada-government-contract-award-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",
        "required": [
          "feeds"
        ],
        "properties": {
          "feeds": {
            "title": "Award feeds to monitor (required)",
            "type": "array",
            "description": "Leave the prefilled TED EU Digital Services feed and click Start for the first key-free proof. Do not clear — empty fails validation (required). Each feed produces one digest row. Use source=ted_awards or usaspending without an API key; sam_awards needs samApiKey.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "title": "Feed ID",
                  "description": "Stable identifier used in snapshots and output rows.",
                  "type": "string"
                },
                "name": {
                  "title": "Feed name",
                  "description": "Human-readable label for this feed in the digest output.",
                  "type": "string"
                },
                "source": {
                  "title": "Feed source",
                  "description": "Award source to query for this feed.",
                  "type": "string",
                  "enum": [
                    "ted_awards",
                    "sam_awards",
                    "usaspending"
                  ]
                },
                "keywords": {
                  "title": "Keywords",
                  "description": "Comma-separated title or description terms used to narrow award notices.",
                  "type": "string"
                },
                "cpvCodes": {
                  "title": "CPV codes",
                  "description": "Comma-separated CPV codes for TED award filtering.",
                  "type": "string"
                },
                "naicsCodes": {
                  "title": "NAICS codes",
                  "description": "Comma-separated NAICS codes for US award filtering.",
                  "type": "string"
                },
                "agencyName": {
                  "title": "Agency name",
                  "description": "Agency or buyer name filter for feed-specific targeting.",
                  "type": "string"
                },
                "buyerCountry": {
                  "title": "Buyer country",
                  "description": "Two-letter buyer country filter for TED award feeds.",
                  "type": "string"
                },
                "minValue": {
                  "title": "Minimum award value",
                  "description": "Feed-specific minimum award value override.",
                  "type": "number"
                }
              }
            },
            "default": [
              {
                "id": "ted-digital-services-awards",
                "name": "TED EU Digital Services Awards",
                "source": "ted_awards",
                "keywords": "digital services,IT consultancy,cloud",
                "cpvCodes": "72000000,72220000"
              }
            ]
          },
          "watchTerms": {
            "title": "Watch terms — awardee / competitor / incumbent names (comma-separated)",
            "type": "string",
            "description": "Optional. Leave empty on the first run. Add competitor/incumbent names after quickstart succeeds."
          },
          "lookbackDays": {
            "title": "Award lookback window (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "First run: keep the default lookback (or 7–14). Do not clear — empty falls back to the default.",
            "default": 14
          },
          "maxAwardsPerFeed": {
            "title": "Max awards per feed",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "First run: keep the default (or lower). Do not clear — empty falls back to 1. Increase only for discovery runs.",
            "default": 1
          },
          "minValue": {
            "title": "Global minimum award value (currency units)",
            "minimum": 0,
            "type": "number",
            "description": "Skip awards below this value. Applied globally unless overridden per feed. Set 0 to include all.",
            "default": 0
          },
          "delivery": {
            "title": "Delivery mode",
            "enum": [
              "dataset",
              "webhook"
            ],
            "type": "string",
            "description": "dataset stores results in the Apify dataset. webhook posts the digest JSON to webhookUrl. Start with dataset.",
            "default": "dataset"
          },
          "webhookUrl": {
            "title": "Webhook URL (required when delivery=webhook)",
            "type": "string",
            "description": "POST target for award digest payload. Leave empty for dataset-only first runs."
          },
          "datasetMode": {
            "title": "Dataset output mode",
            "enum": [
              "all",
              "action_needed",
              "new_only"
            ],
            "type": "string",
            "description": "all emits every feed digest row. action_needed emits only feeds that have new awards or watch-term hits. new_only emits only feeds with awards not seen in the previous run.",
            "default": "new_only"
          },
          "snapshotKey": {
            "title": "Snapshot key for recurring state",
            "type": "string",
            "description": "Stable key used to persist seen award IDs across recurring runs so new_only and action_needed modes stay comparable. Use the same key across scheduled runs.",
            "default": "contract-award-monitor-state"
          },
          "samApiKey": {
            "title": "SAM.gov API key (required for sam_awards feeds)",
            "type": "string",
            "description": "Optional. Leave empty on the first TED/USASpending run. Required only for sam_awards feeds (from Account Details on sam.gov). Missing key skips sam_awards feeds with a warning."
          },
          "samApiUrl": {
            "title": "SAM.gov opportunities API URL",
            "type": "string",
            "description": "SAM.gov opportunities search endpoint used for award-type records.",
            "default": "https://api.sam.gov/opportunities/v2/search"
          },
          "tedApiUrl": {
            "title": "TED API URL (ted_awards feeds)",
            "type": "string",
            "description": "TED notices search endpoint. No API key required.",
            "default": "https://api.ted.europa.eu/v3/notices/search"
          },
          "usaSpendingApiUrl": {
            "title": "USASpending.gov API URL (usaspending feeds)",
            "type": "string",
            "description": "USASpending.gov awards search endpoint. No API key required.",
            "default": "https://api.usaspending.gov/api/v2/search/spending_by_award/"
          },
          "requestTimeoutSeconds": {
            "title": "HTTP request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each API request.",
            "default": 30
          },
          "notifyOnNoNew": {
            "title": "Emit digest even when no new awards found",
            "type": "boolean",
            "description": "When true, every feed always produces a digest row even if no new awards were found. When false, feeds with no new awards are omitted from the output.",
            "default": false
          },
          "emitRawRows": {
            "title": "Include raw award rows",
            "type": "boolean",
            "description": "When enabled, new source-linked award rows are delivered at $0.004 each. Leave OFF for first proof.",
            "default": false
          },
          "generateReport": {
            "title": "Generate supplier-share report",
            "type": "boolean",
            "description": "Optional paid report ($4 when new award evidence is found). Prefer OFF for the first proof; turn on only when you need the supplier-share report.",
            "default": true
          },
          "emitExport": {
            "title": "Generate award export",
            "type": "boolean",
            "description": "Optional paid export ($3 when new award evidence is found). Leave OFF for the first proof.",
            "default": false
          },
          "maxChargeUsd": {
            "title": "Maximum event charge per run",
            "minimum": 0,
            "type": "number",
            "description": "Fail before delivery when the estimated PPE event charge exceeds this amount. Keep a low cap for first runs; set 0 for no cap.",
            "default": 0.03
          },
          "dryRun": {
            "title": "Dry run (skip snapshot writes and webhook delivery)",
            "type": "boolean",
            "description": "Validate and fetch without persisting state or posting webhooks. Safe for testing input shapes.",
            "default": false
          },
          "nowIso": {
            "title": "Override current time (ISO string, for testing)",
            "type": "string",
            "description": "Optional test override. Leave empty on real runs."
          },
          "tedFixturePath": {
            "title": "TED fixture file path (testing)",
            "type": "string",
            "description": "Optional local fixture for offline tests. Leave empty on live runs."
          },
          "samFixturePath": {
            "title": "SAM fixture file path (testing)",
            "type": "string",
            "description": "Optional local fixture for offline tests. Leave empty on live runs."
          },
          "usaSpendingFixturePath": {
            "title": "USASpending fixture file path (testing)",
            "type": "string",
            "description": "Optional local fixture for offline tests. Leave empty on live runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}