{
  "openapi": "3.0.1",
  "info": {
    "title": "Health Canada Recalls & Safety Alerts Scraper",
    "description": "Scrape Health Canada's official Recalls and Safety Alerts database (recalls-rappels.canada.ca) - food, health product, consumer product and vehicle recalls. Search by keyword, filter by organization/category/recall class, or fetch full recall detail by ID or URL.",
    "version": "1.0",
    "x-build-id": "pdpdYgGPItPZTnFa4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~health-canada-recalls-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-health-canada-recalls-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/crawlerbros~health-canada-recalls-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-health-canada-recalls-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/crawlerbros~health-canada-recalls-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-health-canada-recalls-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byIds",
              "byUrls"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query (mode=search)",
            "type": "string",
            "description": "Free-text keyword search across the recall/safety-alert title, product, and issue. Leave blank to browse the latest recalls sorted by last-updated date.",
            "default": "food"
          },
          "organization": {
            "title": "Organization (mode=search)",
            "enum": [
              "",
              "TC",
              "CFIA",
              "HC",
              "Medical devices",
              "Drugs and health products",
              "Consumer product safety",
              "Marketed health products",
              "Controlled substances and cannabis",
              "Communications and Public Affairs Branch"
            ],
            "type": "string",
            "description": "Restrict results to recalls published by a specific issuing organization/branch.",
            "default": ""
          },
          "category": {
            "title": "Category (mode=search)",
            "enum": [
              "",
              "443",
              "1283",
              "1287",
              "1282",
              "1293",
              "1285",
              "1281",
              "1284",
              "1286",
              "1294",
              "1292",
              "1289",
              "1290",
              "1300",
              "1298",
              "1302",
              "1288",
              "1297",
              "1295",
              "1291",
              "1296",
              "1303",
              "1304",
              "1301",
              "1299",
              "1306",
              "1305",
              "1307",
              "3996",
              "180",
              "185",
              "181",
              "184",
              "182",
              "183",
              "101",
              "122",
              "109",
              "141",
              "136",
              "111",
              "115",
              "143",
              "137",
              "108",
              "103",
              "128",
              "102",
              "132",
              "127",
              "142",
              "119",
              "104",
              "131",
              "144",
              "148",
              "179",
              "162",
              "177",
              "172",
              "154",
              "176",
              "150",
              "145",
              "149",
              "166",
              "170",
              "171",
              "151",
              "178"
            ],
            "type": "string",
            "description": "Restrict results to a curated recall category/sub-category. Use `categoryFreeText` instead to target a category not listed here.",
            "default": ""
          },
          "categoryFreeText": {
            "title": "Category override (numeric ID, mode=search)",
            "type": "string",
            "description": "Advanced: exact numeric category ID from the site's own taxonomy (overrides `category` when set)."
          },
          "recallClass": {
            "title": "Recall class (mode=search)",
            "enum": [
              "",
              "Type I",
              "Type II",
              "Type III",
              "Class 1",
              "Class 2",
              "Class 3"
            ],
            "type": "string",
            "description": "Restrict results to a specific hazard/recall classification. Health-product recalls use Type I-III; food and consumer-product recalls use Class 1-3.",
            "default": ""
          },
          "archived": {
            "title": "Include archived recalls",
            "type": "boolean",
            "description": "Include recalls/alerts that have been archived (closed out) in addition to active ones.",
            "default": false
          },
          "dateFrom": {
            "title": "Last-updated from (mode=search)",
            "type": "string",
            "description": "Only include recalls last updated on or after this date (YYYY-MM-DD)."
          },
          "dateTo": {
            "title": "Last-updated to (mode=search)",
            "type": "string",
            "description": "Only include recalls last updated on or before this date (YYYY-MM-DD)."
          },
          "language": {
            "title": "Language",
            "enum": [
              "en",
              "fr"
            ],
            "type": "string",
            "description": "Official-language edition of recalls-rappels.canada.ca to fetch. Applies to `search` (which index to browse/search) and `byIds` (which URL to build for each ID). `byUrls` always uses whichever language the given URL itself points to.",
            "default": "en"
          },
          "sortBy": {
            "title": "Sort order (mode=search)",
            "enum": [
              "latest",
              "oldest"
            ],
            "type": "string",
            "description": "Order in which matching recalls are walked and emitted.",
            "default": "latest"
          },
          "ids": {
            "title": "Recall IDs / NIDs (mode=byIds)",
            "type": "array",
            "description": "Numeric Health Canada recall node IDs, e.g. `82414` (found in every recall URL / `/node/{id}` redirect).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "Recall URLs (mode=byUrls)",
            "type": "array",
            "description": "Direct recalls-rappels.canada.ca recall URLs, e.g. `https://recalls-rappels.canada.ca/en/alert-recall/...`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}