{
  "openapi": "3.0.1",
  "info": {
    "title": "EU Safety Gate & Recall API (GPSR, RAPEX & EAN Compliance)",
    "description": "Apify Actor for querying EU Product Safety Gate (RAPEX) recall alerts, automated EAN Check & GTIN barcode validation, GPSR compliance screening, and monitoring weekly safety notices with Pay-Per-Event (PPE) pricing.",
    "version": "1.0",
    "x-build-id": "2HoU79ZFVb6Je6mce"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thfc_labs~eu-product-safety-actor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thfc_labs-eu-product-safety-actor",
        "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/thfc_labs~eu-product-safety-actor/runs": {
      "post": {
        "operationId": "runs-sync-thfc_labs-eu-product-safety-actor",
        "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/thfc_labs~eu-product-safety-actor/run-sync": {
      "post": {
        "operationId": "run-sync-thfc_labs-eu-product-safety-actor",
        "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": {
          "ean": {
            "title": "EAN / Barcode",
            "type": "string",
            "description": "EAN-8, EAN-13, UPC or GTIN barcode to verify against EU Safety Gate recalls (e.g. '5054298241091')."
          },
          "eans": {
            "title": "Batch EANs / Barcodes",
            "type": "array",
            "description": "Array of EAN-8, EAN-13, UPC or GTIN barcodes for batch screening of e-commerce catalogs (e.g. ['5054298241091', '4099979071513']).",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "title": "Category / Kategorie",
            "type": "string",
            "description": "Product category to filter alerts (e.g. 'Toys', 'Cosmetics', 'Electrical appliances', 'Motor vehicles')."
          },
          "query": {
            "title": "Search Query / Suchbegriff",
            "type": "string",
            "description": "Free text search term to search across product names, brands, models, and danger descriptions (e.g. 'wooden puzzle')."
          },
          "week": {
            "title": "Week / Woche",
            "type": "string",
            "description": "Publication week filter (e.g. '2026-W45', '2026-45' or '45')."
          },
          "childProductsOnly": {
            "title": "Child & Baby Products Only",
            "type": "boolean",
            "description": "Filter strictly for toys, baby items, children's clothing and products intended for kids.",
            "default": false
          },
          "ageGroup": {
            "title": "Child Age Group",
            "enum": [
              "baby",
              "toddler",
              "child",
              "unknown"
            ],
            "type": "string",
            "description": "Filter by target age group: 'baby' (0-12m), 'toddler' (1-3y), 'child' (toys/general kids), 'unknown'."
          },
          "hazard": {
            "title": "Child Specific Hazard",
            "enum": [
              "choking",
              "chemical",
              "magnets"
            ],
            "type": "string",
            "description": "Filter by primary child hazard: 'choking' (small parts), 'chemical' (PFAS, phthalates), 'magnets' (flux index)."
          },
          "refreshData": {
            "title": "Live Data Refresh",
            "type": "boolean",
            "description": "If true, fetches the latest official Safety Gate XML alerts from the European Commission before querying.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum Items",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of alert items to return in the dataset (capped at 50 per run to prevent wholesale data dumping).",
            "default": 20
          },
          "asins": {
            "title": "Amazon ASINs",
            "maxItems": 1000,
            "type": "array",
            "description": "Array of Amazon Standard Identification Numbers (ASINs, e.g. ['B08N5WRWNW', 'B09V3HN1KC']) to screen against EU safety recalls. Maximum 1,000 ASINs per run.",
            "items": {
              "type": "string"
            }
          },
          "amazonUrls": {
            "title": "Amazon Product URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "List of Amazon product detail page URLs or shortlinks (e.g. ['https://www.amazon.de/dp/B08N5WRWNW', 'https://amzn.to/3example']) to extract identifiers from. Maximum 1,000 URLs per run.",
            "items": {
              "type": "string"
            }
          },
          "csvUrl": {
            "title": "Catalog CSV URL",
            "type": "string",
            "description": "Public HTTPS URL of a remote product catalog CSV for batch recall screening (e.g. 'https://example.com/catalogs/products_2026.csv'). HTTP is rejected."
          },
          "csvContent": {
            "title": "Raw CSV Content",
            "type": "string",
            "description": "Direct raw CSV file content containing product identifiers (EAN, GTIN, ASIN, SKU) for bulk screening. Maximum size: 5 MB."
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Target HTTPS endpoint for real-time safety recall notifications (e.g. 'https://api.example.com/webhooks/safety-alerts' or Slack/Discord incoming webhook URLs). Must use HTTPS."
          },
          "webhookFormat": {
            "title": "Webhook Payload Format",
            "enum": [
              "generic",
              "slack",
              "discord"
            ],
            "type": "string",
            "description": "Notification payload structure: 'generic' (standard pse.alert.v1 JSON), 'slack' (Slack Block Kit), or 'discord' (Discord Embeds). Default is 'generic'.",
            "default": "generic"
          },
          "webhookSecret": {
            "title": "Webhook HMAC Secret",
            "type": "string",
            "description": "Shared secret key used to compute HMAC-SHA256 signature in the X-Hub-Signature-256 header (e.g. 'whsec_5f8a9b2c3d4e...')."
          },
          "webhookOnlyOnMatch": {
            "title": "Webhook Only On Match",
            "type": "boolean",
            "description": "If true, sends webhook notifications only when product safety recall matches are found. If false, dispatches a summary for every run.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}