{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Scraper",
    "description": "USAspending Scraper is a Python tool designed to extract U.S. federal spending data, including contracts, grants, direct payments, and agency budgets, from USAspending.gov. It exports structured datasets into CSV or JSON formats for policy research, financial auditing, and market analysis",
    "version": "0.0",
    "x-build-id": "uoMy6ALzXn9zoxu8j"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/real-estate-api~USAspending-Scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-real-estate-api-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/real-estate-api~USAspending-Scraper/runs": {
      "post": {
        "operationId": "runs-sync-real-estate-api-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/real-estate-api~USAspending-Scraper/run-sync": {
      "post": {
        "operationId": "run-sync-real-estate-api-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "awards",
              "award_details",
              "recipients",
              "agencies"
            ],
            "type": "string",
            "description": "awards searches contracts, grants, loans, and IDVs. award_details loads generated_internal_id values. recipients finds contractors. agencies lists toptier budgets.",
            "default": "awards"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search text for awards or recipients. One keyword per line. Example: data analytics.",
            "items": {
              "type": "string"
            }
          },
          "awardTypes": {
            "title": "Award types",
            "type": "array",
            "description": "Award groups to search. Each group is its own request. Contracts are A B C D. Grants are 02 03 04 05. The API rejects a mix of groups in one call.",
            "items": {
              "type": "string",
              "enum": [
                "contracts",
                "idvs",
                "grants",
                "direct_payments",
                "loans",
                "other"
              ],
              "enumTitles": [
                "Contracts",
                "IDVs",
                "Grants",
                "Direct payments",
                "Loans",
                "Other"
              ]
            },
            "default": [
              "contracts"
            ]
          },
          "dateFrom": {
            "title": "Action date from",
            "type": "string",
            "description": "Earliest 2007-10-01. Default: 1 year ago. Earlier dates are moved up to 2007-10-01."
          },
          "dateTo": {
            "title": "Action date to",
            "type": "string",
            "description": "End of the action-date window. Default: today."
          },
          "awardingAgencies": {
            "title": "Awarding agencies (toptier names)",
            "type": "array",
            "description": "Exact toptier names, for example Department of Defense. Names are checked with the awarding-agency autocomplete endpoint.",
            "items": {
              "type": "string"
            }
          },
          "recipients": {
            "title": "Recipient name contains",
            "type": "array",
            "description": "Recipient name text sent as recipient_search_text on award search, or as the keyword in recipients mode when Keywords is empty.",
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceStates": {
            "title": "Place of performance states (2-letter)",
            "type": "array",
            "description": "Two-letter USPS codes. Each code is sent as country USA plus that state.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "NAICS codes sent as naics_codes. Checked live with 541511 on contract search.",
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Min award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Lower bound in USD, sent as award_amounts.lower_bound. Leave empty to skip the filter. Checked live."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "Award Amount",
              "Start Date",
              "End Date",
              "Last Modified Date"
            ],
            "type": "string",
            "description": "Sort field for award search, descending. Loans use Loan Value and Issued Date because that group has no Award Amount field.",
            "default": "Award Amount"
          },
          "includeDetails": {
            "title": "Fetch award details (UEI, location, business categories)",
            "type": "boolean",
            "description": "1 extra request per award. Adds UEI, place of performance, business categories, and subaward count. Up to 3 detail calls at a time.",
            "default": false
          },
          "awardIds": {
            "title": "generated_internal_id values (award_details mode)",
            "type": "array",
            "description": "USAspending generated_internal_id values for award_details mode. Example: CONT_AWD_70CTD022FR0000002_7012_GS35F386DA_4732.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max results (total)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Free version cap: 10,000 per run. Stops paging once this many awards, recipients, or agencies are kept. Duplicates do not count twice.",
            "default": 200
          },
          "timeoutSecs": {
            "title": "Run timeout (seconds)",
            "minimum": 1,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop the run after this many seconds and keep rows already collected. Default 300. Maximum 3600.",
            "default": 300
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Per-request HTTP timeout. Default 30. 429, 5xx, and timeouts retry with backoff capped at 60 seconds.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional proxy for USAspending requests. Default is no proxy. Turn on Apify Proxy only if requests start failing.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}