{
  "openapi": "3.0.1",
  "info": {
    "title": "Grant Matching & RFP Bid/No-Bid Scorer (AI) — Grants.gov",
    "description": "Rank federal grants and contract opportunities by fit to your organization. Describe your company once; the Actor fetches Grants.gov, SAM.gov and USAspending records and scores each with reasons and disqualifiers. Free rules mode or Claude tiers.",
    "version": "0.1",
    "x-build-id": "DuyLmYSK1mWnEOKGr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/owlabee~grant-matching/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-owlabee-grant-matching",
        "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~grant-matching/runs": {
      "post": {
        "operationId": "runs-sync-owlabee-grant-matching",
        "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~grant-matching/run-sync": {
      "post": {
        "operationId": "run-sync-owlabee-grant-matching",
        "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": [
          "companyProfile"
        ],
        "properties": {
          "companyProfile": {
            "title": "Company profile",
            "type": "object",
            "description": "Your organization, described once. Fields (all optional, but give at least a description, capabilities or keywords): `name`, `description` (free text), `capabilities` (list), `naicsCodes` (list, e.g. [\"541330\"]), `unspscCodes` (list of UNSPSC codes, 2–8 digits, e.g. [\"72141000\"]), `cpvCodes` (list of EU CPV codes, e.g. [\"45233140\"]), `setAsides` (list of SAM.gov codes or names: SBA, 8A, HZC, SDVOSBC, WOSB, EDWOSB, VSA…), `organizationType` (small business, nonprofit, university, state government, local government, tribal, individual, for-profit), `businessSize` (small/large or employee count), `locations` (states, regions or \"nationwide\"), `keywords` (list), `pastAwards` (list), `budgetRange` ({\"min\": 50000, \"max\": 2000000}). The prefilled profile is the sample used by Apify's daily automated test."
          },
          "opportunities": {
            "title": "Opportunities to score (optional)",
            "type": "array",
            "description": "Specific opportunities, one entry per line: Grants.gov opportunity IDs or URLs (e.g. `351083`, `https://www.grants.gov/search-results-detail/351083`), SAM.gov notice IDs or URLs (needs the SAM.gov API key below), or JSON records (a `gov-opportunity-feed` dataset item, federal or state and local (state, jurisdiction and notice type are kept), or any object with `title`, `description`, `agency`, `naicsCode`, `setAside`, `closeDate`, `url`…). Supplied records are scored without a fetch. Leave empty to use Search terms instead.",
            "default": []
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search in the enabled sources, one per line. Every match (up to Max opportunities) is fetched and scored. Used when Opportunities is empty, or in addition to it. The prefilled value is the cheap example used by Apify's daily automated test.",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "title": "Sources for search terms",
            "type": "array",
            "description": "Which official sources to search. Grants.gov, USAspending and the state and local open-data datasets need no key; SAM.gov needs the free personal API key below and is skipped (with a log line) when the key is missing. USAspending returns recent awards (who won similar work), which are scored as competitive intelligence and always carry an \"already awarded\" disqualifier. State & local searches the datasets chosen under \"State & local datasets\"; California grants adds the California Grants Portal on its own.",
            "items": {
              "type": "string",
              "enum": [
                "grantsGov",
                "samGov",
                "usaspending",
                "sled",
                "caGrants"
              ],
              "enumTitles": [
                "Grants.gov (federal grants)",
                "SAM.gov (federal contract opportunities)",
                "USAspending (recent awards, competitive intelligence)",
                "State & local bids and grants (open data; pick datasets below)",
                "California Grants Portal (state grants)"
              ]
            },
            "default": [
              "grantsGov"
            ]
          },
          "oppStatuses": {
            "title": "Grants.gov opportunity statuses",
            "type": "array",
            "description": "Grants.gov statuses to include in searches. \"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": "For search terms: only opportunities posted in the last N days (1–365). For USAspending this is the award start-date window.",
            "default": 30
          },
          "maxOpportunities": {
            "title": "Max opportunities",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper bound on opportunities scored per run across supplied records, IDs and search terms (1–1,000). Each scored opportunity is one charged item; use it together with the run's maximum cost to control spend.",
            "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 and SAM.gov notice IDs. Stored encrypted and never logged."
          },
          "samFilters": {
            "title": "SAM.gov filters",
            "type": "object",
            "description": "Optional SAM.gov search filters: {\"naics\": \"541330\", \"setAside\": \"SBA\", \"state\": \"WA\", \"ptype\": \"o,k\"}. ptype codes: o = Solicitation, k = Combined Synopsis/Solicitation, p = Presolicitation, r = Sources Sought, s = Special 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": {}
          },
          "sledJurisdictions": {
            "title": "State & local datasets",
            "type": "array",
            "description": "Which state and local datasets the \"State & local\" source searches (the same catalog as Grants.gov API & SAM.gov Scraper). Empty = the original six (la-city, nyc-sca, montgomery-md, mesa-az, cook-county-il, illinois); that meaning is fixed, so a saved input never starts running, and paying for, datasets added later. Datasets added on 2026-11-07 run only when you pick them: erate-470 = E-Rate FCC Form 470, every US school and library seeking internet, Wi-Fi and telecom bids (narrow it with \"States\"); delaware = State of Delaware open bids, with UNSPSC codes; delaware-closed = Delaware recently closed bids; ca-grants = California Grants Portal, active and forecasted state grants with eligible applicants and amounts; ny-sucf = New York State University Construction Fund design and construction procurements; txdot-lettings = TxDOT highway lettings in the next 42 days, one record per project; txdot-bid-tabulations = TxDOT bid results of the last 24 months with the apparent low bidder; baton-rouge = City of Baton Rouge and East Baton Rouge Parish bid openings (the window applies to the bid date); cook-county-buying-plan = Cook County contracts planned for the year; san-diego-county = San Diego County contracting forecast; montgomery-md-awards = Montgomery County proposed awardees; nyc-mwbe-upcoming = New York City M/WBE upcoming small purchases with NIGP codes; la-city-awards = City of Los Angeles RAMP contract awards. `all` = every dataset, including ones added in future versions (the cost grows with them). Each dataset and keyword is one search run.",
            "items": {
              "type": "string",
              "enum": [
                "la-city",
                "nyc-sca",
                "montgomery-md",
                "mesa-az",
                "cook-county-il",
                "illinois",
                "erate-470",
                "delaware",
                "delaware-closed",
                "ca-grants",
                "ny-sucf",
                "txdot-lettings",
                "txdot-bid-tabulations",
                "baton-rouge",
                "cook-county-buying-plan",
                "san-diego-county",
                "montgomery-md-awards",
                "nyc-mwbe-upcoming",
                "la-city-awards",
                "all"
              ],
              "enumTitles": [
                "City of Los Angeles, CA (open bids)",
                "New York City, NY (School Construction Authority anticipated RFPs)",
                "Montgomery County, MD (solicitations)",
                "City of Mesa, AZ (purchasing solicitations)",
                "Cook County, IL (intent to execute)",
                "State of Illinois (future construction solicitations)",
                "E-Rate FCC Form 470, all US schools and libraries (telecom and internet bids)",
                "State of Delaware (open bids, UNSPSC codes)",
                "State of Delaware (recently closed bids)",
                "California Grants Portal (state grants)",
                "New York State University Construction Fund (design and construction bids)",
                "Texas DOT lettings (next 42 days, per project)",
                "Texas DOT bid tabulations (apparent low bidder)",
                "City of Baton Rouge / East Baton Rouge Parish, LA (bid openings)",
                "Cook County, IL (buying plan: planned contracts)",
                "San Diego County, CA (contracting forecast)",
                "Montgomery County, MD (proposed awardees)",
                "New York City, NY (M/WBE upcoming small purchases)",
                "City of Los Angeles, CA (RAMP awards)",
                "All datasets, including ones added later"
              ]
            },
            "default": []
          },
          "sledStates": {
            "title": "States (national state & local datasets)",
            "type": "array",
            "description": "Optional two-letter state codes, e.g. [\"AZ\", \"CA\"]. Narrows national datasets (today erate-470) to applicants in those states; datasets that cover one state or city are not affected. Empty = every state.",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$"
            },
            "default": []
          },
          "scorer": {
            "title": "Scorer",
            "enum": [
              "rules",
              "byok",
              "hosted"
            ],
            "type": "string",
            "description": "Leave empty for the default (the Console prefills `rules` so Apify's daily automated test never calls a model; clear it or pick a mode): AI scores by the hosted Claude model (`hosted`) when the Actor has its model key configured, otherwise the free rules scorer. Set `rules` for a free, model-free run (deterministic keyword, NAICS, set-aside, eligibility, geography, deadline and budget rules, no key), or `byok` to use your own Anthropic API key (tokens billed by Anthropic to you). In hosted mode a model problem never fails the run: the opportunity gets the rules score, `scoreMethod: \"rules-fallback\"` and is charged the rules price."
          },
          "anthropicApiKey": {
            "title": "Anthropic API key (byok mode)",
            "type": "string",
            "description": "Your Anthropic API key, used only when Scorer is `byok`. Stored encrypted as a secret and sent only to api.anthropic.com. Get one at console.anthropic.com."
          },
          "modelTier": {
            "title": "Model tier (byok and hosted modes)",
            "enum": [
              "fast",
              "balanced",
              "best"
            ],
            "type": "string",
            "description": "`fast` (default): Claude Haiku 5.5, cheapest and quick. `balanced`: Claude Sonnet 5.5, better reasoning about eligibility and requirements. `best`: Claude Opus 5.5 for the most nuanced bid/no-bid judgment. In hosted mode the tier sets the per-opportunity price ($0.025 / $0.30 / $0.60); in byok mode the tier only changes what Anthropic bills you.",
            "default": "fast"
          },
          "minRulesScoreForModel": {
            "title": "Pre-screen: minimum rules score for a model call",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Model modes only. Opportunities whose deterministic rules score is below this value (0–100) are written with the rules score at the rules price and never sent to the model. 0 (default) sends every opportunity to the model. 30–40 is a sensible cut for broad search terms.",
            "default": 0
          },
          "maxInputTokens": {
            "title": "Max input tokens per opportunity (model modes)",
            "minimum": 2000,
            "maximum": 8000,
            "type": "integer",
            "description": "Descriptions longer than this (estimated) are cut to the cap before the model call and the item is marked `inputTruncated: true`. 8,000 tokens is about 28,000 characters, more than any Grants.gov synopsis or SAM.gov notice text (cut at 20,000 characters). Lower it to cut your own token cost in byok mode.",
            "default": 8000
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Opportunities processed in parallel (detail fetches and model calls). Requests to the same government host are spaced at least 500 ms apart.",
            "default": 3
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "pattern": "^https?://.+",
            "type": "string",
            "description": "If set, the Actor POSTs a JSON summary of the run (counts, verdicts, the top 10 opportunities, model token totals) to this URL — 10 s timeout, 2 retries. 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}