{
  "openapi": "3.0.1",
  "info": {
    "title": "CanadaBuys Tenders Scraper (Canada Government Bids)",
    "description": "Get Canadian government tenders and contract awards from CanadaBuys open data as clean JSON, CSV or Excel. Filter by keyword, UNSPSC or GSIN code, buyer, region and date. Alerts mode outputs only new notices.",
    "version": "1.0",
    "x-build-id": "gXgoz0De6VcDOwsJ4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tenderwire~canadabuys-tenders/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tenderwire-canadabuys-tenders",
        "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/tenderwire~canadabuys-tenders/runs": {
      "post": {
        "operationId": "runs-sync-tenderwire-canadabuys-tenders",
        "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/tenderwire~canadabuys-tenders/run-sync": {
      "post": {
        "operationId": "run-sync-tenderwire-canadabuys-tenders",
        "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": {
          "dataset": {
            "title": "What to get",
            "enum": [
              "open",
              "new",
              "tendersThisFiscalYear",
              "awardsThisFiscalYear",
              "awardsLastFiscalYear"
            ],
            "type": "string",
            "description": "Open tenders = every opportunity currently open for bids. New today = notices published in the latest daily update. This fiscal year = all tender notices since April 1. Awards = contract award notices (winner and value).",
            "default": "open"
          },
          "keywords": {
            "title": "Keywords (any)",
            "type": "array",
            "description": "Keep notices whose title, description or buyer contains at least one of these words. Case-insensitive.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop notices that contain any of these words.",
            "items": {
              "type": "string"
            }
          },
          "categoryPrefixes": {
            "title": "UNSPSC or GSIN code prefixes",
            "type": "array",
            "description": "Keep notices with a UNSPSC or GSIN code starting with these characters. Examples: 43 = IT equipment, 81 = engineering and IT services, 72 = construction services.",
            "items": {
              "type": "string"
            }
          },
          "procurementCategories": {
            "title": "Procurement categories",
            "type": "array",
            "description": "goods, services, works (construction) or services related to goods.",
            "items": {
              "type": "string",
              "enum": [
                "goods",
                "services",
                "works",
                "services related to goods"
              ]
            }
          },
          "buyerContains": {
            "title": "Buyer name contains",
            "type": "array",
            "description": "Keep notices from buyers whose name contains any of these texts, e.g. National Defence, Shared Services, Parks Canada.",
            "items": {
              "type": "string"
            }
          },
          "regionContains": {
            "title": "Region of delivery contains",
            "type": "array",
            "description": "Keep notices delivered to regions containing any of these texts, e.g. Ontario, British Columbia, National Capital Region.",
            "items": {
              "type": "string"
            }
          },
          "publishedWithinDays": {
            "title": "Published within last N days",
            "minimum": 1,
            "type": "integer",
            "description": "Keep only notices published in the last N days."
          },
          "onlyOpen": {
            "title": "Only open (closing date not passed)",
            "type": "boolean",
            "description": "Keep only notices whose closing date is today or later. Most useful with 'All tender notices this fiscal year'.",
            "default": false
          },
          "language": {
            "title": "Language",
            "enum": [
              "eng",
              "fra"
            ],
            "type": "string",
            "description": "Output titles and descriptions in English or French.",
            "default": "eng"
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since last run (alerts mode)",
            "type": "boolean",
            "description": "Remember delivered notices and output only new ones on the next run. Ideal for a daily schedule feeding email, Slack, Sheets or a CRM.",
            "default": false
          },
          "stateKey": {
            "title": "Alerts state name",
            "type": "string",
            "description": "Use a different name for each saved search that runs in alerts mode.",
            "default": "default"
          },
          "maxItems": {
            "title": "Max notices",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many notices (newest first). You only pay for notices delivered.",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed: these are official open data files.",
            "default": {
              "useApifyProxy": false
            }
          },
          "selfCheck": {
            "title": "Self-check mode (maintenance)",
            "type": "boolean",
            "description": "For the maintainer. Downloads the files, checks their columns and content have not changed and writes a SELF_CHECK report. Outputs no notices.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}