{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Contract Runway & Extension Monitor",
    "description": "Build evidence-backed contract capture briefs from USAspending. Filter by industry, agency, incumbent and value; inspect recent modifications, separate current/potential end dates, and alert on material changes and review-window entries.",
    "version": "0.7",
    "x-build-id": "dGbIgeQa46PwfgLrx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thescrapelab~usaspending-contract-runway-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thescrapelab-usaspending-contract-runway-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/thescrapelab~usaspending-contract-runway-monitor/runs": {
      "post": {
        "operationId": "runs-sync-thescrapelab-usaspending-contract-runway-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/thescrapelab~usaspending-contract-runway-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-thescrapelab-usaspending-contract-runway-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": {
          "mode": {
            "title": "What would you like to do?",
            "enum": [
              "search",
              "watchlist"
            ],
            "type": "string",
            "description": "Choose Find contracts to discover contracts. Choose Recheck contracts to check only the IDs entered below. Neither option creates an automatic schedule.",
            "default": "search"
          },
          "keywords": {
            "title": "Keywords to search",
            "type": "array",
            "description": "Search mode only. Add terms such as software, cybersecurity or facilities. Leave blank to use industry, agency or company filters below. With no search filters, a small software-contract demonstration is used.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "awardIds": {
            "title": "Contract IDs to recheck",
            "type": "array",
            "description": "Recheck mode only: add at least one USAspending numeric award ID or full CONT_AWD_ identifier. Copy these from a previous result’s awardId field. The web page’s full URL is not an ID.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Maximum results to save",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after saving this many contracts. Duplicate contracts are saved once. Alert and end-date filters can reduce the number saved; successful checks that do not produce a result are still billed.",
            "default": 5
          },
          "maxAwardsToScan": {
            "title": "Maximum contracts to check",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Limits attempted contract lookups, including unavailable records and duplicate ID aliases. Successful unique checks cost $1.50 per 1,000, including quiet or filtered-out checks. Failed lookups are not billed as checks. Each run also has a $0.00005 start fee.",
            "default": 10
          },
          "includeTransactions": {
            "title": "Include recent contract transactions",
            "type": "boolean",
            "description": "Optional. Add reported funding actions and modifications to each result and the capture brief. Uses more source requests and time, with no additional transaction fee. Leave off for the fastest first run.",
            "default": false
          },
          "naicsCodes": {
            "title": "Industry codes (NAICS)",
            "type": "array",
            "description": "Search mode only. Optional 2–6 digit NAICS prefixes; for example, 541512 for computer systems design. Filters at the source before contract details are checked.",
            "items": {
              "type": "string"
            }
          },
          "awardingAgencies": {
            "title": "Federal agencies",
            "type": "array",
            "description": "Search mode only. Use exact top-level agency names, such as Department of Veterans Affairs. Filters at the source before contract details are checked.",
            "items": {
              "type": "string"
            }
          },
          "recipientName": {
            "title": "Contractor or company name",
            "type": "string",
            "description": "Search mode only. Enter one organization name to find contracts reported for that recipient, for example an incumbent or competitor."
          },
          "minObligationUsd": {
            "title": "Minimum obligated amount (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Search mode only. Optional lower bound on the source’s Award Amount. Obligations are reported commitments, not the potential contract ceiling."
          },
          "maxObligationUsd": {
            "title": "Maximum obligated amount (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Search mode only. Optional upper bound on the source’s Award Amount. Must be at least the minimum amount if both are set."
          },
          "activityFrom": {
            "title": "Activity start date",
            "type": "string",
            "description": "Search mode only. Optional YYYY-MM-DD date; defaults to one year before the run. Searches reported award activity, not contract expiration."
          },
          "activityTo": {
            "title": "Activity end date",
            "type": "string",
            "description": "Search mode only. Optional YYYY-MM-DD date; defaults to today in UTC. Must be on or after the activity start date."
          },
          "activityDateType": {
            "title": "Which activity date should be searched?",
            "enum": [
              "source_default",
              "action_date",
              "last_modified_date",
              "date_signed"
            ],
            "type": "string",
            "description": "Search mode only. Leave at USAspending default for a first run. Last modified date finds record updates. These dates describe source activity, not contract expiration.",
            "default": "source_default"
          },
          "sortBy": {
            "title": "Sort search results by",
            "enum": [
              "Award Amount",
              "Last Modified Date",
              "End Date"
            ],
            "type": "string",
            "description": "Search mode only. Controls which contracts are checked first within the search and check limits.",
            "default": "Award Amount"
          },
          "sortOrder": {
            "title": "Sort direction",
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Search mode only. Ascending puts smaller amounts or earlier dates first; descending puts larger amounts or later dates first.",
            "default": "desc"
          },
          "horizonDays": {
            "title": "Look ahead this many days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "A contract is inside this window when its reported current end date is today through this many days ahead, including the boundary. Defaults to 365 days.",
            "default": 365
          },
          "onlyWithinHorizon": {
            "title": "Save only contracts ending in this window",
            "type": "boolean",
            "description": "Optional. Filters saved results after each detail check. Non-matching successful checks still update monitoring snapshots and are billed. Review them in All completed contract checks. Search and run limits can leave coverage incomplete.",
            "default": false
          },
          "asOfDate": {
            "title": "Reference date for days remaining",
            "type": "string",
            "description": "Optional YYYY-MM-DD date. Leave blank to calculate days remaining from today in UTC. Setting this date changes calculations; it does not retrieve historical source records."
          },
          "monitorStoreName": {
            "title": "Name for your saved monitoring history",
            "type": "string",
            "description": "Optional. Reuse the same unique name in later runs to compare contracts with earlier observations, for example my-contract-watchlist. Use 3–63 letters, numbers or hyphens; start with a letter or number. Run one check at a time for each name. If another run is active, retry after it finishes; a hard stop can hold the lock for up to two minutes. This saves history; it does not create a schedule."
          },
          "onlyAlerts": {
            "title": "Save only new observations and alerts",
            "type": "boolean",
            "description": "Optional. Save first observations when enabled, material factual changes and entries into the alert windows below. Use a saved monitoring history name or previous snapshots to compare runs. Quiet successful checks still update history, are billed and remain in All completed contract checks.",
            "default": false
          },
          "includeFirstObservations": {
            "title": "Include the first time a contract is seen",
            "type": "boolean",
            "description": "When saving only alerts, keep the initial observation as a baseline result. First seen does not mean newly awarded. Turn off for a silent initial baseline.",
            "default": true
          },
          "alertWindowDays": {
            "title": "Alert windows before reported end dates (days)",
            "type": "array",
            "description": "Positive, unique numbers such as [30, 90, 180]. Alerts when current or potential end dates enter a window, including when only the countdown changes. This requires a comparable earlier observation.",
            "default": [
              30,
              90,
              180
            ]
          },
          "materialObligationChangeUsd": {
            "title": "Minimum funding change for an alert (USD)",
            "minimum": 0.01,
            "type": "number",
            "description": "Absolute obligation increase or decrease required for a funding alert. Defaults to $100,000. No future spending or revenue is inferred.",
            "default": 100000
          },
          "previousSnapshots": {
            "title": "Import previous snapshots (advanced)",
            "type": "array",
            "description": "Optional alternative to saved monitoring history. Paste the full SNAPSHOTS array from an earlier run. Entries match by canonical award ID and override saved-history entries for the same IDs."
          },
          "maxTransactionsPerAward": {
            "title": "Transactions to keep per contract",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Used only when recent transactions are enabled. Keep at most this many unique reported transactions for each contract. Marked as sampled when more are available.",
            "default": 10
          },
          "transactionLookbackDays": {
            "title": "Recent transaction summary window (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Used only when recent transactions are enabled. Summary counts cover sampled actions within this many days. A capped sample is not a complete total for the period.",
            "default": 90
          },
          "transactionPageSize": {
            "title": "Transactions per history page",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Used only when recent transactions are enabled. Fixed history page size. Smaller pages may require more requests to reach the per-contract sample limit.",
            "default": 10
          },
          "maxTransactionRequestsPerAward": {
            "title": "Maximum history requests per contract",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Used only when recent transactions are enabled. Counts history request attempts, including retries. Keeps partial history and continues with other contracts when reached. Included in the existing check price.",
            "default": 8
          },
          "pageSize": {
            "title": "Contracts per search page",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Advanced, search mode only. Fixed page size for the whole run. Smaller pages require more search requests.",
            "default": 50
          },
          "maxPages": {
            "title": "Maximum search pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Advanced, search mode only. Stop discovery after this many pages. Contract detail checks have their own separate limit.",
            "default": 2
          },
          "maxHttpRequests": {
            "title": "Maximum source requests",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard request budget shared by search, contract details, transaction history and retries. Reaching it safely stops source work and marks the summary incomplete.",
            "default": 30
          },
          "requestIntervalMs": {
            "title": "Delay between source requests (milliseconds)",
            "minimum": 1000,
            "maximum": 60000,
            "type": "integer",
            "description": "One request stream, with at least this delay between requests. Retries also respect the delay and the source’s Retry-After header.",
            "default": 1000
          },
          "maxRuntimeSeconds": {
            "title": "Maximum source collection time (seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "Safely stops source collection at this deadline. If you raise it, set the Apify run timeout at least 60 seconds higher. Interrupted runs retain committed checkpoints and cannot automatically replay the same run.",
            "default": 120
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}