{
  "openapi": "3.0.1",
  "info": {
    "title": "USAspending API Scraper: Federal Contract Awards, Grant Monitor",
    "description": "For government contractors and competitor research: federal spending from the USAspending API, contract awards and grants with recipient, obligated amount, agency, dates, NAICS and PSC, one row per award. Filter by keyword, recipient, agency, NAICS, state, amount; monitoring returns only new awards.",
    "version": "0.1",
    "x-build-id": "lvCUiwzxMbUW0RxQx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neverempty~usaspending-awards-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neverempty-usaspending-awards-monitor",
        "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/neverempty~usaspending-awards-monitor/runs": {
      "post": {
        "operationId": "runs-sync-neverempty-usaspending-awards-monitor",
        "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/neverempty~usaspending-awards-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-neverempty-usaspending-awards-monitor",
        "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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words or phrases searched by USAspending in the award text. An award matches if it matches any one of the entries. Each entry needs at least 3 characters. One per line. Leave empty for no keyword filter.",
            "items": {
              "type": "string"
            }
          },
          "awardType": {
            "title": "Award type",
            "enum": [
              "contracts",
              "idvs",
              "grants",
              "direct-payments",
              "loans",
              "other"
            ],
            "type": "string",
            "description": "USAspending searches one award group per request, so one run covers one group. Run again with another group to cover more.",
            "default": "contracts"
          },
          "recipientNames": {
            "title": "Recipient name, UEI or DUNS",
            "type": "array",
            "description": "Text searched in the recipient name, UEI and DUNS (for example a competitor name). An award matches if it matches any one of the entries. One per line.",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Top-tier awarding agencies, by full name (\"Department of Homeland Security\") or abbreviation (\"DHS\"). Upper and lower case do not matter. Names are checked against the USAspending agency list before the search; a name that is not on the list stops the run with a row that says so, instead of a silent empty result. One per line.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "NAICS codes with 2, 4 or 6 digits (541512, or 5415 for the whole group). Contracts and IDVs only. One per line.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC codes",
            "type": "array",
            "description": "Product or service codes (for example DA01 or R425). Contracts and IDVs only. One per line.",
            "items": {
              "type": "string"
            }
          },
          "placeOfPerformanceStates": {
            "title": "Place of performance: states",
            "type": "array",
            "description": "Two-letter US state or territory codes of the place where the work is performed (VA, TX, DC ...). One per line.",
            "items": {
              "type": "string"
            }
          },
          "recipientStates": {
            "title": "Recipient location: states",
            "type": "array",
            "description": "Two-letter US state or territory codes of the recipient address. One per line.",
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum award amount (USD)",
            "type": "integer",
            "description": "Keep awards whose amount is at least this many dollars. The amount is the total obligated so far (for loans, the loan value), not the potential ceiling of the contract."
          },
          "maxAmount": {
            "title": "Maximum award amount (USD)",
            "type": "integer",
            "description": "Keep awards whose amount is at most this many dollars."
          },
          "awardedInLastDays": {
            "title": "In the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Keep awards whose date (see \"Date to filter on\") is within this many days before today (UTC). Use this or the two dates below, not both. Leave all three empty for every award since 2007-10-01. Not used in monitoring mode."
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Start of the date range (YYYY-MM-DD), 2007-10-01 or later. Not used in monitoring mode."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End of the date range (YYYY-MM-DD). Not used in monitoring mode."
          },
          "dateType": {
            "title": "Date to filter on",
            "enum": [
              "new-awards",
              "action-date",
              "last-modified"
            ],
            "type": "string",
            "description": "Which date the range applies to. Only used when a date range is set. The start date of a contract is the start of performance and can be in the future; it is not used for filtering.",
            "default": "new-awards"
          },
          "maxAwards": {
            "title": "Maximum awards to return",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "With monitoring off, at most this many award rows are returned, newest award first. USAspending is read 100 awards per request, one request at a time, at most one per second, and one search pages 10,000 awards deep. Not applied in monitoring mode (every new award is returned).",
            "default": 200
          },
          "monitoringMode": {
            "title": "Monitoring mode: return only newly published awards",
            "type": "boolean",
            "description": "Remembers awards between runs, per set of filters. The first run with a set of filters only remembers the matching awards first awarded in the lookback window: nothing is returned and nothing is charged. Each later run reads the matching awards of the window again, compares their USAspending IDs with what it remembers and returns only the awards that were not there before (award-returned). A run that finds no new award is charged one check (search-checked) instead. Awards are compared by ID, not by date, because awards reach USAspending late: Department of Defense contracts appear about 90 days after signing. The date inputs are not used. A monitored search must match fewer than 10,000 awards in the window. Do not run two schedules with the same filters at the same moment.",
            "default": false
          },
          "monitorLookbackDays": {
            "title": "Monitoring lookback window (days)",
            "minimum": 7,
            "maximum": 365,
            "type": "integer",
            "description": "Monitoring compares the awards whose first transaction is within this many days before today. 120 covers the roughly 90-day delay of Department of Defense contracts. Changing it starts a new memory (a first run) for the filters.",
            "default": 120
          },
          "resetMonitoringState": {
            "title": "Forget the remembered awards and start over",
            "type": "boolean",
            "description": "With monitoring on, clears what is remembered for this set of filters before the run, so the run is a first run again: matching awards are remembered and nothing is returned. Use it for one run and turn it off again.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}