{
  "openapi": "3.0.1",
  "info": {
    "title": "CanadaBuys Tender Notices Scraper (Canada)",
    "description": "Canadian federal tenders and contract awards from the official CanadaBuys open data feeds: buyer contact, UNSPSC, GSIN, closing date, supplier and value.",
    "version": "0.1",
    "x-build-id": "mFxTBUNiC1mFETagy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/knotty_mistveil~canadabuys-tender-notices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-knotty_mistveil-canadabuys-tender-notices",
        "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/knotty_mistveil~canadabuys-tender-notices/runs": {
      "post": {
        "operationId": "runs-sync-knotty_mistveil-canadabuys-tender-notices",
        "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/knotty_mistveil~canadabuys-tender-notices/run-sync": {
      "post": {
        "operationId": "run-sync-knotty_mistveil-canadabuys-tender-notices",
        "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": {
          "feed": {
            "title": "Feed",
            "enum": [
              "open",
              "new",
              "awards"
            ],
            "type": "string",
            "description": "Which CanadaBuys file to read. 'Open tenders' holds every notice still open for bidding (about 950 at any time). 'New tenders' is the last 24 hours only. 'Award notices' holds contract awards for the fiscal years your date window touches.",
            "default": "open"
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 1830,
            "type": "integer",
            "description": "Look-back window in days on the notice's publication date, ending now. Ignored when Date from / Date to are set. Left empty it means 7 days for the open and award feeds, and no date filter at all for the 24-hour 'New tenders' feed."
          },
          "dateFrom": {
            "title": "Date from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Earliest publication date to keep, YYYY-MM-DD (inclusive). Overrides Days back."
          },
          "dateTo": {
            "title": "Date to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Latest publication date to keep, YYYY-MM-DD (inclusive). Defaults to today."
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Case-insensitive terms matched against the notice title and description; a notice is kept when any term matches. Empty = no keyword filter.",
            "items": {
              "type": "string"
            }
          },
          "unspscPrefixes": {
            "title": "UNSPSC code prefixes",
            "type": "array",
            "description": "United Nations Standard Products and Services Codes or prefixes, 2 to 8 digits. 43 = IT and telecom equipment, 81 = engineering and research services, 72 = building and maintenance services, 42 = medical equipment, 25 = vehicles. A notice is kept when any of its UNSPSC codes starts with any prefix. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "gsinPrefixes": {
            "title": "GSIN code prefixes",
            "type": "array",
            "description": "Goods and Services Identification Numbers or prefixes, 1 to 10 letters/digits, for example N7030 (ADP software) or D3 (telecommunication services). Only a minority of notices carry a GSIN - see the README. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Procurement categories",
            "type": "array",
            "description": "Keep only these CanadaBuys procurement categories: goods (GD), services (SRV), construction (CNST) or services related to goods (SRVTGD). A notice can carry more than one. Empty = all categories.",
            "items": {
              "type": "string",
              "enum": [
                "goods",
                "services",
                "construction",
                "services-related-to-goods"
              ],
              "enumTitles": [
                "Goods (GD)",
                "Services (SRV)",
                "Construction (CNST)",
                "Services related to goods (SRVTGD)"
              ]
            }
          },
          "regions": {
            "title": "Regions of delivery",
            "type": "array",
            "description": "Case-insensitive substrings matched against the notice's regions of delivery, for example \"Ontario\", \"Quebec\", \"National Capital Region\", \"British Columbia\". A national contract is published as \"Canada\" and will NOT match a province name, and about one notice in seven names no region at all and is dropped when this filter is set. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "buyers": {
            "title": "Buyers",
            "type": "array",
            "description": "Case-insensitive substrings matched against the contracting entity name, for example \"National Defence\", \"Shared Services Canada\", \"Parks Canada\". Empty = all buyers.",
            "items": {
              "type": "string"
            }
          },
          "closingAfter": {
            "title": "Closing on or after",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Keep only tenders whose closing date is on or after this day, YYYY-MM-DD - use it to skip notices that are about to close. Tender feeds only; award notices have no closing date and the run fails fast if you set it with feed 'awards'."
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many notices. You are charged per notice delivered. Results are ordered newest publication date first, so a value below the number of matches drops the OLDEST notices in the window.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}