{
  "openapi": "3.0.1",
  "info": {
    "title": "Product Recall to Catalog Matcher (CPSC, unofficial)",
    "description": "Match a merchant catalog to official U.S. CPSC recall records. Exact UPCs and published model numbers are confirmed first. Brand and model similarities are only proposed for human review. No candidate found is not a safety clearance.",
    "version": "0.1",
    "x-build-id": "isHbxU4JiJTgYnw5h"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plusonets~cpsc-recall-catalog-matcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plusonets-cpsc-recall-catalog-matcher",
        "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/plusonets~cpsc-recall-catalog-matcher/runs": {
      "post": {
        "operationId": "runs-sync-plusonets-cpsc-recall-catalog-matcher",
        "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/plusonets~cpsc-recall-catalog-matcher/run-sync": {
      "post": {
        "operationId": "run-sync-plusonets-cpsc-recall-catalog-matcher",
        "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": {
          "catalogSource": {
            "title": "Catalog source",
            "enum": [
              "sample",
              "inline",
              "url",
              "shopify"
            ],
            "type": "string",
            "description": "The built-in sample copies brand, model, and UPC values from recent public CPSC recalls so a demo run returns a review queue.",
            "default": "sample"
          },
          "catalogText": {
            "title": "Catalog CSV or JSON",
            "type": "string",
            "description": "Used when the source is inline. Include a header row or a JSON array. Recognized columns: brand, model, upc, sku, title, batch, lot, manufactureDate."
          },
          "catalogUrl": {
            "title": "Catalog URL",
            "type": "string",
            "description": "Public http(s) URL of a CSV or JSON catalog. Private hosts, localhost, and link-local addresses are rejected."
          },
          "shopifyStoreUrl": {
            "title": "Shopify store URL",
            "type": "string",
            "description": "Public storefront origin, for example https://your-store.myshopify.com. Only /products.json is read. Barcode becomes UPC and vendor becomes brand. Model numbers are not in the public feed."
          },
          "dateStart": {
            "title": "Recall date start",
            "type": "string",
            "description": "YYYY-MM-DD inclusive. Leave empty to use the saved watermark or the lookback window. An explicit date uses the CPSC recall date, not the last-publish date."
          },
          "dateEnd": {
            "title": "Recall date end",
            "type": "string",
            "description": "YYYY-MM-DD inclusive. Leave empty for today."
          },
          "lookbackDays": {
            "title": "Lookback days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Used on the first run when no dates and no saved watermark are available.",
            "default": 120
          },
          "sinceLastRun": {
            "title": "Continue from the last successful run",
            "type": "boolean",
            "description": "When no explicit dates are set, request CPSC recalls published or updated since the last successful watermark, with a three-day overlap. A failed run does not move the watermark.",
            "default": true
          },
          "includeHealthCanada": {
            "title": "Include Health Canada consumer-product recalls",
            "type": "boolean",
            "description": "Also read the Health Canada Recalls and Safety Alerts open-data JSON and keep consumer-product rows. Medical, food, vehicle, and cannabis rows are skipped. Unofficial.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store for the watermark and delivered match receipts. Use one store per Apify account. Isolate merchants with the state key.",
            "default": "cpsc-recall-catalog-matcher-state"
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Isolates watermarks when you monitor more than one catalog. Use a different key per merchant.",
            "default": "default"
          },
          "alertOnlyOnChange": {
            "title": "Output only new or changed matches",
            "type": "boolean",
            "description": "Every catalog item is still checked. The dataset keeps new, updated, and resolved rows and omits unchanged ones.",
            "default": false
          },
          "fuzzyThreshold": {
            "title": "Fuzzy prefix threshold",
            "minimum": 50,
            "maximum": 100,
            "type": "integer",
            "description": "0-100. A catalog model that is only a prefix of a published model is a candidate when the shorter code covers at least this percent of the published code. Exact UPCs and exact models ignore this threshold.",
            "default": 80
          },
          "maxCatalogItems": {
            "title": "Max catalog items",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Items above this cap are not checked. The run is marked partial and the watermark is not moved.",
            "default": 5000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}