{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending.gov Awards Scraper",
    "description": "Scrape U.S. federal awards from the official USAspending.gov API. Query contracts, grants, loans & assistance by recipient, agency, NAICS/PSC, date & amount. One record per award — recipient, amount, agency, dates, codes + raw. Pay per award.",
    "version": "0.1",
    "x-build-id": "iPX4ahUrHLfCmvKcX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~usaspending-gov-awards-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-usaspending-gov-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/datamule~usaspending-gov-awards-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datamule-usaspending-gov-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/datamule~usaspending-gov-awards-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-usaspending-gov-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": {
          "awardGroup": {
            "title": "Award category",
            "enum": [
              "contracts",
              "idvs",
              "grants",
              "loans",
              "other_financial_assistance",
              "direct_payments"
            ],
            "type": "string",
            "description": "Which category of federal award to search. USAspending requires all award types in one query to belong to a single category, so pick one per run. Contracts = procurement (BPA calls, purchase/delivery orders, definitive contracts). IDVs = indefinite-delivery vehicles (GWAC, IDC, FSS schedules). Grants = block/formula/project grants + cooperative agreements. Loans = direct & guaranteed loans. Other financial assistance / Direct payments = the remaining assistance types.",
            "default": "contracts"
          },
          "keywords": {
            "title": "Keywords (free text)",
            "type": "string",
            "description": "Free-text search across the whole award record (maps to the API's keywords filter). e.g. \"cybersecurity\", \"cloud migration\", \"vaccine\". One term per line, or comma-separated. Combine with the filters below."
          },
          "recipientSearch": {
            "title": "Recipient (company / organization)",
            "type": "string",
            "description": "Search by recipient name — the company, university, state, or organization that received the award (recipient_search_text). e.g. \"Lockheed Martin\", \"Johns Hopkins University\". One per line, or comma-separated."
          },
          "awardingAgency": {
            "title": "Awarding agency (top-tier)",
            "type": "string",
            "description": "Filter to a single awarding top-tier agency, by its full name. e.g. \"Department of Defense\", \"Department of Health and Human Services\", \"National Aeronautics and Space Administration\". Leave empty for all agencies."
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "string",
            "description": "Filter contracts/IDVs by one or more NAICS industry codes. e.g. \"541519\" (other computer related services), \"541512\" (computer systems design). One per line, or comma-separated. (NAICS is only populated on contract-type awards.)"
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "string",
            "description": "Filter contracts/IDVs by one or more PSC (Product & Service) codes. e.g. \"D319\" (IT & telecom other), \"R425\" (engineering technical services). One per line, or comma-separated. (PSC is only populated on contract-type awards.)"
          },
          "awardTypeCodes": {
            "title": "Specific award type codes (advanced)",
            "type": "string",
            "description": "Advanced: narrow to specific award type codes WITHIN the selected category. e.g. for Contracts, \"D\" = only definitive contracts; for Grants, \"04\" = only project grants. Must belong to the chosen award category. Leave empty to include every type in the category."
          },
          "startDate": {
            "title": "Action date from",
            "type": "string",
            "description": "Only awards with an action date on or after this date (YYYY-MM-DD). USAspending's searchable history starts at 2007-10-01. Leave empty for no lower bound."
          },
          "endDate": {
            "title": "Action date to",
            "type": "string",
            "description": "Only awards with an action date on or before this date (YYYY-MM-DD). Leave empty for no upper bound."
          },
          "minAmount": {
            "title": "Minimum award amount (USD)",
            "type": "integer",
            "description": "Only awards with an amount at or above this value (US dollars). Leave empty for no minimum."
          },
          "maxAmount": {
            "title": "Maximum award amount (USD)",
            "type": "integer",
            "description": "Only awards with an amount at or below this value (US dollars). Leave empty for no maximum."
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "amount",
              "outlays",
              "loanValue",
              "subsidyCost",
              "startDate",
              "endDate",
              "lastModified",
              "recipient",
              "awardId"
            ],
            "type": "string",
            "description": "Field to sort results by. Amount / Outlays / Start date / End date / Last modified / Recipient / Award ID apply to contracts, grants and assistance; Loan value / Subsidy cost apply to loans. If a sort field doesn't apply to the chosen award category, the actor falls back to that category's default so the query always succeeds.",
            "default": "amount"
          },
          "order": {
            "title": "Sort order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Ascending or descending.",
            "default": "desc"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of award records to return. The actor paginates automatically at up to 100 per request until this many are collected or the result set is exhausted. Note: USAspending caps deep paging at roughly 10,000 records per query — refine your filters to reach the rest.",
            "default": 100
          },
          "limit": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Awards fetched per API request (1–100). Larger pages = fewer requests. Usually leave at the default.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}