{
  "openapi": "3.0.1",
  "info": {
    "title": "Federal Contracts Scraper: USAspending & SAM.gov Data",
    "description": "Search US federal contracts, task orders and grants from official USAspending.gov data by keyword, NAICS, agency, state and amount. Find contracts ending soon, add competition details, and get open SAM.gov bids.",
    "version": "0.2",
    "x-build-id": "1h1QxHdNbKz2pDyGX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/techliondev~federal-contracts-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-techliondev-federal-contracts-feed",
        "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/techliondev~federal-contracts-feed/runs": {
      "post": {
        "operationId": "runs-sync-techliondev-federal-contracts-feed",
        "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/techliondev~federal-contracts-feed/run-sync": {
      "post": {
        "operationId": "run-sync-techliondev-federal-contracts-feed",
        "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": "Words or phrases to look for in award descriptions, for example \"cybersecurity\" or \"janitorial services\". Each must be at least 3 characters. Leave empty to get everything that matches the other filters.",
            "items": {
              "type": "string"
            }
          },
          "awardCategories": {
            "title": "Award types",
            "type": "array",
            "description": "Which kinds of federal awards to include. Contracts are purchase orders, delivery orders and definitive contracts. Indefinite delivery vehicles are umbrella contracts (such as IDIQs and GSA schedules) that later orders are placed against.",
            "items": {
              "type": "string",
              "enum": [
                "contracts",
                "idvs",
                "grants"
              ],
              "enumTitles": [
                "Contracts",
                "Indefinite delivery vehicles (IDIQs, schedules, blanket purchase agreements)",
                "Grants"
              ]
            },
            "default": [
              "contracts"
            ]
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Start of the date range. Pick a date or type something like \"30 days\" (meaning 30 days ago). Defaults to 90 days ago."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "End of the date range. Defaults to today."
          },
          "dateType": {
            "title": "What the dates refer to",
            "enum": [
              "action_date",
              "new_awards_only",
              "last_modified_date"
            ],
            "type": "string",
            "description": "Any activity: the award had a payment or change in the date range. New awards only: the award started in the range. Last updated: the record was updated in the range.",
            "default": "action_date"
          },
          "maxRecords": {
            "title": "Maximum award records",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most USAspending award records to save in total across all award types. Each saved record is charged, so this also caps the cost.",
            "default": 100
          },
          "excludeKeywords": {
            "title": "Skip records containing",
            "type": "array",
            "description": "Leave out awards whose description or recipient name contains any of these words, for example \"training\" or \"janitorial\". Free.",
            "items": {
              "type": "string"
            }
          },
          "naicsCodes": {
            "title": "Industry codes (NAICS)",
            "type": "array",
            "description": "Optional 2 to 6 digit industry codes, for example 541512 for computer systems design. Not used for grants.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "Product and service codes (PSC)",
            "type": "array",
            "description": "Optional federal product or service codes, for example D310 or R499. Not used for grants.",
            "items": {
              "type": "string"
            }
          },
          "awardingAgencies": {
            "title": "Awarding agencies",
            "type": "array",
            "description": "Optional full department names exactly as the government writes them, for example \"Department of Energy\" or \"Department of Defense\".",
            "items": {
              "type": "string"
            }
          },
          "recipientNames": {
            "title": "Recipient (company) names",
            "type": "array",
            "description": "Optional company names or UEI numbers to match. Partial names work, for example \"booz allen\".",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States (place of work)",
            "type": "array",
            "description": "Optional two-letter state codes for where the work is done, for example VA or TX.",
            "items": {
              "type": "string"
            }
          },
          "setAsideCodes": {
            "title": "Small-business set-asides",
            "type": "array",
            "description": "Optional set-aside codes for contracts, for example SBA (small business), 8A, HZC (HUBZone), SDVOSBC (service-disabled veteran-owned) or WOSB (women-owned).",
            "items": {
              "type": "string"
            }
          },
          "minAmount": {
            "title": "Minimum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards worth at least this many dollars."
          },
          "maxAmount": {
            "title": "Maximum award amount (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards worth at most this many dollars."
          },
          "endingBefore": {
            "title": "Ending before (find contracts up for renewal)",
            "type": "string",
            "description": "Only awards whose current end date falls between today and this date, for example \"180 days\" or 2027-06-30. Great for finding contracts that will be re-competed soon. Free; records outside the window are not charged."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "lastModified",
              "amount",
              "startDate"
            ],
            "type": "string",
            "description": "Which records come first. With a record limit, this decides which records you get.",
            "default": "lastModified"
          },
          "includeAwardDetails": {
            "title": "Add full award details ($)",
            "type": "boolean",
            "description": "Loads each award's detail record: how it was competed and how many offers were received, the set-aside, pricing type, parent contract vehicle, total potential value and end date, contracting office, subawards, the recipient's parent company, business types (small business and more) and top executive pay where reported. One extra request per award, charged as an add-on.",
            "default": false
          },
          "onlyNewRecords": {
            "title": "Only save records not seen in earlier runs",
            "type": "boolean",
            "description": "For scheduled runs: remembers which awards and opportunities earlier runs with the same search returned, and saves only new ones. The first run saves everything and marks it as seen.",
            "default": false
          },
          "includeUpdatedRecords": {
            "title": "Also save records that changed",
            "type": "boolean",
            "description": "With new-record tracking on, also save awards whose last-modified date changed since the last run (for example a new modification or more money). These rows have changeType \"updated\".",
            "default": false
          },
          "stateKey": {
            "title": "Tracking name",
            "type": "string",
            "description": "Optional name for the new-record memory, so different searches stay separate. Leave empty to use one based on your search."
          },
          "includeSamOpportunities": {
            "title": "Also get open bid opportunities from SAM.gov",
            "type": "boolean",
            "description": "Adds contract opportunities (solicitations, sources sought, pre-solicitations and award notices) from SAM.gov. This needs your own free SAM.gov API key. Uses your keywords (matched against titles), industry codes, states and dates; SAM.gov allows at most one year of posting dates.",
            "default": false
          },
          "samApiKey": {
            "title": "SAM.gov API key",
            "type": "string",
            "description": "Your personal public API key from SAM.gov (sign in, open Account Details, and request a public API key). It is stored encrypted and only sent to SAM.gov."
          },
          "samNoticeTypes": {
            "title": "SAM.gov notice types",
            "type": "array",
            "description": "Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "o",
                "k",
                "p",
                "r",
                "s",
                "a",
                "u",
                "i",
                "g"
              ],
              "enumTitles": [
                "Solicitation",
                "Combined synopsis/solicitation",
                "Pre-solicitation",
                "Sources sought",
                "Special notice",
                "Award notice",
                "Justification",
                "Intent to bundle requirements",
                "Sale of surplus property"
              ]
            }
          },
          "samMaxRecords": {
            "title": "Maximum SAM.gov opportunities",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The most SAM.gov opportunities to save.",
            "default": 200
          },
          "samIncludeContacts": {
            "title": "Include contracting officer contacts",
            "type": "boolean",
            "description": "Adds the official points of contact that SAM.gov publishes on each notice (name, work email, work phone).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}