{
  "openapi": "3.0.1",
  "info": {
    "title": "US Federal Contracts & Grants — SAM.gov + USAspending",
    "description": "Official US federal procurement data in one run: SAM.gov contract opportunities (RFPs, solicitations, sources sought, award notices), USAspending.gov award history, and Grants.gov funding opportunities. Filter by keyword, NAICS, agency, set-aside, place of performance and response deadline.",
    "version": "0.1",
    "x-build-id": "1kj81HbhxOt55bYHc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vhsgreed~us-federal-contracts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vhsgreed-us-federal-contracts",
        "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/vhsgreed~us-federal-contracts/runs": {
      "post": {
        "operationId": "runs-sync-vhsgreed-us-federal-contracts",
        "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/vhsgreed~us-federal-contracts/run-sync": {
      "post": {
        "operationId": "run-sync-vhsgreed-us-federal-contracts",
        "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": [
          "sources"
        ],
        "properties": {
          "sources": {
            "title": "Sources",
            "uniqueItems": true,
            "type": "array",
            "description": "Which official sources to pull from in this run. SAM.gov = contract opportunities; USAspending = award history / actual spend; Grants.gov = funding opportunities. The prefilled default uses the two keyless sources so a run needs no API key and finishes in seconds. Allowed values: sam.gov, usaspending.gov, grants.gov.",
            "items": {
              "type": "string"
            },
            "default": [
              "usaspending.gov",
              "grants.gov"
            ]
          },
          "samApiKey": {
            "title": "SAM.gov API key (optional)",
            "type": "string",
            "description": "Your personal SAM.gov public API key (SAM.gov → Account Details). Required only for live keyword-scoped pulls via the Get Opportunities API. Leave empty to use the free daily bulk CSV (enable 'Use bulk CSV' below) instead, which needs no key. Keys are personal to your account; the default budget is 10 requests/day for a non-federal personal key with no SAM role."
          },
          "useBulkCsv": {
            "title": "Use the free bulk CSV snapshot (no key)",
            "type": "boolean",
            "description": "When true and no SAM.gov API key is set, stream the official daily Contract Opportunities CSV (~230 MB, no key, no registration). It carries the full description text and a public opportunity link for free, but the file is large — set a small 'Max records' to stop early. Leave this OFF for a fast prefilled run.",
            "default": false
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Free-text terms matched (case-insensitive, any-of) against opportunity title / description / solicitation number. Keep narrow for SAM.gov — its rate limits make broad pulls a design constraint.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "NAICS codes to filter on (e.g. 541512). Also used for the USAspending award search.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "agencies": {
            "title": "Agencies / departments",
            "type": "array",
            "description": "Filter by associated organization name (department or subtier), e.g. \"Department of Defense\". SAM.gov accepts a single organization name per request, so each value is a separate scoped request counted against 'Max upstream API requests'.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "setAsides": {
            "title": "Set-aside codes (typeOfSetAside)",
            "uniqueItems": true,
            "type": "array",
            "description": "Small-business set-aside codes. SAM.gov accepts ONE set-aside value per request, so each code you add is executed as a separate scoped request (counted against maxApiRequests). Values are the official GSA Set-Aside codes (open.gsa.gov get-opportunities-public-api). Allowed values: SBA, SBP, 8A, 8AN, HZC, HZS, SDVOSBC, SDVOSBS, WOSB, WOSBSS, EDWOSB, EDWOSBSS, LAS, IEE, ISBEE, BICiv, VSA, VSS.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "procurementTypes": {
            "title": "Procurement types (ptype)",
            "type": "array",
            "description": "o=Solicitation, k=Combined Synopsis/Solicitation, p=Pre-solicitation, r=Sources Sought, s=Special Notice, a=Award Notice, u=Justification (J&A), g=Sale of Surplus Property, i=Intent to Bundle Requirements (DoD-funded). Retired upstream: f=Foreign Government Standard, l=Fair Opportunity/Limited Sources — use u instead. Allowed values: o, k, p, r, s, a, u, g, i.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "placeOfPerformanceState": {
            "title": "Place of performance — state",
            "type": "string",
            "description": "Two-letter US state code(s) (e.g. VA, or \"VA,MD\"). Optional. Matched against the notice place-of-performance state."
          },
          "postedFrom": {
            "title": "Posted from (YYYY-MM-DD)",
            "type": "string",
            "description": "Start of the posted-date window. SAM.gov allows at most a 1-year window per request; the actor chunks longer windows automatically. Also bounds the USAspending time period."
          },
          "postedTo": {
            "title": "Posted to (YYYY-MM-DD)",
            "type": "string",
            "description": "End of the posted-date window. Defaults to today when omitted."
          },
          "responseDeadlineFrom": {
            "title": "Response deadline from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only return opportunities whose response deadline is on/after this date. Records with no deadline are excluded when this filter is set."
          },
          "responseDeadlineTo": {
            "title": "Response deadline to (YYYY-MM-DD)",
            "type": "string",
            "description": "Only return opportunities whose response deadline is on/before this date."
          },
          "maxRecords": {
            "title": "Max records",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap on records pushed to the dataset across all sources. Split evenly between the selected sources. Keep it modest for SAM.gov runs (its API quota is the real constraint); a small value also makes the bulk-CSV path stop early.",
            "default": 200
          },
          "maxApiRequests": {
            "title": "Max upstream API requests",
            "minimum": 1,
            "type": "integer",
            "description": "Safety budget for outbound requests in this run. Keeps the actor inside a personal SAM.gov daily quota (default 10/day). SAM.gov returns no rate-limit headers, so this hard cap is the only guard.",
            "default": 9
          },
          "includeFullText": {
            "title": "Fetch full description text (API path)",
            "type": "boolean",
            "description": "If true, fetches each SAM.gov notice's full description — this costs one extra API request per notice and is usually unaffordable on a personal key. Listing description URLs is always free. Ignored on the bulk-CSV path, which already includes full text.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}