{
  "openapi": "3.0.1",
  "info": {
    "title": "Federal Spending Forensic API",
    "description": "Uncover the $195 billion USASpending blind spot with forensic cross-referencing. Recompete Radar finds expiring contracts. Set-Aside Scanner accesses $150B+ small business market. SAM.gov integration included. Pay $0.03/result vs Bloomberg's $7,500/year.",
    "version": "1.0",
    "x-build-id": "y2CDFr70OYCO65kHN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ai_solutionist~federal-spending-forensic-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ai_solutionist-federal-spending-forensic-api",
        "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/ai_solutionist~federal-spending-forensic-api/runs": {
      "post": {
        "operationId": "runs-sync-ai_solutionist-federal-spending-forensic-api",
        "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/ai_solutionist~federal-spending-forensic-api/run-sync": {
      "post": {
        "operationId": "run-sync-ai_solutionist-federal-spending-forensic-api",
        "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": [
          "searchMode"
        ],
        "properties": {
          "searchMode": {
            "title": "Search Mode",
            "enum": [
              "contracts",
              "awards",
              "agencies",
              "subAwards",
              "forensicAudit",
              "recipients",
              "recompete",
              "setAside",
              "contractGrowth",
              "samOpportunities",
              "entityVerify"
            ],
            "type": "string",
            "description": "What type of data to extract",
            "default": "contracts"
          },
          "agency": {
            "title": "Target Agency",
            "type": "string",
            "description": "Agency name, code, or 'all' for government-wide. Examples: 'Department of Defense', 'DOD', 'HHS', 'Department of Health and Human Services'"
          },
          "naicsCode": {
            "title": "NAICS Code",
            "type": "string",
            "description": "Filter by North American Industry Classification System code (e.g., '541512' for Computer Systems Design)"
          },
          "pscCode": {
            "title": "PSC Code",
            "type": "string",
            "description": "Product/Service Code for contract type filtering"
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Search keywords for contract descriptions (comma-separated)"
          },
          "recipientName": {
            "title": "Recipient Name",
            "type": "string",
            "description": "Filter by contractor/grantee name"
          },
          "recipientState": {
            "title": "Recipient State",
            "maxLength": 2,
            "type": "string",
            "description": "Filter by recipient state (2-letter code, e.g., 'CO' for Colorado)"
          },
          "recipientCity": {
            "title": "Recipient City",
            "type": "string",
            "description": "Filter by recipient city (e.g., 'Denver')"
          },
          "placeOfPerformanceState": {
            "title": "Place of Performance State",
            "maxLength": 2,
            "type": "string",
            "description": "Where work is performed (2-letter state code)"
          },
          "fiscalYear": {
            "title": "Fiscal Year",
            "minimum": 2008,
            "maximum": 2026,
            "type": "integer",
            "description": "Federal fiscal year (October 1 - September 30). Use 2024 for FY2024.",
            "default": 2024
          },
          "dateRangeStart": {
            "title": "Date Range Start",
            "type": "string",
            "description": "Start date for award search (YYYY-MM-DD)"
          },
          "dateRangeEnd": {
            "title": "Date Range End",
            "type": "string",
            "description": "End date for award search (YYYY-MM-DD)"
          },
          "expiringWithinDays": {
            "title": "Expiring Within (Days)",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "🎯 RECOMPETE RADAR: Find contracts expiring within N days (e.g., 180 for 6 months)",
            "default": 365
          },
          "expiringAfterDays": {
            "title": "Expiring After (Days)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Minimum days until expiration (e.g., 30 to exclude imminent expirations)",
            "default": 0
          },
          "setAsideType": {
            "title": "Set-Aside Type",
            "enum": [
              "all",
              "8a",
              "hubzone",
              "sdvosb",
              "wosb",
              "edwosb",
              "sba",
              "small_business",
              "sdb"
            ],
            "type": "string",
            "description": "🏷️ SET-ASIDE SCANNER: Filter by small business program",
            "default": "all"
          },
          "minGrowthPercent": {
            "title": "Minimum Growth Percentage",
            "minimum": 50,
            "maximum": 1000,
            "type": "integer",
            "description": "📈 CONTRACT GROWTH: Flag contracts that grew by this % or more from original value",
            "default": 200
          },
          "trackModifications": {
            "title": "Track Modification History",
            "type": "boolean",
            "description": "Fetch full modification history for growth analysis (increases API calls)",
            "default": false
          },
          "crossReferenceFPDS": {
            "title": "Cross-Reference FPDS",
            "type": "boolean",
            "description": "🔍 DARK MONEY: Compare with FPDS-NG for discrepancy detection",
            "default": false
          },
          "samGovApiKey": {
            "title": "SAM.gov API Key",
            "type": "string",
            "description": "🏛️ SAM.GOV: Your API key from api.sam.gov (free registration required)"
          },
          "includeSamOpportunities": {
            "title": "Include SAM.gov Opportunities",
            "type": "boolean",
            "description": "Search live contract opportunities from SAM.gov (requires API key)",
            "default": false
          },
          "verifySamRegistration": {
            "title": "Verify SAM Registration",
            "type": "boolean",
            "description": "Cross-reference contractors with SAM.gov entity database",
            "default": false
          },
          "samNoticeType": {
            "title": "SAM.gov Notice Type",
            "enum": [
              "all",
              "o",
              "p",
              "k",
              "r",
              "s",
              "a"
            ],
            "type": "string",
            "description": "Filter SAM.gov opportunities by notice type",
            "default": "all"
          },
          "minAwardAmount": {
            "title": "Minimum Award Amount",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum contract/award value in USD"
          },
          "maxAwardAmount": {
            "title": "Maximum Award Amount",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum contract/award value in USD"
          },
          "awardType": {
            "title": "Award Type",
            "enum": [
              "all",
              "contracts",
              "idvs",
              "grants",
              "loans",
              "direct_payments",
              "other_assistance"
            ],
            "type": "string",
            "description": "Filter by type of award",
            "default": "all"
          },
          "enableForensicFlags": {
            "title": "Enable Forensic Flags",
            "type": "boolean",
            "description": "Analyze each result for discrepancies, GAO findings, and anomalies",
            "default": true
          },
          "traceSubAwards": {
            "title": "Trace Sub-Awards",
            "type": "boolean",
            "description": "Extract sub-award hierarchy for each prime contract (increases extraction time)",
            "default": false
          },
          "crossReferenceAgencyPortals": {
            "title": "Cross-Reference Agency Portals",
            "type": "boolean",
            "description": "Check agency-direct data sources for discrepancies (Dark Money detection)",
            "default": false
          },
          "includeGaoFindings": {
            "title": "Include GAO Findings",
            "type": "boolean",
            "description": "Enrich results with relevant GAO audit findings and recommendations",
            "default": true
          },
          "detectMissingAgencies": {
            "title": "Detect Missing Agencies",
            "type": "boolean",
            "description": "Flag data from the 49 agencies known to under-report to USASpending",
            "default": true
          },
          "maxResults": {
            "title": "Maximum Results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of results to return (1-1000)",
            "default": 100
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "detailed",
              "summary",
              "llm_optimized"
            ],
            "type": "string",
            "description": "How to structure the output data",
            "default": "detailed"
          },
          "includeRawApiResponse": {
            "title": "Include Raw API Response",
            "type": "boolean",
            "description": "Include the original USASpending API response for debugging",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "URL to receive notification when extraction completes"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings for API requests (optional - API is public)"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}