{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Grants Scraper & Monitor",
    "description": "USAspending grants scraper and monitor for US federal assistance awards. Official USAspending.gov API, no API key. Filter by Assistance Listing (CFDA), agency, recipient or performance state, amount and keywords; get only awards new since your last run.",
    "version": "0.0",
    "x-build-id": "RYewGzPKonSMHbdSF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vocal_rhapsody~usaspending-grants/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vocal_rhapsody-usaspending-grants",
        "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/vocal_rhapsody~usaspending-grants/runs": {
      "post": {
        "operationId": "runs-sync-vocal_rhapsody-usaspending-grants",
        "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/vocal_rhapsody~usaspending-grants/run-sync": {
      "post": {
        "operationId": "run-sync-vocal_rhapsody-usaspending-grants",
        "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": {
          "assistanceListings": {
            "title": "Assistance Listings (CFDA numbers)",
            "type": "array",
            "description": "Assistance Listing numbers, formerly CFDA, such as 93.847 (NIH NIDDK). Exact match. Leave empty to include all programs.",
            "items": {
              "type": "string"
            }
          },
          "assistanceTypes": {
            "title": "Additional assistance types",
            "type": "array",
            "description": "By default only grants (types 02 block, 03 formula, 04 project, 05 cooperative agreement) are returned. Add codes to also include: 06 and 10 direct payments, 07 and 08 loans, 09 insurance, 11 other. Each type group is read in a separate pass.",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Awarding agencies (text match)",
            "type": "array",
            "description": "Case-insensitive text match on the awarding department or sub-agency name, e.g. \"VETERANS\", \"HEALTH\". An award is kept if any entry matches. Leave empty to include all. Matching happens after download, so combine it with an Assistance Listing to keep runs short.",
            "items": {
              "type": "string"
            }
          },
          "recipientStates": {
            "title": "Recipient states (two-letter codes)",
            "type": "array",
            "description": "Two-letter US state codes of the recipient's location, e.g. TX. Leave empty to include all.",
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceStates": {
            "title": "Place of performance states (two-letter codes)",
            "type": "array",
            "description": "Two-letter US state codes where the work is performed, e.g. VA. Leave empty to include all.",
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards with a total obligated amount of at least this value, in US dollars. Leave empty for no minimum."
          },
          "maxAmount": {
            "title": "Maximum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards with a total obligated amount of at most this value, in US dollars. Leave empty for no maximum."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search terms passed to USAspending's own keyword search; USAspending decides which award text is matched. Leave empty to skip.",
            "items": {
              "type": "string"
            }
          },
          "lookbackDays": {
            "title": "Lookback window (days)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "How many days back to look, from 1 to 90. What counts depends on the date mode: newly published, signed, or any action. With \"Only new since last run\" on, the first run returns everything in this window, up to Max items.",
            "default": 7
          },
          "dateMode": {
            "title": "Date mode",
            "enum": [
              "published",
              "signed",
              "anyAction"
            ],
            "type": "string",
            "description": "What the lookback window refers to. \"Newly published\" (default, best for a daily new-awards feed): awards added to or changed in USAspending in the window, kept if signed within the max award age;. \"Signed\": base award signed inside the window; late-reported awards fall out of a short window. \"Any action\": any award with an action, such as a modification, in the window.",
            "default": "published"
          },
          "maxAwardAgeDays": {
            "title": "Max award age (days since signed)",
            "minimum": 0,
            "maximum": 730,
            "type": "integer",
            "description": "Newly published mode only: skip awards signed more than this many days ago, which drops older awards that were only modified recently. Default 180, maximum 730. Raise it to also catch very late reports; set 0 to keep all ages.",
            "default": 180
          },
          "onlyNew": {
            "title": "Only new since last run (turn on for scheduled monitoring)",
            "type": "boolean",
            "description": "Turn this on in your scheduled task to return only awards not seen in earlier runs with the same filters, so a scheduled run gives you just the new awards. The list of seen awards is kept per filter combination (including date mode and assistance types) in the named key-value store \"usaspending-grants-state\" in your account. Off (the default) gives all matches in the window on every run.",
            "default": false
          },
          "resetState": {
            "title": "Reset saved state",
            "type": "boolean",
            "description": "Forget which awards were already seen for these filters and treat this run as a first run. Only applies when \"Only new since last run\" is on.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many results. You are charged per result, so this keeps the cost of a run predictable. Largest awards come first; awards beyond the cap are returned on the next run when \"Only new since last run\" is on.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}