{
  "openapi": "3.0.1",
  "info": {
    "title": "Gov Bids, RFPs & Federal Awards API (SAM.gov)",
    "description": "Open government bids, RFPs and new federal contract awards from official APIs only: USAspending, SAM.gov (your own key), NYC City Record, RAMP LA, Delaware, Montgomery County MD. One normalized schema.",
    "version": "0.1",
    "x-build-id": "Gg6deWdgTDLVzciw2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/civic-data-tools~public-bid-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-civic-data-tools-public-bid-search",
        "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/civic-data-tools~public-bid-search/runs": {
      "post": {
        "operationId": "runs-sync-civic-data-tools-public-bid-search",
        "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/civic-data-tools~public-bid-search/run-sync": {
      "post": {
        "operationId": "run-sync-civic-data-tools-public-bid-search",
        "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": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Optional. Case-insensitive whole-word match on title, description, category (NAICS title for federal awards) and agency (simple plurals match; end a keyword with * for prefix match, e.g. \"landscap*\"). Leave empty to return everything open. Example: \"landscaping\", \"janitorial\".",
            "items": {
              "type": "string"
            }
          },
          "matchMode": {
            "title": "Match mode",
            "enum": [
              "any",
              "all"
            ],
            "type": "string",
            "description": "\"any\" keeps records matching at least one keyword; \"all\" requires every keyword.",
            "default": "any"
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Leave empty for all sources. SAM.gov is used only when you supply your own samApiKey.",
            "items": {
              "type": "string",
              "enum": [
                "usaspending-awards",
                "sam-gov-opportunities",
                "nyc-city-record",
                "la-ramp",
                "delaware-open-bids",
                "montgomery-county-md"
              ]
            }
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Optional two-letter codes (e.g. CA, NY). Limits local sources to those states and federal records to that place of performance.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "NAICS codes",
            "type": "array",
            "description": "Optional 2–6 digit NAICS codes (e.g. 561730 landscaping). Applied to federal sources; local sources have no NAICS and are excluded when this is set.",
            "items": {
              "type": "string"
            }
          },
          "onlyOpen": {
            "title": "Only open solicitations",
            "type": "boolean",
            "description": "Keep only solicitations whose due date is today or later. Does not affect federal award records.",
            "default": true
          },
          "postedWithinDays": {
            "title": "Posted within (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Only solicitations first posted in the last N days.",
            "default": 60
          },
          "includeFederalAwards": {
            "title": "Include new federal awards",
            "type": "boolean",
            "description": "Include newly awarded federal contracts from USAspending (who won what) alongside open solicitations.",
            "default": true
          },
          "awardsWithinDays": {
            "title": "Federal awards within (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Look-back window for new USAspending awards.",
            "default": 30
          },
          "samApiKey": {
            "title": "SAM.gov API key (optional, your own)",
            "type": "string",
            "description": "Your own free SAM.gov public API key (looks like SAM-xxxxxxxx-xxxx-…). Get it at sam.gov → sign in → Profile → Account Details → Public API Key. Enables federal open opportunities. Stored encrypted. Personal keys allow 10 requests/day (1,000 if your SAM.gov account has an entity role) and expire every 90 days – paste the new key when SAM.gov emails you."
          },
          "samMaxRequests": {
            "title": "SAM.gov requests per run",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many SAM.gov API calls this run may spend from your daily quota (personal keys: 10/day). With keywords, each keyword becomes one server-side title search when keywords ≤ this number; otherwise the newest 1,000 notices per request are scanned and matched locally. OUTPUT shows coverage.",
            "default": 1
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free app token for open-data portals (NYC, LA, Delaware, Montgomery) to avoid shared rate limits."
          },
          "maxResultsPerSource": {
            "title": "Max records per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on records kept from each source.",
            "default": 200
          },
          "maxResults": {
            "title": "Max records total",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on records (and charges) per run.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}