{
  "openapi": "3.0.1",
  "info": {
    "title": "Canada Contract Awards (CanadaBuys) & Supplier Analytics",
    "description": "Search Canadian federal government contract awards from official CanadaBuys open data by keyword, department, supplier, UNSPSC, region, province, procurement method, date and value. Clean records plus department/supplier spend rankings.",
    "version": "0.1",
    "x-build-id": "neiiFyo4rfX48EMnP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhucl1006~canadabuys-contract-awards/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhucl1006-canadabuys-contract-awards",
        "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/zhucl1006~canadabuys-contract-awards/runs": {
      "post": {
        "operationId": "runs-sync-zhucl1006-canadabuys-contract-awards",
        "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/zhucl1006~canadabuys-contract-awards/run-sync": {
      "post": {
        "operationId": "run-sync-zhucl1006-canadabuys-contract-awards",
        "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": {
          "publishedFrom": {
            "title": "Notices published from",
            "type": "string",
            "description": "Earliest notice publication date (YYYY-MM-DD). Default: 30 days ago. Earliest: 2012-01-01 (ranges before 2022-08-08 read the large historical file and take longer)."
          },
          "publishedTo": {
            "title": "Notices published to",
            "type": "string",
            "description": "Latest notice publication date (YYYY-MM-DD, inclusive). Default: today."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Words or phrases to find in the English/French title, description, solicitation or contract number (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "keywordMatch": {
            "title": "Keyword matching",
            "enum": [
              "any",
              "all"
            ],
            "type": "string",
            "description": "Match ANY keyword or ALL keywords.",
            "default": "any"
          },
          "buyers": {
            "title": "Departments / contracting entities",
            "type": "array",
            "description": "Partial, case-insensitive names, e.g. 'National Defence', 'PSPC', 'Parks Canada'.",
            "items": {
              "type": "string"
            }
          },
          "suppliers": {
            "title": "Suppliers",
            "type": "array",
            "description": "Partial, case-insensitive supplier legal names, e.g. 'IBM', 'Deloitte'.",
            "items": {
              "type": "string"
            }
          },
          "unspscCodes": {
            "title": "UNSPSC codes (prefix)",
            "type": "array",
            "description": "UNSPSC code prefixes, e.g. '43' (IT equipment), '81' (engineering/IT services), '72' (construction).",
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Regions of delivery",
            "type": "array",
            "description": "Partial region names, e.g. 'Ontario', 'National Capital Region', 'British Columbia'.",
            "items": {
              "type": "string"
            }
          },
          "supplierProvinces": {
            "title": "Supplier provinces",
            "type": "array",
            "description": "Province of the supplier's address, e.g. 'Quebec', 'Alberta'.",
            "items": {
              "type": "string"
            }
          },
          "procurementMethods": {
            "title": "Procurement methods",
            "type": "array",
            "description": "Partial match, e.g. 'Non-competitive', 'Open bidding', 'Selective', 'Advance contract award notice'.",
            "items": {
              "type": "string"
            }
          },
          "awardStatuses": {
            "title": "Award status",
            "type": "array",
            "description": "Keep only these statuses (empty = all).",
            "items": {
              "type": "string",
              "enum": [
                "active",
                "expired",
                "cancelled"
              ],
              "enumTitles": [
                "Active",
                "Expired",
                "Cancelled"
              ]
            }
          },
          "awardDateFrom": {
            "title": "Awarded on or after",
            "type": "string",
            "description": "Optional extra filter on the contract award date."
          },
          "awardDateTo": {
            "title": "Awarded on or before",
            "type": "string",
            "description": "Optional extra filter on the contract award date."
          },
          "minAmount": {
            "title": "Minimum value (CAD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards with a stated value at or above this."
          },
          "maxAmount": {
            "title": "Maximum value (CAD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only awards with a stated value at or below this."
          },
          "latestVersionOnly": {
            "title": "Latest version of each contract only",
            "type": "boolean",
            "description": "Amended contracts appear once, with the latest amendment and total contract value to date. Turn off to get every original and amendment notice as a separate row.",
            "default": true
          },
          "maxItems": {
            "title": "Maximum award records",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of award records to output (0 = no limit). Summary rows are not counted.",
            "default": 1000
          },
          "sortBy": {
            "title": "Sort award records by",
            "enum": [
              "awardDateDesc",
              "awardDateAsc",
              "publishedDesc",
              "amountDesc",
              "amountAsc"
            ],
            "type": "string",
            "description": "Order of award records in the output.",
            "default": "awardDateDesc"
          },
          "outputMode": {
            "title": "Output",
            "enum": [
              "records",
              "summary",
              "both"
            ],
            "type": "string",
            "description": "Award records, an aggregated spend ranking, or both.",
            "default": "records"
          },
          "summaryBy": {
            "title": "Summarise by",
            "enum": [
              "supplier",
              "buyer",
              "buyerSupplier",
              "fiscalYear",
              "buyerFiscalYear",
              "supplierFiscalYear",
              "unspscSegment",
              "region",
              "procurementMethod",
              "supplierProvince"
            ],
            "type": "string",
            "description": "Grouping for the spend summary: total CAD, award count, average/median/max, share of total, first/last award date and top counterparties. Non-CAD awards are counted but not added to CAD totals.",
            "default": "supplier"
          },
          "summaryTopN": {
            "title": "Summary rows (top N)",
            "minimum": 0,
            "type": "integer",
            "description": "How many summary rows to output, ranked by total value (0 = all).",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}