{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Scraper · Federal Contracts, Grants & Recipients",
    "description": "Scrape US federal contracts, grants, and direct payments from USAspending.gov by agency, NAICS code, PSC code, award type, state, fiscal year, and dollar amount.",
    "version": "1.0",
    "x-build-id": "n1B54VyWf3akctrkJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/reapx~usaspending-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-reapx-usaspending-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/reapx~usaspending-scraper/runs": {
      "post": {
        "operationId": "runs-sync-reapx-usaspending-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/reapx~usaspending-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-reapx-usaspending-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",
        "required": [
          "maxItems"
        ],
        "properties": {
          "awardTypeCodes": {
            "title": "Award Type Codes",
            "type": "array",
            "description": "Select federal award types to include: <code>A</code>, <code>B</code>, <code>C</code>, <code>D</code> for prime contract awards; <code>02</code>, <code>03</code>, <code>04</code>, <code>05</code> for grants. <br><br><b>Consequence:</b> Selecting specific award types narrows the search; leaving empty returns prime contracts.<br><br>Leave this field empty to include every option."
          },
          "startDate": {
            "title": "Start Date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Filter awards starting on or after this date formatted as <code>YYYY-MM-DD</code> (e.g. <code>2023-10-01</code> for FY2024 start). <br><br><b>Consequence:</b> A wider date range increases matching award volume and run duration. Leave empty to omit lower date limit."
          },
          "endDate": {
            "title": "End Date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Filter awards ending on or before this date formatted as <code>YYYY-MM-DD</code> (e.g. <code>2024-09-30</code> for FY2024 end). <br><br><b>Consequence:</b> Narrowing the period reduces matching award volume. Leave empty for default fiscal year end."
          },
          "agencyName": {
            "title": "Awarding Agency Name",
            "type": "string",
            "description": "Top-tier federal awarding department name (e.g. <code>Department of Defense</code> or <code>Department of Veterans Affairs</code>). <br><br><b>Consequence:</b> Restricts spending search to awards issued by the named department. Leave empty to search across all agencies."
          },
          "naicsCodes": {
            "title": "NAICS Industry Codes",
            "type": "array",
            "description": "List of 6-digit NAICS industry codes (e.g. <code>[\"541512\"]</code> for Computer Systems Design Services or <code>[\"541715\"]</code> for R&D). <br><br><b>Consequence:</b> Filters awards to specific industrial sectors. Leave empty to search across all industries."
          },
          "pscCodes": {
            "title": "PSC Product & Service Codes",
            "type": "array",
            "description": "List of Product and Service Codes (e.g. <code>[\"R425\"]</code> for Engineering Support Services or <code>[\"D302\"]</code> for IT Systems Development). <br><br><b>Consequence:</b> Narrows search to specific procurement categories. Leave empty to search across all PSC codes."
          },
          "state": {
            "title": "Recipient State Code",
            "pattern": "^[A-Z]{2}$",
            "type": "string",
            "description": "Two-letter US state postal code abbreviation (e.g. <code>VA</code>, <code>CA</code>, <code>TX</code>). <br><br><b>Consequence:</b> Narrows search to award recipient locations in that state. Leave empty to search contractors nationwide."
          },
          "minAmount": {
            "title": "Minimum Award Amount ($)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum total award value threshold in USD (e.g. <code>1000000</code> for $1M+ contracts). <br><br><b>Consequence:</b> Excludes smaller awards, reducing total returned items and run cost. Leave empty for no minimum threshold."
          },
          "maxAmount": {
            "title": "Maximum Award Amount ($)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum total award value threshold in USD (e.g. <code>50000000</code> for $50M upper limit). <br><br><b>Consequence:</b> Excludes mega-contracts above this threshold. Leave empty for no maximum threshold.<br><br>The higher the number, the longer the run takes and the more you are charged, because you pay per row returned."
          },
          "maxItems": {
            "title": "Maximum Items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum total number of federal award records to scrape and deliver in this run. <br><br><b>Consequence:</b> The higher the limit, the longer the run takes and the more items are billed. Defaults to 100.<br><br>The higher the number, the longer the run takes and the more you are charged, because you pay per row returned.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}