{
  "openapi": "3.0.1",
  "info": {
    "title": "SAM.gov Amendment Diff & USAspending Incumbent Recompete Radar",
    "description": "Stateful U.S. federal GovCon intelligence Actor that tracks SAM.gov solicitation modifications (surviving the 10-req/day basic quota via limit=1000 and line-by-line Bulk CSV Fallback) and cross-walks against keyless USAspending.gov expiring awards to surface incumbent contractors.",
    "version": "1.0",
    "x-build-id": "LLWcFUMFKgHBDYhMI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/duypham~samgov-recompete-delta/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-duypham-samgov-recompete-delta",
        "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/duypham~samgov-recompete-delta/runs": {
      "post": {
        "operationId": "runs-sync-duypham-samgov-recompete-delta",
        "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/duypham~samgov-recompete-delta/run-sync": {
      "post": {
        "operationId": "run-sync-duypham-samgov-recompete-delta",
        "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",
            "type": "string",
            "description": "Your personal or system api.sam.gov key used to fetch live incremental contract opportunities (limit=1000 per page to stay well within the 10-req/day basic quota). Not required when ingestionMode is set to BULK_EXTRACT_FALLBACK."
          },
          "ingestionMode": {
            "title": "SAM.gov Ingestion Mode",
            "enum": [
              "API_INCREMENTAL",
              "BULK_EXTRACT_FALLBACK"
            ],
            "type": "string",
            "description": "Chooses between real-time REST pagination (API_INCREMENTAL, requires samApiKey) and keyless public Contract Opportunities data extracts (BULK_EXTRACT_FALLBACK). Both modes feed the exact same stateful diff engine and PPE billing rules.",
            "default": "API_INCREMENTAL"
          },
          "naicsCodes": {
            "title": "Target NAICS Industry Codes",
            "type": "array",
            "description": "Optional list of 6-digit North American Industry Classification System codes (e.g., ['541511', '541512']) to filter federal solicitations and incumbent contracts.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "recompeteWindowDays": {
            "title": "Incumbent Expiration Window (Days)",
            "minimum": 30,
            "maximum": 730,
            "type": "integer",
            "description": "Forward-looking window (in days) used when querying api.usaspending.gov for expiring incumbent federal awards (End Date). Identifies upcoming recompetes 3-12 months before replacement RFPs close.",
            "default": 180
          },
          "includeUsaSpendingCrosswalk": {
            "title": "Enrich Incumbent via USAspending",
            "type": "boolean",
            "description": "Automatically cross-walks each new or modified SAM.gov solicitation against keyless USAspending.gov v2 endpoints to attach incumbent_recipient_name, recipient_uei, and historical_obligated_amount.",
            "default": true
          },
          "lookbackHours": {
            "title": "Modification Lookback (Hours)",
            "minimum": 1,
            "maximum": 168,
            "type": "integer",
            "description": "Lookback window (in hours) for scanning newly posted solicitations and solicitation amendments on SAM.gov.",
            "default": 24
          },
          "deltaStateMode": {
            "title": "Delta State Mode",
            "enum": [
              "stateful_delta_only",
              "full_snapshot"
            ],
            "type": "string",
            "description": "Controls whether the Actor emits only newly created or modified records since the last checkpoint (stateful_delta_only) or re-emits all matching records in the lookback window (full_snapshot).",
            "default": "stateful_delta_only"
          },
          "customStateKey": {
            "title": "Custom State Checkpoint Key",
            "type": "string",
            "description": "Optional identifier to isolate the stateful checkpoint cursor in the apify-delta-fleet-state Named Key-Value Store when running multiple parallel n8n/Make workflows.",
            "default": ""
          },
          "maxDeltaRecords": {
            "title": "Max Delta Records Cap",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard ceiling on the number of delta records pushed and billed per run to strictly cap your Pay-Per-Event spend.",
            "default": 100
          },
          "dryRun": {
            "title": "Dry Run (Zero Event Fee)",
            "type": "boolean",
            "description": "Validates upstream connectivity and counts how many net-new delta records match your filters without mutating your saved checkpoint cursor. Incurs $0.00 in Pay-Per-Event charges.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}