{
  "openapi": "3.0.1",
  "info": {
    "title": "US Government Grants & Contract Opportunities Feed",
    "description": "Monitor federal grants and contract opportunities via the official Grants.gov and SAM.gov APIs, plus recent USAspending awards. Keyword search, normalized JSON, new/updated flags for scheduled runs and webhooks. Pay per opportunity record ($0.001).",
    "version": "0.1",
    "x-build-id": "wIdMxLfiNIeEEJ2vt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/owlabee~gov-opportunity-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-owlabee-gov-opportunity-feed",
        "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/owlabee~gov-opportunity-feed/runs": {
      "post": {
        "operationId": "runs-sync-owlabee-gov-opportunity-feed",
        "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/owlabee~gov-opportunity-feed/run-sync": {
      "post": {
        "operationId": "run-sync-owlabee-gov-opportunity-feed",
        "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": [
          "keywords"
        ],
        "properties": {
          "keywords": {
            "title": "Keywords",
            "minItems": 1,
            "type": "array",
            "description": "Search terms, one per line. Each keyword is searched in every enabled source. Grants.gov OR-matches the words of a keyword; SAM.gov matches the notice title. The prefilled value is the cheap example used by Apify's daily automated test.",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Which official APIs to query. Grants.gov needs no key. SAM.gov needs the free personal API key in \"SAM.gov API key\" below and is skipped (with a log line) when the key is missing.",
            "items": {
              "type": "string",
              "enum": [
                "grantsGov",
                "samGov"
              ],
              "enumTitles": [
                "Grants.gov (federal grants)",
                "SAM.gov (federal contract opportunities)"
              ]
            },
            "default": [
              "grantsGov"
            ]
          },
          "oppStatuses": {
            "title": "Grants.gov opportunity statuses",
            "type": "array",
            "description": "Grants.gov statuses to include. \"posted\" = open for applications, \"forecasted\" = announced but not yet open.",
            "items": {
              "type": "string",
              "enum": [
                "forecasted",
                "posted",
                "closed",
                "archived"
              ],
              "enumTitles": [
                "Forecasted",
                "Posted",
                "Closed",
                "Archived"
              ]
            },
            "default": [
              "posted"
            ]
          },
          "postedWithinDays": {
            "title": "Posted within (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Only opportunities posted in the last N days (1–365). For USAspending awards this is the award start-date window.",
            "default": 30
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Upper bound on dataset items across all keywords and sources per run (opportunities, awards and error items). Use together with the run's maximum cost to control spend.",
            "default": 500
          },
          "fetchDetails": {
            "title": "Fetch Grants.gov details",
            "type": "boolean",
            "description": "Call the Grants.gov fetchOpportunity endpoint for each emitted grant to add award ceiling/floor, estimated funding, expected awards, eligibilities, funding categories and the description. Each detail fetch is a separate paid event.",
            "default": false
          },
          "maxDetails": {
            "title": "Max detail fetches",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap on Grants.gov detail fetches per run (only used when \"Fetch Grants.gov details\" is on).",
            "default": 100
          },
          "samApiKey": {
            "title": "SAM.gov API key",
            "type": "string",
            "description": "Your free personal SAM.gov public API key (sam.gov → sign in → Account Details → Public API Key). Required only for the SAM.gov source. Stored encrypted and never logged."
          },
          "samFilters": {
            "title": "SAM.gov filters",
            "type": "object",
            "description": "Optional SAM.gov filters: {\"naics\": \"541511\", \"setAside\": \"SBA\", \"state\": \"VA\", \"ptype\": \"o\"}. ptype codes: o = Solicitation, k = Combined Synopsis/Solicitation, p = Presolicitation, r = Sources Sought, s = Special Notice, a = Award Notice (comma-separate several). setAside codes: SBA, SBP, 8A, 8AN, HZC, HZS, SDVOSBC, SDVOSBS, WOSB, WOSBSS, EDWOSB, EDWOSBSS, LAS, IEE, ISBEE, BICiv, VSA, VSS.",
            "default": {}
          },
          "includeRecentAwards": {
            "title": "Include recent USAspending awards",
            "type": "boolean",
            "description": "Also query USAspending.gov for grants and contracts recently awarded for the same keywords — useful to see who recently won similar awards. Each award is a dataset item charged at the opportunity rate.",
            "default": false
          },
          "maxAwards": {
            "title": "Max awards per keyword",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on USAspending award records per keyword (only used when \"Include recent USAspending awards\" is on).",
            "default": 50
          },
          "onlyNewSinceLastRun": {
            "title": "Only new or updated since last run",
            "type": "boolean",
            "description": "Monitor mode for schedules: remember what was seen per source and keyword in the state store and emit only opportunities that are new or whose key fields changed, flagged with isNew / isUpdated. The first run is a baseline and emits (and charges for) everything.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that holds the monitor snapshots. Use a different name per schedule if two schedules share keywords.",
            "default": "gov-opportunity-feed-state"
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "pattern": "^https?://.+",
            "type": "string",
            "description": "If set, the Actor POSTs a JSON run summary plus the emitted items (max 500) to this URL when it finishes. Failures are logged, never fatal."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}