{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Contracts & Exclusions API - No Scraping, No Start Fee",
    "description": "Federal contract opportunities + exclusions via the official api.sam.gov REST API - not fragile site-scraping. FAR 52.209-6 batch subcontractor screening included (rare). No per-run start fee (others charge $0.10/run). Honest coverage disclosures - never a silent partial result.",
    "version": "0.1",
    "x-build-id": "G9HqSUHs6BLK82Onb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mooseandraven~samgov-federal-contracting-suite/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mooseandraven-samgov-federal-contracting-suite",
        "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/mooseandraven~samgov-federal-contracting-suite/runs": {
      "post": {
        "operationId": "runs-sync-mooseandraven-samgov-federal-contracting-suite",
        "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/mooseandraven~samgov-federal-contracting-suite/run-sync": {
      "post": {
        "operationId": "run-sync-mooseandraven-samgov-federal-contracting-suite",
        "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": {
          "samGovApiKey": {
            "title": "SAM.gov API key",
            "type": "string",
            "description": "Get this from sam.gov/profile/details (Public API Key field, after signing in) - NOT from api.data.gov. An api.data.gov key looks similar but does NOT work here (confirmed directly: it fails with a 404/empty-body 'unrecognized key' error); they are separate systems. Registering an ENTITY (not just an individual account) raises your daily quota from 10/day to 1,000/day. Full tiers: 10/day unregistered-role, 1,000/day non-federal entity role, 10,000/day .gov/.mil system account. This actor calls the official api.sam.gov REST API only - it does not scrape SAM.gov's website - and never pools multiple customers behind one key. Leave this blank to see how the actor works first: a keyless run succeeds and returns one informational record explaining what a real key unlocks, at no charge."
          },
          "datasets": {
            "title": "Datasets to fetch",
            "type": "array",
            "description": "Which SAM.gov datasets to pull this run. Wage determinations are NOT available: SAM.gov publishes them only as web pages with no official API, and scraping them would violate SAM.gov's Terms of Use (no bots/automated harvesting) — see README limitations.",
            "items": {
              "type": "string",
              "enum": [
                "opportunities",
                "exclusions"
              ]
            },
            "default": [
              "opportunities",
              "exclusions"
            ]
          },
          "naicsCodes": {
            "title": "NAICS codes (opportunities filter)",
            "type": "array",
            "description": "One or more 6-digit NAICS codes. The official API accepts one NAICS code per request, so the actor issues one paginated request sequence per code (each consumes your daily quota). Leave empty to fetch all NAICS codes (not recommended — high quota burn).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "opportunityKeyword": {
            "title": "Opportunity title keyword",
            "type": "string",
            "description": "Optional keyword filter on opportunity title (maps to the API's 'title' parameter)."
          },
          "placeOfPerformanceState": {
            "title": "Place of performance state",
            "type": "string",
            "description": "Optional 2-letter US state code to filter opportunities by place of performance."
          },
          "setAsideType": {
            "title": "Set-aside type code",
            "type": "string",
            "description": "Optional SAM.gov set-aside type code filter (e.g. SBA, 8A, WOSB, SDVOSBC)."
          },
          "postedFrom": {
            "title": "Posted from (MM/dd/yyyy)",
            "type": "string",
            "description": "Start of the opportunity posted-date window. Required by the SAM.gov API if monitorMode is off. Max 1-year range. Ignored (and computed automatically) when monitorMode is on and prior run state exists."
          },
          "postedTo": {
            "title": "Posted to (MM/dd/yyyy)",
            "type": "string",
            "description": "End of the opportunity posted-date window. Required by the SAM.gov API if monitorMode is off. Max 1-year range."
          },
          "exclusionSearch": {
            "title": "Exclusions search filters",
            "type": "object",
            "description": "Optional filters passed to the SAM.gov Exclusions API (classification, exclusionName, stateProvince, ueiSAM, cageCode, q, etc). Leave empty to fetch all active exclusions (10,000-record ceiling on the synchronous endpoint this actor uses).",
            "default": {}
          },
          "batchScreenList": {
            "title": "Batch-screen a vendor/subcontractor list (FAR 52.209-6)",
            "type": "array",
            "description": "Check a list of prospective subcontractors against SAM.gov exclusions in one run — array-of-identifiers in, matched/clear flags out. Each entry: { id?: string, ueiSAM?: string, cageCode?: string, entityName?: string } — at least one of ueiSAM/cageCode/entityName is required per entry (ueiSAM and cageCode are precise lookups; entityName is a fuzzy name search, flagged as such in the output). Identifier fields should be strings (a bare number like an unquoted CAGE code will be coerced, but quoting it yourself avoids relying on that). FAR 9.405 requires contracting officers to check SAM.gov exclusions before award; FAR 9.405-2(b) and the FAR 52.209-6 clause extend a parallel duty to PRIME CONTRACTORS — before subcontracting over $45,000 (commercial-off-the-shelf items are exempt), a prime must verify the subcontractor is not excluded. Every entry you submit gets exactly one output record (a match, a clean result, or an error) — the run never silently skips an entry, even a malformed one; if the daily API quota runs out mid-batch, a loud run-status record names exactly which entries were NOT checked, so you never mistake an unscreened entry for a cleared one. Shares this run's request budget with the opportunities/exclusions datasets (same daily SAM.gov quota).",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "title": "Label",
                  "type": "string",
                  "description": "Optional caller-supplied label for this entry, used to match output records back to your own list."
                },
                "ueiSAM": {
                  "title": "UEI",
                  "type": "string",
                  "description": "12-char Unique Entity Identifier — the most precise lookup."
                },
                "cageCode": {
                  "title": "CAGE code",
                  "type": "string",
                  "description": "CAGE code — a precise lookup."
                },
                "entityName": {
                  "title": "Entity/individual name",
                  "type": "string",
                  "description": "Business or individual name — a fuzzy search, flagged as such in the output."
                }
              }
            },
            "default": []
          },
          "monitorMode": {
            "title": "Incremental monitor mode",
            "type": "boolean",
            "description": "When on, the actor remembers the last successful run's cutoff (per Apify key-value store) and only requests opportunities posted / exclusions updated since then, instead of a full re-pull. Designed for scheduled runs. Charges one monitor-run PPE event in addition to per-record events.",
            "default": false
          },
          "maxRecordsPerRun": {
            "title": "Max records per dataset (quota guard)",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap on records fetched, applied INDEPENDENTLY to opportunities and exclusions (not shared between them — a shared budget used to mean opportunities could silently starve exclusions of any processing at all). Set to 0 for no record cap (see maxRequestsPerRun for the real quota guard).",
            "default": 5000
          },
          "maxRequestsPerRun": {
            "title": "Max SAM.gov API requests per run (the real quota guard)",
            "minimum": 0,
            "type": "integer",
            "description": "SAM.gov's actual daily quota is REQUEST-count-based (10/1,000/10,000 per day depending on your key tier), not record-count-based — exclusions page at only 10 records/request, so an unfiltered pull can burn hundreds of requests fast. This is a SHARED budget across opportunities + exclusions + batchScreenList in the same run (they all draw on the same daily quota). If this cap truncates a dataset or the batch screen, the actor emits a loud `run-status`/`batch-screen-status` TRUNCATED/SKIPPED record — it never reports a partial pull (or a partially-screened batch) as complete. Set to 0 for no request cap (not recommended unless you understand your key's daily limit).",
            "default": 200
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}