{
  "openapi": "3.0.1",
  "info": {
    "title": "EU Product Recall Compliance Matcher (Safety Gate)",
    "description": "Audit products by brand, model, EAN or CAS/EC number against official EU Safety Gate recall alerts, or stream the latest alerts with delta tracking. Returns alert details, match type and confidence. SVHC matching needs your own ECHA export.",
    "version": "0.0",
    "x-build-id": "sZq88sjgt5KhUPtUR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/goobertje~eu-product-recall-compliance-matcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-goobertje-eu-product-recall-compliance-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/goobertje~eu-product-recall-compliance-matcher/runs": {
      "post": {
        "operationId": "runs-sync-goobertje-eu-product-recall-compliance-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/goobertje~eu-product-recall-compliance-matcher/run-sync": {
      "post": {
        "operationId": "run-sync-goobertje-eu-product-recall-compliance-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "audit",
              "feed"
            ],
            "type": "string",
            "description": "audit: check each item in 'items' against Safety Gate alerts and return one result row per item. feed: return the newest Safety Gate alerts since a date (optionally only those not delivered before). Example: \"audit\".",
            "default": "audit"
          },
          "items": {
            "title": "Items to audit (audit mode)",
            "type": "array",
            "description": "List of objects, each with any of: brand, productName, category, modelNumber, ean (EAN/GTIN/UPC barcode), casNumber, ecNumber, substanceName and an optional reference that is echoed back. Barcode and model matches are exact; brand + product matches are fuzzy. An item needs at least a brand, a barcode or a model number of 4+ characters (or CAS/EC/substance together with svhcCandidateList). Example: [{\"brand\":\"Goki\",\"ean\":\"4013594548496\"}].",
            "default": []
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of input items audited per run (each audited item is one billed event, so this caps your cost). Items beyond the cap are ignored. Example: 100.",
            "default": 100
          },
          "lookbackMonths": {
            "title": "Alert history to search (months)",
            "minimum": 1,
            "maximum": 36,
            "type": "integer",
            "description": "How many calendar months of weekly Safety Gate reports to search, counted back from today. More months means more downloads (about 1 second and 190 KB per weekly report; 6 months is about 27 reports, 36 months is about 157 reports and takes roughly 5 minutes the first time). Reports are cached in a named store, so later runs only download new weeks. Example: 24.",
            "default": 6
          },
          "minConfidence": {
            "title": "Minimum confidence",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Only matches with at least this confidence (0 to 1) are returned. Rules: barcode exact = 1.0, model exact = 0.95 (brand also matches) or 0.80, brand + product keywords fuzzy = 0.50 to 0.70, brand only = 0.30. The default 0.5 hides brand-only hits. Example: 0.5.",
            "default": 0.5
          },
          "maxMatchesPerItem": {
            "title": "Max matches per item",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of Safety Gate alerts listed per audited item (best confidence first, then newest). The total number of matches is still reported in matchCount. Example: 10.",
            "default": 10
          },
          "svhcCandidateList": {
            "title": "Your ECHA Candidate List rows (optional)",
            "type": "array",
            "description": "This Actor ships no ECHA data. If you also want REACH SVHC checks, paste the Candidate List rows you exported from ECHA yourself as objects; the real ECHA headers \"Substance name\", \"EC / List no.\", \"CAS no.\", \"Reason for inclusion\", \"Date of inclusion\" work as-is, as do substanceName, casNumber, ecNumber. Multi-value cells such as \"a; b\" are split. A supplied list with no usable row fails the run. Items with casNumber, ecNumber or substanceName are then matched against these rows (CAS exact 1.0, EC exact 1.0, name exact 0.9). Example: [{\"substanceName\":\"Bisphenol A\",\"casNumber\":\"80-05-7\",\"ecNumber\":\"201-245-8\"}].",
            "default": []
          },
          "sinceDate": {
            "title": "Feed: since date",
            "type": "string",
            "description": "Feed mode only: return alerts from weekly reports published on or after this date (YYYY-MM-DD, UTC). Defaults to the last 30 days. Safety Gate publishes a weekly report every Friday, so an alert's date is its report's publication date. Example: \"2026-10-01\"."
          },
          "maxAlerts": {
            "title": "Feed: max alerts",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Feed mode only: maximum number of alerts returned, newest first (each returned alert is one billed event). Example: 50.",
            "default": 50
          },
          "deltaMode": {
            "title": "Feed: only alerts not delivered before",
            "type": "boolean",
            "description": "Feed mode only: remember delivered alert numbers in the named store below and return only alerts that were not delivered by an earlier delta run. The first run returns the newest alerts since the start date. Example: true.",
            "default": false
          },
          "deltaStoreName": {
            "title": "Feed: delta state store name",
            "type": "string",
            "description": "Name of the named Key-Value Store that remembers delivered alerts when delta mode is on (lowercase letters, digits and hyphens). Use a different name per feed you run. Example: \"my-toys-feed\".",
            "default": "eu-recall-feed-state"
          },
          "cacheStoreName": {
            "title": "Report cache store name",
            "type": "string",
            "description": "Name of the named Key-Value Store used to cache parsed weekly reports between runs, which makes repeat runs much faster. Leave empty to disable caching. Example: \"eu-recall-matcher-cache\".",
            "default": "eu-recall-matcher-cache"
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 1,
            "maximum": 30,
            "type": "number",
            "description": "Pause between requests to ec.europa.eu. Minimum and default 1 second; the Actor never goes faster. Example: 1.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}