{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending.gov Scraper: Awards, Recipients & Aggregates",
    "description": "Search federal awards, subawards, recipients, NAICS/PSC filters, category totals, and state/county/district geography aggregates from the official public USAspending.gov API. No API key required.",
    "version": "1.0",
    "x-build-id": "fXQXKhfxcrTtvu1ee"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/autofacts~usaspending-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-autofacts-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/autofacts~usaspending-scraper/runs": {
      "post": {
        "operationId": "runs-sync-autofacts-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/autofacts~usaspending-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-autofacts-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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "awards",
              "awardDetail",
              "subawards",
              "recipient",
              "byCategory",
              "geography"
            ],
            "type": "string",
            "description": "Choose the USAspending workflow to run.",
            "default": "awards"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Free-text USAspending keyword filters.",
            "items": {
              "type": "string"
            }
          },
          "fiscalYear": {
            "title": "Fiscal year",
            "type": "integer",
            "description": "Federal fiscal year. FY 2025 maps to 2024-10-01 through 2025-09-30."
          },
          "dateFrom": {
            "title": "Date from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Start date in YYYY-MM-DD format. Provide with Date to."
          },
          "dateTo": {
            "title": "Date to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "End date in YYYY-MM-DD format. Provide with Date from."
          },
          "dateSlice": {
            "title": "Date slicing",
            "enum": [
              "none",
              "month",
              "quarter"
            ],
            "type": "string",
            "description": "Split date ranges into monthly or quarterly API windows for large result sets.",
            "default": "none"
          },
          "awardTypes": {
            "title": "Award type codes",
            "type": "array",
            "description": "USAspending award type codes. Mixed groups are split into valid API requests automatically.",
            "items": {
              "type": "string"
            }
          },
          "agency": {
            "title": "Agency name",
            "type": "string",
            "description": "Exact agency name, e.g. Department of Defense."
          },
          "agencyType": {
            "title": "Agency type",
            "enum": [
              "awarding",
              "funding"
            ],
            "type": "string",
            "description": "Whether the agency filter applies to awarding or funding agency.",
            "default": "awarding"
          },
          "agencyTier": {
            "title": "Agency tier",
            "enum": [
              "toptier",
              "subtier"
            ],
            "type": "string",
            "description": "Top-tier or sub-tier agency matching.",
            "default": "toptier"
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Required NAICS codes.",
            "items": {
              "type": "string"
            }
          },
          "excludeNaicsCodes": {
            "title": "Exclude NAICS codes",
            "type": "array",
            "description": "NAICS codes to exclude.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product/service codes.",
            "items": {
              "type": "string"
            }
          },
          "recipientSearch": {
            "title": "Recipient search",
            "type": "string",
            "description": "Recipient name or identifier text for award search filters."
          },
          "minAmount": {
            "title": "Minimum award amount",
            "type": "number",
            "description": "Lower bound for award amount filters."
          },
          "maxAmount": {
            "title": "Maximum award amount",
            "type": "number",
            "description": "Upper bound for award amount filters."
          },
          "awardId": {
            "title": "Generated award ID",
            "type": "string",
            "description": "Required for awardDetail and subawards modes. Use generated_internal_id from awards search."
          },
          "recipientId": {
            "title": "Recipient ID",
            "type": "string",
            "description": "Required for recipient mode, e.g. a USAspending recipient hash ending in -C or -P."
          },
          "category": {
            "title": "Category",
            "enum": [
              "recipient_duns",
              "recipient_parent_duns",
              "naics",
              "psc",
              "awarding_agency",
              "awarding_subagency",
              "funding_agency",
              "funding_subagency",
              "county",
              "district",
              "state_territory",
              "country",
              "cfda",
              "defc",
              "federal_account",
              "object_class",
              "program_activity",
              "tas"
            ],
            "type": "string",
            "description": "Aggregation category for byCategory mode.",
            "default": "recipient_duns"
          },
          "geoLayer": {
            "title": "Geography layer",
            "enum": [
              "state",
              "county",
              "district",
              "country"
            ],
            "type": "string",
            "description": "Geographic aggregation layer for geography mode.",
            "default": "state"
          },
          "scope": {
            "title": "Geography scope",
            "enum": [
              "place_of_performance",
              "recipient_location"
            ],
            "type": "string",
            "description": "Use place of performance or recipient location for geography mode.",
            "default": "place_of_performance"
          },
          "spendingLevel": {
            "title": "Spending level",
            "enum": [
              "transactions",
              "awards",
              "subawards"
            ],
            "type": "string",
            "description": "Aggregation level for category and geography modes.",
            "default": "transactions"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of items to extract and save. Each saved item is charged as one event.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}