{
  "openapi": "3.0.1",
  "info": {
    "title": "Grants Closing Soon Alerts (Grants.gov + SAM.gov)",
    "description": "Federal grants closing in the next N days, sorted by deadline with days left. Filter by keyword, agency, eligibility. Optional SAM.gov.",
    "version": "0.0",
    "x-build-id": "EWb8n4OhhcKcw9Cmj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/utility-belt-labs~grants-closing-soon-alerts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-utility-belt-labs-grants-closing-soon-alerts",
        "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/utility-belt-labs~grants-closing-soon-alerts/runs": {
      "post": {
        "operationId": "runs-sync-utility-belt-labs-grants-closing-soon-alerts",
        "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/utility-belt-labs~grants-closing-soon-alerts/run-sync": {
      "post": {
        "operationId": "run-sync-utility-belt-labs-grants-closing-soon-alerts",
        "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": {
          "daysAhead": {
            "title": "Closing within N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Return opportunities whose close date is at most this many days from today (US Eastern date). Today counts as 0 days left.",
            "default": 14
          },
          "minDaysLeft": {
            "title": "At least N days left",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Skip opportunities that close sooner than this, e.g. 3 to hide ones you can no longer realistically apply for. 0 keeps everything including items closing today.",
            "default": 0
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Optional. One search per keyword; results are merged and de-duplicated, and each row lists the keywords it matched. Leave empty to list everything closing in the window. Use quotes for an exact phrase (Grants.gov), e.g. \"clean water\". On SAM.gov keywords match the notice title.",
            "items": {
              "type": "string"
            }
          },
          "agencies": {
            "title": "Agencies (Grants.gov)",
            "type": "array",
            "description": "Optional. Agency codes or names, e.g. HHS, NSF, DOE, \"Department of Energy\", HHS-NIH11. A parent agency such as HHS or DOD includes all of its sub-agencies.",
            "items": {
              "type": "string"
            }
          },
          "eligibilities": {
            "title": "Eligible applicant types (Grants.gov)",
            "type": "array",
            "description": "Optional. Only grants open to at least one of the selected applicant types.",
            "items": {
              "type": "string",
              "enum": [
                "00",
                "01",
                "02",
                "04",
                "05",
                "06",
                "07",
                "08",
                "11",
                "12",
                "13",
                "20",
                "21",
                "22",
                "23",
                "25",
                "99"
              ],
              "enumTitles": [
                "State governments",
                "County governments",
                "City or township governments",
                "Special district governments",
                "Independent school districts",
                "Public / state-controlled higher education",
                "Native American tribal governments (federally recognized)",
                "Public / Indian housing authorities",
                "Native American tribal organizations (other)",
                "Nonprofits with 501(c)(3) status",
                "Nonprofits without 501(c)(3) status",
                "Private institutions of higher education",
                "Individuals",
                "For-profit organizations (other than small business)",
                "Small businesses",
                "Others (see listing)",
                "Unrestricted (open to any entity)"
              ]
            }
          },
          "fundingCategories": {
            "title": "Funding categories (Grants.gov)",
            "type": "array",
            "description": "Optional. Only grants in at least one of the selected categories.",
            "items": {
              "type": "string",
              "enum": [
                "AG",
                "AR",
                "BC",
                "CD",
                "CP",
                "DPR",
                "ED",
                "ELT",
                "EN",
                "ENV",
                "FN",
                "HL",
                "HO",
                "HU",
                "ISS",
                "IIJ",
                "LJL",
                "NR",
                "OZ",
                "O",
                "RT",
                "ST",
                "T"
              ],
              "enumTitles": [
                "Agriculture",
                "Arts",
                "Business and Commerce",
                "Community Development",
                "Consumer Protection",
                "Disaster Prevention and Relief",
                "Education",
                "Employment, Labor and Training",
                "Energy",
                "Environment",
                "Food and Nutrition",
                "Health",
                "Housing",
                "Humanities",
                "Income Security and Social Services",
                "Infrastructure Investment and Jobs Act (IIJA)",
                "Law, Justice and Legal Services",
                "Natural Resources",
                "Opportunity Zone Benefits",
                "Other",
                "Recreation and Tourism",
                "Science, Technology and other R&D",
                "Transportation"
              ]
            }
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Grants.gov needs no key. SAM.gov contract opportunities need your own free SAM.gov API key (below).",
            "items": {
              "type": "string",
              "enum": [
                "grants",
                "sam"
              ],
              "enumTitles": [
                "Grants.gov (grants, no key)",
                "SAM.gov (contract opportunities, your own free key)"
              ]
            },
            "default": [
              "grants"
            ]
          },
          "includeDetails": {
            "title": "Add grant details",
            "type": "boolean",
            "description": "Adds description, award ceiling/floor, total funding, expected awards, cost sharing and eligible applicants for each Grants.gov row (one extra API call each).",
            "default": false
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Return only opportunities not reported by an earlier run that used the same state store name. Ideal for scheduled daily or weekly alerts. The first run returns everything in the window.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Name of the key-value store that remembers what was already reported (used only with 'Only new since last run'). Use a different name per alert configuration. Lowercase letters, digits and dashes.",
            "default": "grants-closing-soon-state"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum rows returned in total.",
            "default": 200
          },
          "samApiKey": {
            "title": "SAM.gov API key",
            "type": "string",
            "description": "Only needed when SAM.gov is selected. Free: sign in at sam.gov, Account Details, Public API Key. Stored as a secret and sent only to api.sam.gov."
          },
          "samNaics": {
            "title": "SAM.gov NAICS code",
            "type": "string",
            "description": "Optional 6-digit NAICS code, e.g. 541511."
          },
          "samSetAside": {
            "title": "SAM.gov set-aside code",
            "type": "string",
            "description": "Optional, e.g. SBA, 8A, WOSB, SDVOSBC, HZC."
          },
          "samNoticeType": {
            "title": "SAM.gov notice type",
            "enum": [
              "",
              "o",
              "k",
              "r",
              "p",
              "s"
            ],
            "type": "string",
            "description": "Optional. Leave on 'Any' to include all notice types that have a response deadline.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}