{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Subawards Scraper",
    "description": "Extract USAspending sub-awards, subrecipients, UEIs, prime award IDs, agencies, descriptions, and dollar amounts from the public API.",
    "version": "0.1",
    "x-build-id": "A0ReHJ1l2sgaR85pq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation-lab~usaspending-subawards-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation-lab-usaspending-subawards-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/automation-lab~usaspending-subawards-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automation-lab-usaspending-subawards-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/automation-lab~usaspending-subawards-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automation-lab-usaspending-subawards-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": [
          "startDate",
          "endDate",
          "maxItems"
        ],
        "properties": {
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Start of the sub-award search window in YYYY-MM-DD format.",
            "default": "2024-01-01"
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "End of the sub-award search window in YYYY-MM-DD format.",
            "default": "2024-12-31"
          },
          "awardTypeCodes": {
            "title": "Prime award type codes",
            "type": "array",
            "description": "USAspending award type codes. Defaults to grants/cooperative assistance (02, 03, 04, 05), which commonly have sub-awards.",
            "items": {
              "type": "string"
            },
            "default": [
              "02",
              "03",
              "04",
              "05"
            ]
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Optional USAspending keywords to match award text and descriptions, such as broadband, housing, wildfire, or workforce.",
            "items": {
              "type": "string"
            }
          },
          "recipientSearchText": {
            "title": "Recipient or UEI search text",
            "type": "array",
            "description": "Optional recipient names, subrecipient names, prime recipient names, or UEI values to search for.",
            "items": {
              "type": "string"
            }
          },
          "agencyNames": {
            "title": "Awarding agency names",
            "type": "array",
            "description": "Optional top-tier awarding agency names, for example Department of Homeland Security or Department of Health and Human Services.",
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum sub-award amount",
            "minimum": 0,
            "type": "number",
            "description": "Optional minimum dollar amount."
          },
          "maxAmount": {
            "title": "Maximum sub-award amount",
            "minimum": 0,
            "type": "number",
            "description": "Optional maximum dollar amount."
          },
          "maxItems": {
            "title": "Maximum sub-awards",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of sub-award rows to save to the dataset.",
            "default": 20
          },
          "pageSize": {
            "title": "Page size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "USAspending API page size. Leave at 100 for efficient scraping.",
            "default": 100
          },
          "sort": {
            "title": "Sort field",
            "enum": [
              "Sub-Award Amount",
              "Sub-Award Date",
              "Sub-Awardee Name",
              "Prime Award ID",
              "Prime Recipient Name",
              "Awarding Agency"
            ],
            "type": "string",
            "description": "Sub-award field used for sorting results.",
            "default": "Sub-Award Amount"
          },
          "order": {
            "title": "Sort order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Ascending or descending result order.",
            "default": "desc"
          },
          "rawFilters": {
            "title": "Raw USAspending filters JSON",
            "type": "object",
            "description": "Optional advanced filters object merged into the USAspending API request. Use for filters not exposed above."
          },
          "fields": {
            "title": "USAspending fields",
            "type": "array",
            "description": "Optional exact USAspending API field names. Leave blank to use the recommended sub-award fields.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}