{
  "openapi": "3.0.1",
  "info": {
    "title": "US Federal Contracts & Grants Extractor (SAM.gov & Grants)",
    "description": "Extract US federal contract awards, open federal grant opportunities, and live SAM.gov solicitations into one clean schema. Works out-of-the-box with ZERO API keys on USAspending.gov & Grants.gov, plus optional SAM.gov v2 support.",
    "version": "0.1",
    "x-build-id": "OPbogMs3TiDGWm2Ej"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/edenwood.ai~federal-contracts-grants/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-edenwood.ai-federal-contracts-grants",
        "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/edenwood.ai~federal-contracts-grants/runs": {
      "post": {
        "operationId": "runs-sync-edenwood.ai-federal-contracts-grants",
        "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/edenwood.ai~federal-contracts-grants/run-sync": {
      "post": {
        "operationId": "run-sync-edenwood.ai-federal-contracts-grants",
        "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": [
          "sources"
        ],
        "properties": {
          "sources": {
            "title": "Federal Data Sources",
            "uniqueItems": true,
            "type": "array",
            "description": "Select which official US federal APIs to query. 'usaspending' and 'grants_gov' work with ZERO API keys; 'sam_gov' requires your free samApiKey.",
            "items": {
              "type": "string",
              "enum": [
                "usaspending",
                "grants_gov",
                "sam_gov"
              ]
            },
            "default": [
              "usaspending",
              "grants_gov"
            ]
          },
          "usaSpendingAwardCategory": {
            "title": "USAspending Award Category",
            "enum": [
              "contracts",
              "grants"
            ],
            "type": "string",
            "description": "Choose whether USAspending queries federal contracts (A-D) or federal grants (02-05).",
            "default": "contracts"
          },
          "keywords": {
            "title": "Search Keywords",
            "type": "array",
            "description": "Keywords to search across contract awards, grants, or SAM.gov solicitation titles.",
            "default": [
              "cybersecurity",
              "artificial intelligence"
            ],
            "items": {
              "type": "string"
            }
          },
          "postedFrom": {
            "title": "Posted / Start Date From (Optional, YYYY-MM-DD)",
            "type": "string",
            "description": "Start of date window in YYYY-MM-DD format. Leave blank to default to 30 days ago."
          },
          "postedTo": {
            "title": "Posted / Start Date To (Optional, YYYY-MM-DD)",
            "type": "string",
            "description": "End of date window in YYYY-MM-DD format. Leave blank to default to today (UTC)."
          },
          "naicsCodes": {
            "title": "NAICS Codes (Optional)",
            "type": "array",
            "description": "6-digit NAICS industry codes (e.g. '541511', '541512') for USAspending and SAM.gov.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "agencyFilter": {
            "title": "Agency Filter (Optional)",
            "type": "string",
            "description": "Case-insensitive substring matched against awarding agency name or code (e.g. 'Defense', 'DHS', 'HHS').",
            "default": ""
          },
          "minAwardAmountUsd": {
            "title": "Minimum Award Amount (USD, Optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Filter USAspending awards to at least this dollar amount."
          },
          "samApiKey": {
            "title": "SAM.gov Public API Key (Optional Secret)",
            "type": "string",
            "description": "Required only when 'sam_gov' is included in sources. Stored encrypted as a secret and scrubbed from all logs."
          },
          "maxSamRequests": {
            "title": "Max SAM.gov API Requests Per Run",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Safety cap protecting free SAM.gov public API keys (10 requests/day quota).",
            "default": 5
          },
          "maxResultsPerSource": {
            "title": "Max Results Per Source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum post-filter deduplicated records per source.",
            "default": 50
          },
          "maxTotalResults": {
            "title": "Max Total Results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard ceiling on total records extracted across all sources.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}