{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Awards - Contracts, Grants, Loans",
    "description": "Federal contracts, IDVs, grants and loans from the official USAspending.gov API v2: recipient, UEI, amount, outlays, NAICS, PSC, agency, place of performance.",
    "version": "0.1",
    "x-build-id": "VBMAtrGmF3o1xahK0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/knotty_mistveil~usaspending-federal-awards/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-knotty_mistveil-usaspending-federal-awards",
        "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/knotty_mistveil~usaspending-federal-awards/runs": {
      "post": {
        "operationId": "runs-sync-knotty_mistveil-usaspending-federal-awards",
        "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/knotty_mistveil~usaspending-federal-awards/run-sync": {
      "post": {
        "operationId": "run-sync-knotty_mistveil-usaspending-federal-awards",
        "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": {
          "awardGroup": {
            "title": "Award group",
            "enum": [
              "contracts",
              "idvs",
              "grants",
              "loans",
              "direct-payments",
              "other",
              "all"
            ],
            "type": "string",
            "description": "Which family of federal awards to return. USAspending only allows one family per query, so \"All award types\" runs one query per family and merges them into a single sorted stream. Contracts = A/B/C/D, IDVs = IDV_A..IDV_E, grants = 02/03/04/05, loans = 07/08, direct payments = 06/10, other = 09/11.",
            "default": "contracts"
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 7000,
            "type": "integer",
            "description": "Look-back window in days, ending today. Ignored when Date from / Date to are set. USAspending finishes loading a day's awards about 3 to 4 days later, so a window shorter than a week is always incomplete at its newest edge.",
            "default": 30
          },
          "dateFrom": {
            "title": "Date from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Start of the window, YYYY-MM-DD (inclusive). Overrides Days back. The award search does not go back beyond 2007-10-01."
          },
          "dateTo": {
            "title": "Date to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "End of the window, YYYY-MM-DD (inclusive). Defaults to today."
          },
          "dateType": {
            "title": "Date the window applies to",
            "enum": [
              "action_date",
              "new_awards_only",
              "date_signed",
              "last_modified_date"
            ],
            "type": "string",
            "description": "Which award date the window is matched against. Action date = the latest transaction on the award (the default; catches modifications to old awards too). New awards only = the award's base transaction, so you get genuinely new awards. Date signed behaves the same as new awards only. Last modified date = when USAspending last touched the record, which is the widest of the four.",
            "default": "action_date"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Free-text terms sent to the USAspending keyword filter, which searches the award description, recipient name, award ID and the NAICS/PSC descriptions. Terms are ORed. Empty = no keyword filter.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "NAICS industry codes or prefixes, 2 to 6 digits; an award matches when its NAICS code starts with any of them. 5415 = computer systems design, 54 = professional/scientific/technical services, 23 = construction, 3364 = aerospace, 62 = health care. Contracts and IDVs only - assistance awards carry no NAICS. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product and Service Codes or prefixes, 1 to 4 characters; an award matches when its PSC starts with any of them. D = IT and telecom services, R = professional support services, Y = construction, 70 = general purpose IT equipment. Contracts and IDVs only. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "recipientSearch": {
            "title": "Recipient search",
            "type": "array",
            "description": "Recipient names or UEI/DUNS identifiers; awards matching any of them are kept. Substrings work (\"Lockheed\" matches every Lockheed entity). Empty = all recipients.",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Top-tier awarding agency names, exactly as USAspending spells them, for example \"Department of Defense\", \"General Services Administration\", \"Department of Health and Human Services\". The full list is at https://api.usaspending.gov/api/v2/references/toptier_agencies/. An unambiguous partial name is accepted; an unknown name stops the run instead of quietly returning nothing. Empty = all agencies.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place of performance states",
            "type": "array",
            "description": "Two-letter US state or territory codes for where the work is performed, for example VA, TX, CA, PR. Empty = the whole country and overseas.",
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum award amount",
            "minimum": 0,
            "maximum": 1000000000000,
            "type": "integer",
            "description": "Keep only awards worth at least this much in USD (the total award amount over the award's life, not the amount obligated inside the window). 0 = no minimum. Applied by USAspending for every family except loans, where its amount filter reads the obligation rather than the loan's face value and would drop the largest loans - loans are filtered on the loan value itself while paging, so the run scans more records than it returns and the loan figure in SUMMARY.availableOnSource is an upper bound.",
            "default": 0
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "amount",
              "lastModified"
            ],
            "type": "string",
            "description": "Award amount returns the biggest awards first, which is what you want when maxItems is smaller than the match count. Last modified date returns the most recently updated records first, which is what you want for a daily monitoring feed.",
            "default": "amount"
          },
          "order": {
            "title": "Sort order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Descending (biggest / newest first) or ascending.",
            "default": "desc"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many awards. You are charged per award delivered, so this is also the cost cap. Federal spending is high volume - roughly 9,000 to 15,000 awards have an action on a normal weekday - so anything smaller than the match count keeps only the top N by the sort you chose. The run logs how many awards actually match and writes the figure to the SUMMARY record.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}