{
  "openapi": "3.0.1",
  "info": {
    "title": "Canada Opportunity Feed – Tenders, Permits, Leads",
    "description": "Only NEW Canadian opportunities since your last call: NS tender awards, large Halifax and Calgary permits, new federal corporations, Government of Canada recalls. One schema, 0–100 score with reason, top-N digest. Open-licensed, no personal data. $0.05/run + $0.01/item.",
    "version": "0.2",
    "x-build-id": "C41hOhmbOdvmpVuvO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/loudtzu~canada-opportunity-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-loudtzu-canada-opportunity-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/loudtzu~canada-opportunity-feed/runs": {
      "post": {
        "operationId": "runs-sync-loudtzu-canada-opportunity-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/loudtzu~canada-opportunity-feed/run-sync": {
      "post": {
        "operationId": "run-sync-loudtzu-canada-opportunity-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": {
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Which feeds to read. Any of: \"ns-tenders\" (Nova Scotia awarded tenders), \"halifax-permits\" and \"calgary-permits\" (large building permits), \"federal-corporations\" (new federal incorporations), \"recalls\" (Government of Canada recalls as market signals). Empty = all.",
            "default": [
              "ns-tenders",
              "federal-corporations",
              "recalls",
              "halifax-permits",
              "calgary-permits"
            ],
            "items": {
              "type": "string"
            }
          },
          "regions": {
            "title": "Regions",
            "type": "array",
            "description": "Keep only items in these 2-letter province/territory codes, e.g. [\"NS\"] or [\"NS\",\"NB\",\"PE\"]. \"CA\" = national items (recalls). Empty = all of Canada.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sectors": {
            "title": "Sectors",
            "type": "array",
            "description": "Keep only these sectors: construction, health, food, technology, energy, professional_services, transport, manufacturing, retail, real_estate, finance, other. Empty = all. Sector is assigned by fixed keyword rules (see README).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minValueCad": {
            "title": "Minimum value (CAD)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop tender awards and permits below this dollar value (and those with no value). Items that never have a value (new companies, recalls) are not affected. 0 = no minimum. Example: 100000.",
            "default": 0
          },
          "permitMinValueCad": {
            "title": "Permit floor (CAD)",
            "minimum": 0,
            "type": "integer",
            "description": "Building permits below this estimated project value are never fetched, so only large permits appear. Default 250000.",
            "default": 250000
          },
          "sinceDays": {
            "title": "Lookback days (first run)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "On the first run (empty state) return items dated in the last N days. Later runs cover the time since the previous run (+3 days overlap) and never less than N days. Items already returned are never repeated. 1-90, default 7.",
            "default": 7
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum new items to return (highest score first). Each is a billable 'result' event. Items over the cap stay unseen and come back next run. 1-50,000, default 100. Ignored when 'Fetch all' is on.",
            "default": 100
          },
          "fetchAll": {
            "title": "Fetch all (up to 50,000 items)",
            "type": "boolean",
            "description": "Opt in to return every new item, capped at 50,000 per run. Each item is a billable result ($0.01 each), so 50,000 costs about $500. Tip: set a maximum cost per run in Apify run options.",
            "default": false
          },
          "topN": {
            "title": "Digest size",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many top-scored items to list in the digest record. 1-50, default 10.",
            "default": 10
          },
          "digestOnly": {
            "title": "Digest only",
            "type": "boolean",
            "description": "true = return only the single digest record (one 'digest' event, no 'result' events) and do NOT mark anything as seen (a cheap peek). Default false.",
            "default": false
          },
          "markSeen": {
            "title": "Mark returned items as seen",
            "type": "boolean",
            "description": "true (default) = remember returned item IDs so the next run returns only newer items. false = do not change the state (repeatable test run).",
            "default": true
          },
          "stateStore": {
            "title": "State store name",
            "type": "string",
            "description": "Name of the key-value store that holds seen item IDs (key SEEN_IDS). Use a different name per agent or per use case to keep separate 'new since last run' cursors. Letters, digits, hyphens.",
            "default": "canada-opportunity-feed-state"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}