{
  "openapi": "3.0.1",
  "info": {
    "title": "Grant & RFP Fit Scorer (AI) — Grants.gov, SAM.gov Bid/No-Bid",
    "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": "JdrJS7QlUvoyOwF68"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/owlabee~gov-opportunity-fit-scorer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-owlabee-gov-opportunity-fit-scorer",
        "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-fit-scorer/runs": {
      "post": {
        "operationId": "runs-sync-owlabee-gov-opportunity-fit-scorer",
        "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-fit-scorer/run-sync": {
      "post": {
        "operationId": "run-sync-owlabee-gov-opportunity-fit-scorer",
        "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\"]), `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, 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 APIs to search. Grants.gov and USAspending 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.",
            "items": {
              "type": "string",
              "enum": [
                "grantsGov",
                "samGov",
                "usaspending"
              ],
              "enumTitles": [
                "Grants.gov (federal grants)",
                "SAM.gov (federal contract opportunities)",
                "USAspending (recent awards, competitive intelligence)"
              ]
            },
            "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": {}
          },
          "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}