{
  "openapi": "3.0.1",
  "info": {
    "title": "US Federal Contract Awards Scraper – USAspending.gov API",
    "description": "Search US federal contract awards from the official USAspending.gov API by keyword, NAICS, PSC, agency, recipient, state, date and value. Clean records with recipient UEI and award links, plus recipient/agency spend rankings. No API key. $1.50 per 1,000 awards.",
    "version": "0.1",
    "x-build-id": "zSeeB5g7joAKeVdkQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhucl1006~us-federal-contract-awards-usaspending/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhucl1006-us-federal-contract-awards-usaspending",
        "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/zhucl1006~us-federal-contract-awards-usaspending/runs": {
      "post": {
        "operationId": "runs-sync-zhucl1006-us-federal-contract-awards-usaspending",
        "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/zhucl1006~us-federal-contract-awards-usaspending/run-sync": {
      "post": {
        "operationId": "run-sync-zhucl1006-us-federal-contract-awards-usaspending",
        "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": {
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Start of the date range (YYYY-MM-DD). Default: 14 days ago. Earliest 2007-10-01. Wide ranges with no filters return many awards - keep maxItems sensible."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End of the date range (YYYY-MM-DD, inclusive). Default: today."
          },
          "dateType": {
            "title": "Date applies to",
            "enum": [
              "new_awards_only",
              "action_date",
              "date_signed",
              "last_modified_date"
            ],
            "type": "string",
            "description": "'New awards only' finds contracts first awarded in the range - best for fresh leads.",
            "default": "new_awards_only"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words or phrases searched in award descriptions, recipient names and IDs (USAspending keyword search).",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "NAICS codes or prefixes, e.g. 541512 (computer systems design), 5415, 236220.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product/Service Codes, e.g. D318, R425, DA01.",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Partial agency names or abbreviations, e.g. 'Department of Defense', 'DOD', 'Veterans Affairs', 'NASA', or a sub-agency like 'Army Corps of Engineers'.",
            "items": {
              "type": "string"
            }
          },
          "recipients": {
            "title": "Recipient names / UEI",
            "type": "array",
            "description": "Recipient (contractor) names or UEIs, e.g. 'Booz Allen', 'TJNDFEALGTB5'.",
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceStates": {
            "title": "Place of performance states",
            "type": "array",
            "description": "Two-letter US state codes, e.g. VA, TX, CA.",
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards with at least this total value."
          },
          "maxAmount": {
            "title": "Maximum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards up to this total value."
          },
          "awardType": {
            "title": "Award type",
            "enum": [
              "contracts",
              "idvs",
              "grants",
              "loans",
              "direct_payments",
              "other"
            ],
            "type": "string",
            "description": "USAspending award category.",
            "default": "contracts"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "amountDesc",
              "amountAsc",
              "startDateDesc",
              "lastModifiedDesc"
            ],
            "type": "string",
            "description": "Order of results (also decides which awards are kept when maxItems cuts the list).",
            "default": "amountDesc"
          },
          "maxItems": {
            "title": "Max award records",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum award records to output (0 = no limit, capped at 10,000 per run). You pay per record.",
            "default": 1000
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "records",
              "summary",
              "both"
            ],
            "type": "string",
            "description": "Award records and/or a ranking of top recipients/agencies/NAICS/PSC/states (ranking uses up to 10,000 matching awards).",
            "default": "records"
          },
          "summaryBy": {
            "title": "Rank by",
            "enum": [
              "recipient",
              "agency",
              "subAgency",
              "naics",
              "psc",
              "state"
            ],
            "type": "string",
            "description": "Grouping for the spend ranking.",
            "default": "recipient"
          },
          "summaryTopN": {
            "title": "Ranking rows",
            "minimum": 0,
            "type": "integer",
            "description": "Top N ranking rows (0 = all).",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}