{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Contract Monitor",
    "description": "Track federal contract end dates, extensions and incumbent changes from USAspending, with source-linked records you can export or compare over time.",
    "version": "0.10",
    "x-build-id": "MrAkaVNGC3zsw6jyJ"
  },
  "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": "Action",
            "enum": [
              "search",
              "watchlist"
            ],
            "type": "string",
            "description": "Search for contracts, or recheck contracts you already know.",
            "default": "search"
          },
          "targets": {
            "title": "Search terms or contract links",
            "type": "array",
            "description": "Search: add terms such as software or facilities. Recheck: paste USAspending contract links. Leave blank to try a software search.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Number of contracts",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Save up to this many matching contracts. Start with 5.",
            "default": 5
          },
          "awardingAgencies": {
            "title": "Agency",
            "type": "array",
            "description": "Optional exact agency names, such as Department of Veterans Affairs.",
            "items": {
              "type": "string"
            }
          },
          "recipientName": {
            "title": "Contractor name",
            "type": "string",
            "description": "Optional company name to search for."
          },
          "endingWithin": {
            "title": "Contracts ending within",
            "enum": [
              "any",
              "30",
              "90",
              "180",
              "365"
            ],
            "type": "string",
            "description": "Optional. Keep contracts whose reported current end date is within this period. Filtered checks are still billed; fewer results may be available.",
            "default": "any"
          },
          "onlyWithinHorizon": {
            "title": "Only upcoming end dates",
            "type": "boolean",
            "description": "Advanced API option. Filter by horizonDays. Preserved for existing integrations; use endingWithin for the simple dropdown.",
            "default": false
          },
          "horizonDays": {
            "title": "Days ahead",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Advanced API option. Custom end-date window when onlyWithinHorizon is true. Preserved for existing integrations.",
            "default": 365
          },
          "monitorStoreName": {
            "title": "History name",
            "type": "string",
            "description": "Optional name such as my-contracts. Reuse it when rechecking to compare changes. Use letters, numbers and hyphens, 3–63 characters. Run one check at a time per name."
          },
          "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?",
            "pattern": "^(?:source_default|action_date|last_modified_date|date_signed)(?![\\s\\S])",
            "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",
            "pattern": "^(?:Award Amount|Last Modified Date|End Date)(?![\\s\\S])",
            "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",
            "pattern": "^(?:asc|desc)(?![\\s\\S])",
            "type": "string",
            "description": "Search mode only. Ascending puts smaller amounts or earlier dates first; descending puts larger amounts or later dates first.",
            "default": "desc"
          },
          "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."
          },
          "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
          },
          "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
          },
          "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
          },
          "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
          },
          "maxAwardsToScan": {
            "title": "Maximum contracts to check",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Leave blank to calculate from Maximum results. An explicit value overrides automatic limits. 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."
          },
          "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": "Leave blank to calculate from Maximum results. An explicit value overrides automatic limits. Advanced, search mode only. Stop discovery after this many pages. Contract detail checks have their own separate limit."
          },
          "maxHttpRequests": {
            "title": "Maximum source requests",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Leave blank to calculate from Maximum results. An explicit value overrides automatic limits. Hard request budget shared by search, contract details, transaction history and retries. Reaching it safely stops source work and marks the summary incomplete."
          },
          "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}