{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Scraper",
    "description": "Scrape US federal spending from USAspending.gov: contracts, grants, loans and direct payments by keyword, agency, recipient, state and date, with amounts, outlays, recipients, agencies, NAICS, PSC or assistance listings and links. Official data since FY2008. No API key, no login.",
    "version": "1.0",
    "x-build-id": "jDSqh4mOSmDGne7Be"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/anyxsolutions~usaspending-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-anyxsolutions-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/anyxsolutions~usaspending-scraper/runs": {
      "post": {
        "operationId": "runs-sync-anyxsolutions-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/anyxsolutions~usaspending-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-anyxsolutions-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": {
          "startUrls": {
            "title": "USAspending URLs",
            "type": "array",
            "description": "Public USAspending pages: an award page (https://www.usaspending.gov/award/CONT_AWD_FA862118F6251_9700_FA862115D6276_9700) or a recipient page (https://www.usaspending.gov/recipient/ea75ddee-2d00-ac7f-5e72-6f42d7c88c8c-C/latest), which returns that recipient's awards. Advanced-search URLs are not supported; use the filters below instead.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to find in award descriptions, recipients and programs, one search per line, at least 3 characters each, for example cybersecurity, broadband or wildfire.",
            "items": {
              "type": "string"
            }
          },
          "awardTypes": {
            "title": "Award types",
            "type": "array",
            "description": "Only return these kinds of award: contracts, contract vehicles (IDVs), grants, loans, direct payments or other financial assistance. Leave empty for every kind; they are searched in that order.",
            "items": {
              "type": "string",
              "enum": [
                "contracts",
                "idvs",
                "grants",
                "loans",
                "directPayments",
                "other"
              ],
              "enumTitles": [
                "Contracts",
                "Contract vehicles (IDVs)",
                "Grants",
                "Loans",
                "Direct payments",
                "Other assistance"
              ]
            }
          },
          "agencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Only return awards made by these federal agencies, one per line, by name or abbreviation, for example Department of Defense, DOD, NASA or HHS.",
            "items": {
              "type": "string"
            }
          },
          "recipients": {
            "title": "Recipients",
            "type": "array",
            "description": "Only return awards to these recipients, one per line, by name, UEI or DUNS number, for example Lockheed Martin or KDT2YLB34NT6. A parent company's UEI also matches its subsidiaries.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of performance (states)",
            "type": "array",
            "description": "Only return awards performed in these US states or territories, as two-letter codes, one per line, for example CA, TX or DC.",
            "items": {
              "type": "string"
            }
          },
          "dateFrom": {
            "title": "Active from",
            "type": "string",
            "description": "Only return awards with spending on or after this date, for example 2024-10-01. Award search starts at fiscal year 2008 (2007-10-01)."
          },
          "dateTo": {
            "title": "Active until",
            "type": "string",
            "description": "Only return awards with spending on or before this date, for example 2025-09-30."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "amount",
              "newest"
            ],
            "type": "string",
            "description": "Order of awards within each award type: largest amount first (loans by face value), or most recently awarded first.",
            "default": "amount"
          },
          "includeDetails": {
            "title": "Include award details",
            "type": "boolean",
            "description": "Add the full award record to every row: competition and pricing, options value, subawards, parent contract, offices, business categories, programs and funding opportunity. Adds one request per award. Award pages always include it.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum awards per source",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of awards to return per URL or search term. Leave empty for every matching award."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. USAspending is public government data and needs no proxy.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}