{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Opportunities → Markdown Notice Cards",
    "description": "Search U.S. federal contract opportunities via the official SAM.gov Opportunities API v2. Markdown notice cards (agency, NAICS, dates, value, link). Bring your own free public API key. No HTML scrape, no POC email/phone. Failures free. 256 MB.",
    "version": "0.1",
    "x-build-id": "MUz3pJJdvSg90rJW9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ingenious_quip_bxq~sam-gov-opportunities-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ingenious_quip_bxq-sam-gov-opportunities-markdown",
        "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/ingenious_quip_bxq~sam-gov-opportunities-markdown/runs": {
      "post": {
        "operationId": "runs-sync-ingenious_quip_bxq-sam-gov-opportunities-markdown",
        "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/ingenious_quip_bxq~sam-gov-opportunities-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-ingenious_quip_bxq-sam-gov-opportunities-markdown",
        "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": {
          "samApiKey": {
            "title": "SAM.gov public API key (required for live data)",
            "type": "string",
            "description": "Your free SAM.gov Public API Key. Get it: sign in at https://sam.gov/ → Account Details → Public API Key (or see https://open.gsa.gov/api/get-opportunities-public-api/). Passed as the api_key query parameter. WITHOUT a key the API returns HTTP 404 — those rows are marked failed and NOT charged. Stored encrypted; never logged. The publisher does not buy or host a SAM key."
          },
          "keywords": {
            "title": "Keywords (title filter)",
            "type": "string",
            "description": "Passed to the official title query parameter (substring match on opportunity title)."
          },
          "postedFrom": {
            "title": "Posted from (MM/dd/yyyy)",
            "type": "string",
            "description": "Start of posted-date window. Format MM/dd/yyyy (SAM requirement). Max span with postedTo is 1 year. If omitted, computed from daysBack."
          },
          "postedTo": {
            "title": "Posted to (MM/dd/yyyy)",
            "type": "string",
            "description": "End of posted-date window. Format MM/dd/yyyy. Defaults to today (UTC)."
          },
          "daysBack": {
            "title": "Days back (if postedFrom omitted)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "When postedFrom is empty, search the last N days ending at postedTo/today. Max 365.",
            "default": 7
          },
          "ncode": {
            "title": "NAICS code (ncode)",
            "type": "string",
            "description": "Official ncode filter — up to 6 digits (e.g. 541512)."
          },
          "ptype": {
            "title": "Procurement type (ptype)",
            "type": "string",
            "description": "Official ptype code(s), comma-separated. o=Solicitation, p=Presolicitation, k=Combined synopsis/solicitation, r=Sources sought, s=Special notice, a=Award notice, u=Justification (J&A), g=Sale of surplus, i=Intent to bundle."
          },
          "organizationName": {
            "title": "Organization / agency name",
            "type": "string",
            "description": "Official organizationName filter (department or sub-tier keyword)."
          },
          "solnum": {
            "title": "Solicitation number",
            "type": "string",
            "description": "Official solnum filter."
          },
          "noticeIds": {
            "title": "Notice ID list (optional direct lookup)",
            "type": "array",
            "description": "Optional. When set, each noticeId is fetched via the official noticeid parameter (still requires postedFrom/postedTo window). Overrides keyword search.",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "title": "Place of performance state",
            "type": "string",
            "description": "Two-letter US state code (official state filter), e.g. VA."
          },
          "typeOfSetAside": {
            "title": "Set-aside code",
            "type": "string",
            "description": "Official typeOfSetAside (e.g. SBA, 8A, HZC, SDVOSBC, WOSB). See open.gsa.gov docs."
          },
          "status": {
            "title": "Opportunity status",
            "enum": [
              "",
              "active",
              "inactive",
              "archived",
              "cancelled",
              "deleted"
            ],
            "type": "string",
            "description": "active | inactive | archived | cancelled | deleted (when supported by SAM).",
            "default": ""
          },
          "maxNotices": {
            "title": "Max notices",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop after this many successful notice cards.",
            "default": 50
          },
          "pageSize": {
            "title": "Page size (limit per API call)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Official limit per page (max 1000). Pagination uses offset+=page.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Parallel description fetches / noticeId lookups. SAM rate-limits; 2 is usually safe.",
            "default": 2
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 6,
            "type": "integer",
            "description": "Retries for HTTP 429 (honours Retry-After), 5xx and timeouts. 400/401/403/404 (incl. missing key) are not retried.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout for each SAM.gov API call.",
            "default": 30
          },
          "fetchDescriptions": {
            "title": "Fetch description text",
            "type": "boolean",
            "description": "When true, follow the official noticedesc URL for a short description excerpt (emails/phones scrubbed). Extra API calls count against your SAM daily quota.",
            "default": true
          },
          "descriptionMaxChars": {
            "title": "Description excerpt max chars",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Truncate description excerpt. 0 skips description body even if fetchDescriptions is true.",
            "default": 800
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}