{
  "openapi": "3.0.1",
  "info": {
    "title": "Product Recall Checker: Catalogue vs CPSC & EU Safety Gate",
    "description": "Check your product catalogue for recalls against US CPSC and EU Safety Gate in one run. Matches by barcode, brand and model, with the evidence for each and clear \"no recall found\" rows. Schedule it to get only new recalls.",
    "version": "0.1",
    "x-build-id": "Qx86TZNTTkxCfSVQA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/subtleasianmerch~product-recall-matcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-subtleasianmerch-product-recall-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/subtleasianmerch~product-recall-matcher/runs": {
      "post": {
        "operationId": "runs-sync-subtleasianmerch-product-recall-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/subtleasianmerch~product-recall-matcher/run-sync": {
      "post": {
        "operationId": "run-sync-subtleasianmerch-product-recall-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": {
          "items": {
            "title": "Catalogue items (JSON)",
            "type": "array",
            "description": "Your products as a JSON array. Each can have gtin (or upc, ean, barcode), brand, model (or mpn), sku, name (or title), category, country (US, EU or both) and id. The more you give, the better: a barcode or a brand with a model number gives likely matches; a brand with a name gives possible matches only."
          },
          "catalogueUrl": {
            "title": "Catalogue file link (CSV or JSON)",
            "type": "string",
            "description": "A link to a CSV or JSON file of your products, e.g. a shop export or a Google Sheet published to the web as CSV. Column names like EAN, UPC, Barcode, Brand, Manufacturer, Model, MPN, SKU, Title and Country are recognised. Up to 50 MB."
          },
          "datasetId": {
            "title": "Apify dataset with your products",
            "type": "string",
            "description": "The ID or name of an Apify dataset whose items are your products, e.g. the output of a shop scraper or of Google Sheets Sync's import."
          },
          "fieldMapping": {
            "title": "Column names (optional)",
            "type": "object",
            "description": "Only if your columns have unusual names: which column holds which field, e.g. {\"gtin\": \"Code EAN\", \"brand\": \"Marque\", \"model\": \"Ref fabricant\", \"name\": \"Libellé\"}. Fields: id, gtin, brand, model, mpn, sku, name, category, country."
          },
          "defaultCountry": {
            "title": "Where you sell (for rows without a country)",
            "enum": [
              "both",
              "US",
              "EU"
            ],
            "type": "string",
            "description": "Which recalls to check for items whose row doesn't say: US (CPSC), EU (Safety Gate) or both. A row's own country (US, EU, an EU or EEA country, or both) wins.",
            "default": "both"
          },
          "recallYears": {
            "title": "Recalls from the last N years",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How far back to look. CPSC is read in one request whatever the window; Safety Gate is read one weekly report at a time, so a first run with a long window takes longer (about 1 minute per year), and later runs reuse the saved reports.",
            "default": 3
          },
          "includePossibleMatches": {
            "title": "Include possible matches (brand and name only)",
            "type": "boolean",
            "description": "On: an item whose brand and most of its name appear in a recall gets it as a \"possible\" match, never called a confirmed recall. Off: only likely matches (barcode, or brand and model number).",
            "default": true
          },
          "maxMatchesPerItem": {
            "title": "Most matches per item",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Likely matches come first, then at most 5 possible ones, closest name first. The row says how many more there were.",
            "default": 10
          },
          "maxItems": {
            "title": "Most catalogue rows to read",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Leave empty for up to 50,000 rows a run. Each item checked against all its sources is charged once."
          },
          "monitorId": {
            "title": "Monitor ID (for scheduled runs)",
            "type": "string",
            "description": "Any name, e.g. \"my-shop\". Runs with the same ID remember the recalls already reported for each item, so a schedule delivers only new items and items with new recall matches."
          },
          "onlyChanges": {
            "title": "Output only new items and new matches",
            "type": "boolean",
            "description": "With a monitor ID: on, items with no new recall match since the last run are left out, free; an item with new matches lists only those. Off, every item is output and charged, with new matches marked.",
            "default": true
          },
          "useCache": {
            "title": "Reuse saved Safety Gate weekly reports",
            "type": "boolean",
            "description": "On: weekly reports already read are kept in a key-value store named product-recall-matcher-cache in your account, so later runs read only new reports. Reports from the last 4 weeks are always read again.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}