{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending — US Federal Contracts, Grants & Awards (MCP)",
    "description": "USAspending.gov official federal awards data: every US government contract, grant, loan & award — recipient + UEI, amount, NAICS/PSC, dates, place, option values. SAM.gov/FPDS-grade federal spending search, govcon lead lists. Monitor mode = daily NEW awards. No API key. MCP-ready.",
    "version": "0.0",
    "x-build-id": "ootI9YLYtpqJQMF98"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/amygraphics~usaspending-awards-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-amygraphics-usaspending-awards-scraper",
        "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/amygraphics~usaspending-awards-scraper/runs": {
      "post": {
        "operationId": "runs-sync-amygraphics-usaspending-awards-scraper",
        "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/amygraphics~usaspending-awards-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-amygraphics-usaspending-awards-scraper",
        "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": "Mode",
            "enum": [
              "search",
              "monitor"
            ],
            "type": "string",
            "description": "search = one-off extraction of matching awards. monitor = return only **NEW** awards signed since the previous run — schedule it daily for a true 'who won which contract' feed.",
            "default": "search"
          },
          "scope": {
            "title": "Award type",
            "enum": [
              "contracts",
              "grants",
              "loans",
              "other",
              "all"
            ],
            "type": "string",
            "description": "contracts = DoD/VA/NASA/civilian purchase orders & definitive contracts. grants = federal grants & cooperative agreements. loans = direct & guaranteed federal loans. other = the remainder (insurance, indemnity…). all = everything.",
            "default": "contracts"
          },
          "timeFrom": {
            "title": "Start date",
            "type": "string",
            "description": "YYYY-MM-DD — awards signed since this date. Leave empty to use the last 'daysBack' days. The actor splits long windows automatically to beat the API's page wall.",
            "default": ""
          },
          "timeTo": {
            "title": "End date",
            "type": "string",
            "description": "YYYY-MM-DD — awards signed up to this date. Defaults to today.",
            "default": ""
          },
          "daysBack": {
            "title": "Days back (used when Start date is empty)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Rolling window ending today. Default 7 days. Typical monitor schedule: 1 day; typical first scan: 30–90 days.",
            "default": 14
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Free-text on the award description & metadata — e.g. [\"cloud hosting\", \"cybersecurity\"], [\"medical supplies\"], [\"construction school\"].",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Top-tier agencies by name — e.g. [\"Department of Defense\", \"Department of Veterans Affairs\", \"Department of Health and Human Services\", \"NASA\"].",
            "items": {
              "type": "string"
            }
          },
          "recipientSearch": {
            "title": "Prime recipient search",
            "type": "string",
            "description": "Company / organization name as written in federal filings — e.g. \"LOCKHEED MARTIN CORPORATION\", \"BOOZ ALLEN HAMILTON INC\". Returns that vendor's awards.",
            "default": ""
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Industry classification — e.g. [\"541511\"] (custom computer programming), [\"236220\"] (commercial building). Digits only, 2–6 chars.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC / product codes",
            "type": "array",
            "description": "Product & service categories — e.g. [\"D301\"] (IT facilities ops), [\"C219\"] (architect-engineer).",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of performance (states)",
            "type": "array",
            "description": "Two-letter codes where the work happens — e.g. [\"TX\", \"CA\", \"WA\", \"DC\"]. Not the recipient's HQ but the work location.",
            "items": {
              "type": "string"
            }
          },
          "awardMin": {
            "title": "Minimum award amount (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Only awards at or above this value. 0 = no lower bound.",
            "default": 0
          },
          "awardMax": {
            "title": "Maximum award amount (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Only awards at or below this value. 0 = no upper bound (biggest contracts reach $1 B+).",
            "default": 0
          },
          "maxResults": {
            "title": "Max awards",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Hard cap on the number of awards returned. Default 200. Raise for full scans (monitor mode ignores this — it returns only new awards).",
            "default": 200
          },
          "maxPages": {
            "title": "Max pages per time-chunk",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Pagination depth per split window (100 awards/page). Default 40 ≈ 4 000 rows before auto-splitting the period.",
            "default": 40
          },
          "includeDetails": {
            "title": "Enrich with award details (slower)",
            "type": "boolean",
            "description": "One extra request per award: full description, recipient UEI, option/ ceiling values, sub-award counts, parent award (IDV), NAICS & PSC hierarchies, congress district.",
            "default": false
          },
          "maxDetails": {
            "title": "Max awards to enrich",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Budget guard for includeDetails (1 request per award). Default 50.",
            "default": 50
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0,
            "maximum": 60,
            "type": "number",
            "description": "Politeness pause between API calls on top of automatic 429 handling. 0 = API-default pace.",
            "default": 0
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "number",
            "description": "How long to wait for the API before retrying.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}