{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending Federal Spending API: Contracts & Grants",
    "description": "Search USAspending federal spending: awarded US contracts, grants, loans and other awards by keyword, recipient, agency, NAICS, PSC, state or date. Organisation recipients only. Official USAspending.gov API, no key.",
    "version": "0.1",
    "x-build-id": "MvKl8mXvYdMZKai4U"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yourevenings~usaspending-federal-awards/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yourevenings-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/yourevenings~usaspending-federal-awards/runs": {
      "post": {
        "operationId": "runs-sync-yourevenings-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/yourevenings~usaspending-federal-awards/run-sync": {
      "post": {
        "operationId": "run-sync-yourevenings-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": {
          "awardTypes": {
            "title": "Award types",
            "type": "array",
            "description": "One or more of <code>contracts</code>, <code>idvs</code>, <code>grants</code>, <code>loans</code>, <code>direct_payments</code>, <code>other</code>. Contracts are purchase orders, delivery orders, definitive contracts and BPA calls. IDVs are government-wide and indefinite-delivery vehicles (GWAC, FSS, BPA, BOA, IDC). The official API searches one type group at a time; this Actor runs one search per selected group and merges the results. Defaults to contracts and grants.",
            "default": [
              "contracts",
              "grants"
            ],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words or phrases to search in the award description and other USAspending text fields. Leave empty for all awards that match the other filters.",
            "items": {
              "type": "string"
            }
          },
          "recipientName": {
            "title": "Recipient name",
            "type": "string",
            "description": "Search for a recipient organisation by name. Combined with a Unique Entity ID if both are set: the search uses the UEI, then only awards whose recipient name also matches are kept."
          },
          "recipientUei": {
            "title": "Recipient Unique Entity ID (UEI)",
            "type": "string",
            "description": "12-character SAM.gov Unique Entity ID of the recipient organisation, for example <code>YNEDGLKHU789</code>. DUNS numbers are not accepted or returned."
          },
          "awardingAgencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Awarding agency names or abbreviations as they appear on USAspending.gov, for example <code>NASA</code>, <code>Department of Veterans Affairs</code> or <code>VA</code>. Unknown names get a free status row. Leave empty for all agencies.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "North American Industry Classification System codes, or prefixes, for contract and IDV awards. For example <code>334</code> (computer and electronic manufacturing) or <code>541512</code>.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product or Service codes for contract and IDV awards, for example <code>6515</code> or <code>D399</code>.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "Place-of-performance states",
            "type": "array",
            "description": "2-letter USPS state codes for the place of performance, for example <code>CA</code> or <code>TX</code>. Leave empty for all states and countries.",
            "items": {
              "type": "string"
            }
          },
          "awardedWithinDays": {
            "title": "Awarded within the last N days",
            "minimum": 0,
            "maximum": 36500,
            "type": "integer",
            "description": "Only awards whose action date (or the date type you choose) falls in the last N days. Set 0 for no rolling window. Ignored when 'Awarded since' is set. The USAspending search API covers 1 October 2007 onwards.",
            "default": 30
          },
          "awardedSince": {
            "title": "Awarded since (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional start date. Overrides 'Awarded within the last N days'. Earliest date the search API accepts is 2007-10-01."
          },
          "awardedUntil": {
            "title": "Awarded until (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional end date. Defaults to today when a start date or rolling window is set."
          },
          "dateType": {
            "title": "Date field",
            "enum": [
              "action_date",
              "date_signed",
              "last_modified_date",
              "new_awards_only"
            ],
            "type": "string",
            "description": "Which USAspending date the window applies to. <code>action_date</code> is the latest transaction on the award; <code>date_signed</code> is the base transaction; <code>new_awards_only</code> keeps awards whose base transaction falls in the window.",
            "default": "action_date"
          },
          "minAmountUsd": {
            "title": "Minimum award amount (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Only awards whose obligated amount is at least this many US dollars. Leave empty for no minimum."
          },
          "maxResults": {
            "title": "Max awards",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many organisation-recipient awards. 0 means no row cap (the run still stops at the time limit or if too many matching rows are individuals). You are charged per award returned, not for skipped individual recipients or status rows.",
            "default": 25
          },
          "monitorMode": {
            "title": "Monitor mode (only new or changed awards)",
            "type": "boolean",
            "description": "Remember what was returned and, on later runs, return only awards not returned before, or whose last-modified date or amount has changed. Schedule the Actor (for example daily) to get alerts.",
            "default": false
          },
          "emitBaselineOnFirstRun": {
            "title": "Return awards on the first monitor run",
            "type": "boolean",
            "description": "Off: the first monitor run only records what exists (no rows, no charges); later runs return new or changed awards.",
            "default": true
          },
          "stateStoreName": {
            "title": "Monitor state store name",
            "type": "string",
            "description": "Named key-value store that holds what was already returned. Use a different name for each saved search you monitor.",
            "default": "usaspending-awards-monitor"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}