{
  "openapi": "3.0.1",
  "info": {
    "title": "Federal Subcontracts & Subgrants Feed (USAspending subawards)",
    "description": "New federal subcontracts and subgrants (FFATA subawards) from the official USAspending.gov API: sub-recipient company + UEI, prime contractor, amount, agency, NAICS/PSC, assistance listing. Filters by NAICS, PSC, agency, state, keyword and 'new since last run' mode.",
    "version": "0.1",
    "x-build-id": "Ku5Hxt875JO97ryeL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/moment-data~usaspending-subawards-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-moment-data-usaspending-subawards-feed",
        "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/moment-data~usaspending-subawards-feed/runs": {
      "post": {
        "operationId": "runs-sync-moment-data-usaspending-subawards-feed",
        "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/moment-data~usaspending-subawards-feed/run-sync": {
      "post": {
        "operationId": "run-sync-moment-data-usaspending-subawards-feed",
        "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": [
              "window",
              "sinceLastRun"
            ],
            "type": "string",
            "description": "window (default): newest subawards dated within the last N days, no saved state. sinceLastRun: only subawards not delivered before for this State key, re-checking a lookback window to catch late reports; use for daily or weekly schedules.",
            "default": "window"
          },
          "categories": {
            "title": "Subaward categories",
            "type": "array",
            "description": "subcontracts = subawards under federal contracts (FSRS/SAM.gov). subgrants = subawards under grants, cooperative agreements and other assistance.",
            "items": {
              "type": "string",
              "enum": [
                "subcontracts",
                "subgrants"
              ],
              "enumTitles": [
                "Subcontracts (under prime contracts)",
                "Subgrants (under grants & assistance)"
              ]
            },
            "default": [
              "subcontracts",
              "subgrants"
            ]
          },
          "daysBack": {
            "title": "Days back (window mode)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Sub-award action dates from today minus this many days.",
            "default": 14
          },
          "lookbackDays": {
            "title": "Lookback days (sinceLastRun)",
            "minimum": 7,
            "maximum": 365,
            "type": "integer",
            "description": "Prime recipients report subawards late (often 30+ days), so sinceLastRun re-checks this window and emits only unseen subawards.",
            "default": 60
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "USAspending keyword search (description, names, IDs), e.g. cyber, drone, broadband.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Prime award NAICS codes or prefixes, e.g. 541512, 5415, 236220.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product/service codes, e.g. R425, D399, 1520.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "assistanceListings": {
            "title": "Assistance listings (CFDA)",
            "type": "array",
            "description": "Grant program numbers, e.g. 93.837, 47.049, 16.575 (subgrants only).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "awardingAgencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Top-tier agency names exactly as on USAspending, e.g. Department of Defense, Department of Energy, National Aeronautics and Space Administration.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "subRecipientStates": {
            "title": "Sub-recipient states",
            "type": "array",
            "description": "2-letter US state codes of the sub-recipient, e.g. CO, VA, TX.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "subRecipientNameContains": {
            "title": "Sub-recipient name contains",
            "type": "array",
            "description": "Any of these texts in the sub-recipient name (applied after the API search).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "primeRecipientNameContains": {
            "title": "Prime recipient name contains",
            "type": "array",
            "description": "Any of these texts in the prime contractor / grantee name, e.g. LOCKHEED, RAYTHEON, LEIDOS (applied after the API search).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum subaward amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only subawards of at least this amount."
          },
          "maxAmount": {
            "title": "Maximum subaward amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only subawards of at most this amount."
          },
          "excludeZeroAmount": {
            "title": "Exclude $0 subawards",
            "type": "boolean",
            "description": "Some primes report $0 placeholder subawards (e.g. child-care subgrant lists).",
            "default": true
          },
          "excludePersonLikeNames": {
            "title": "Exclude person-like names",
            "type": "boolean",
            "description": "Drop sub-recipients whose name looks like a private individual (entity-level output only).",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum records per run (shared across categories, interleaved newest first).",
            "default": 30
          },
          "maxPagesPerCategory": {
            "title": "Max API pages per category",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "100 subawards per page; caps API calls when client-side filters drop many rows.",
            "default": 10
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Separate saved state per saved search in sinceLastRun mode.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}