{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Scraper: Federal Contracts, Grants & Awards",
    "description": "Search U.S. federal contracts, grants, IDVs and other federal awards from the official USAspending.gov API: government spending by keyword, agency, recipient, NAICS, PSC, state and amount. Find recompete leads with contracts expiring soon. No API key.",
    "version": "0.1",
    "x-build-id": "izufYJjzLMIzssn59"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-co~usaspending-federal-contracts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-co-usaspending-federal-contracts",
        "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/api-co~usaspending-federal-contracts/runs": {
      "post": {
        "operationId": "runs-sync-api-co-usaspending-federal-contracts",
        "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/api-co~usaspending-federal-contracts/run-sync": {
      "post": {
        "operationId": "run-sync-api-co-usaspending-federal-contracts",
        "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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words or phrases to match in award descriptions, recipient names and IDs (min 3 characters each), e.g. cybersecurity, 'cloud migration'.",
            "items": {
              "type": "string"
            }
          },
          "awardTypes": {
            "title": "Award types",
            "type": "array",
            "description": "Which award categories to search.",
            "items": {
              "type": "string",
              "enum": [
                "contracts",
                "idvs",
                "grants",
                "direct_payments",
                "loans",
                "other"
              ],
              "enumTitles": [
                "Contracts (definitive, purchase & delivery orders)",
                "IDVs (GWACs, IDIQs, BPAs, FSS)",
                "Grants",
                "Direct payments",
                "Loans",
                "Other financial assistance"
              ]
            },
            "default": [
              "contracts"
            ]
          },
          "dateFrom": {
            "title": "Action date from",
            "type": "string",
            "description": "Only awards with activity on/after this date (YYYY-MM-DD, earliest 2007-10-01)."
          },
          "dateTo": {
            "title": "Action date to",
            "type": "string",
            "description": "Only awards with activity on/before this date (YYYY-MM-DD)."
          },
          "dateType": {
            "title": "Date type",
            "enum": [
              "action_date",
              "date_signed",
              "last_modified_date",
              "new_awards_only"
            ],
            "type": "string",
            "description": "Which date the range applies to.",
            "default": "action_date"
          },
          "expiringWithinDays": {
            "title": "Expiring within N days (recompete leads)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Only awards whose period of performance ends between today and N days from now. Great for finding contracts coming up for recompete."
          },
          "endDateFrom": {
            "title": "End date from",
            "type": "string",
            "description": "Only awards ending on/after this date (YYYY-MM-DD). Ignored if 'Expiring within N days' is set."
          },
          "endDateTo": {
            "title": "End date to",
            "type": "string",
            "description": "Only awards ending on/before this date (YYYY-MM-DD). Ignored if 'Expiring within N days' is set."
          },
          "minAmount": {
            "title": "Min award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards worth at least this much."
          },
          "maxAmount": {
            "title": "Max award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards worth at most this much."
          },
          "agencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Top-tier agency names exactly as on USAspending, e.g. 'Department of Defense', 'Department of Homeland Security', 'General Services Administration'.",
            "items": {
              "type": "string"
            }
          },
          "subAgencies": {
            "title": "Awarding sub-agencies",
            "type": "array",
            "description": "Sub-tier agency names, e.g. 'Department of the Air Force', 'Federal Emergency Management Agency'.",
            "items": {
              "type": "string"
            }
          },
          "recipients": {
            "title": "Recipients",
            "type": "array",
            "description": "Recipient (contractor) names or UEIs, e.g. 'Booz Allen Hamilton' or a 12-character UEI.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Industry codes (2-6 digits), e.g. 541512 (Computer Systems Design Services).",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product/Service codes, e.g. DA01 or R425.",
            "items": {
              "type": "string"
            }
          },
          "setAsideCodes": {
            "title": "Set-aside types",
            "type": "array",
            "description": "Contract set-aside codes, e.g. SBA (small business), 8A, SDVOSBC, WOSB, HZC.",
            "items": {
              "type": "string"
            }
          },
          "assistanceListings": {
            "title": "Assistance listing (CFDA) numbers",
            "type": "array",
            "description": "For grants/assistance, e.g. 11.035.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of performance states",
            "type": "array",
            "description": "Two-letter US state codes, e.g. VA, MD, CA.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "amount",
              "startDate",
              "endDate",
              "lastModified"
            ],
            "type": "string",
            "description": "Result order (ignored when an end-date window is set; those are scanned latest end date first).",
            "default": "amount"
          },
          "sortOrder": {
            "title": "Sort order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Descending or ascending.",
            "default": "desc"
          },
          "includeDetails": {
            "title": "Include award details",
            "type": "boolean",
            "description": "Add competition (extent competed, number of offers), set-aside, pricing type, solicitation ID, parent IDV, recipient parent company & location, subaward totals, NAICS/PSC hierarchy. Charged as one extra 'award details' event per award.",
            "default": false
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many awards. You are only charged per award returned.",
            "default": 100
          },
          "maxScan": {
            "title": "Max awards to scan",
            "minimum": 100,
            "type": "integer",
            "description": "Safety cap on awards read from the API per award type when post-filtering by end date (free; only returned awards are charged).",
            "default": 20000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}