{
  "openapi": "3.0.1",
  "info": {
    "title": "US Contracts Scraper",
    "description": "Scrape federal contract awards from USAspending.gov. Search by keyword, agency, NAICS code, and value. Get award amounts, recipients, dates, and more.",
    "version": "1.0",
    "x-build-id": "07GdUNfER29LvEgwI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/artificially~us-contracts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-artificially-us-contracts-scraper",
        "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/artificially~us-contracts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-artificially-us-contracts-scraper",
        "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/artificially~us-contracts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-artificially-us-contracts-scraper",
        "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": {
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "Keywords matched against federal contract award descriptions on USAspending.gov (at least 3 characters). Example: \"cybersecurity\" or \"cloud migration\"."
          },
          "agency": {
            "title": "Agency",
            "type": "string",
            "description": "Awarding top-tier agency name, exactly as it appears on USAspending.gov. Leave empty for all agencies. Example: \"Department of Defense\", \"General Services Administration\", \"Department of Veterans Affairs\"."
          },
          "naicsCodes": {
            "title": "NAICS Codes",
            "type": "array",
            "description": "List of NAICS industry codes (2-6 digits) to filter by. Example: [\"541511\", \"541512\"] for custom programming and computer systems design.",
            "items": {
              "type": "string"
            }
          },
          "pscCodes": {
            "title": "PSC Codes",
            "type": "array",
            "description": "List of Product and Service Codes (PSC) to filter by. Example: [\"D310\", \"R425\"].",
            "items": {
              "type": "string"
            }
          },
          "maxContracts": {
            "title": "Maximum Contracts",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of contract awards to save (1-1000), largest awards first. Each saved contract is one dataset item. Use 5-20 for quick answers.",
            "default": 100
          },
          "minValue": {
            "title": "Minimum Value",
            "type": "integer",
            "description": "Minimum award amount in USD. Example: 1000000 for awards of at least $1M."
          },
          "maxValue": {
            "title": "Maximum Value",
            "type": "integer",
            "description": "Maximum award amount in USD. Example: 50000000."
          },
          "dateFrom": {
            "title": "Date From",
            "type": "string",
            "description": "Only contracts with a transaction on or after this date, format YYYY-MM-DD. Example: \"2025-01-01\". Defaults to 2020-01-01; the earliest supported date is 2007-10-01."
          },
          "dateTo": {
            "title": "Date To",
            "type": "string",
            "description": "Only contracts with a transaction on or before this date, format YYYY-MM-DD. Example: \"2025-12-31\". Defaults to today."
          },
          "setAsideType": {
            "title": "Set-Aside Type",
            "enum": [
              "",
              "SBA",
              "8A",
              "HUB",
              "WOSB",
              "SDVOSB",
              "ISBEE"
            ],
            "type": "string",
            "description": "Small business set-aside program. Empty string = all contracts. Example: \"SDVOSB\" for service-disabled veteran-owned small business set-asides.",
            "default": ""
          },
          "includeContractorProfile": {
            "title": "Include Contractor Profile",
            "type": "boolean",
            "description": "If true, adds a contractorProfile object with business types, certifications, total contract count, top agencies, top NAICS codes and recent contracts (one extra request per contract). Set false for faster runs.",
            "default": true
          },
          "includeSubawards": {
            "title": "Include Subawards",
            "type": "boolean",
            "description": "If true, adds a subawards list of subcontracts under each prime contract (one extra request per contract).",
            "default": false
          },
          "maxSubawards": {
            "title": "Max Subawards",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum subawards listed per contract (1-100) when includeSubawards is true. Example: 10.",
            "default": 10
          },
          "includeTransactionHistory": {
            "title": "Include Transaction History",
            "type": "boolean",
            "description": "If true, adds transactionHistory with up to the 100 most recent modifications and obligations per contract (one extra request per contract).",
            "default": false
          },
          "includeRelatedContracts": {
            "title": "Include Related Contracts",
            "type": "boolean",
            "description": "If true, adds relatedContracts: the largest other awards to the same contractor (one extra request per contract).",
            "default": false
          },
          "maxRelatedContracts": {
            "title": "Max Related Contracts",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum related contracts listed per contract (1-20) when includeRelatedContracts is true. Example: 5.",
            "default": 5
          },
          "compactOutput": {
            "title": "Compact output (for AI agents)",
            "type": "boolean",
            "description": "If true, each dataset item is a slim record with only key decision fields (award ID, title, agency, recipient, UEI, amount, dates, NAICS/PSC, set-aside, competition, URL) and counts instead of contractor profiles, subaward lists, transaction history and related contracts. Recommended for AI agents and MCP clients. If false, the full record is returned.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional proxy settings. Not needed for normal use: the USAspending API is public and works without a proxy."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}