{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Product Safety Recall Radar - Marketplace + Spike Detector",
    "description": "Tracks official OPSS/GOV.UK product safety recalls: flags which recalled items were sold via Amazon/eBay/Temu/AliExpress etc, and detects product categories currently spiking with serious-risk alerts. Keyless official API - no other Store Actor extracts marketplace or does spike detection.",
    "version": "0.1",
    "x-build-id": "GMF22sJaQFJh1JX15"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hllerdgn80~uk-product-safety-recall-radar/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hllerdgn80-uk-product-safety-recall-radar",
        "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/hllerdgn80~uk-product-safety-recall-radar/runs": {
      "post": {
        "operationId": "runs-sync-hllerdgn80-uk-product-safety-recall-radar",
        "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/hllerdgn80~uk-product-safety-recall-radar/run-sync": {
      "post": {
        "operationId": "run-sync-hllerdgn80-uk-product-safety-recall-radar",
        "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": {
          "riskLevels": {
            "title": "Risk levels to include",
            "type": "array",
            "description": "Which OPSS-assigned risk levels to pull. Matches the GOV.UK finder's own facet values exactly: \"serious\", \"high\", \"medium\", \"low\", \"not-provided\". Default keeps only the two levels worth acting on immediately.",
            "default": [
              "serious",
              "high"
            ],
            "items": {
              "type": "string"
            }
          },
          "productCategories": {
            "title": "Product categories to include (optional)",
            "type": "array",
            "description": "GOV.UK category slugs to filter to, e.g. \"childcare-articles-childrens-equipment\", \"electrical-products\", \"toys\". Leave empty for all categories. See the category filter on www.gov.uk/product-safety-alerts-reports-recalls for the exact slugs (visible in that page's own filter URL).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "alertTypes": {
            "title": "Alert types to include (optional)",
            "type": "array",
            "description": "Restrict to one or more of: \"product-safety-alert\" (regulator warning), \"product-safety-report\" (OPSS's own investigation writeup, most common for marketplace items), \"product-recall\" (formal recall notice). Leave empty for all three.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Keyword search (optional)",
            "type": "string",
            "description": "Free-text search against the GOV.UK index, same as typing into the search box on the product safety finder, e.g. \"e-bike battery\" or a specific brand name.",
            "default": ""
          },
          "maxResults": {
            "title": "Max alerts to fetch this run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper limit on how many matching alerts to pull back, newest first, in one run.",
            "default": 200
          },
          "rollingWindowDays": {
            "title": "Category-spike rolling window (days)",
            "minimum": 1,
            "maximum": 180,
            "type": "integer",
            "description": "How many days of newly-seen alerts (across this and previous runs) count toward a product category's rolling total - the basis for spike detection. A category with an unusually high count of serious/high-risk alerts inside this window is flagged 'category_spike': true on every row in that category, a derived signal no raw alert feed provides.",
            "default": 30
          },
          "spikeThreshold": {
            "title": "Spike threshold (alerts in the window)",
            "minimum": 2,
            "maximum": 100,
            "type": "integer",
            "description": "A category is marked as spiking once its rolling count (within the window above) reaches this many newly-seen alerts.",
            "default": 5
          },
          "onlyNewSinceLastRun": {
            "title": "Only return alerts new since last run",
            "type": "boolean",
            "description": "If enabled, skip alerts this Actor already returned in a previous run against the same Actor (same input/dataset lineage keeps its own key-value store). Leave off for a full snapshot on the first run.",
            "default": false
          },
          "onlyMarketplaceListings": {
            "title": "Only return online-marketplace-linked recalls",
            "type": "boolean",
            "description": "If enabled, only push alerts where this Actor detected an online marketplace name (Amazon, eBay, Temu, AliExpress, Wish, Shein, Etsy, TikTok Shop, Facebook Marketplace, Vinted, OnBuy, Fruugo, Not on the High Street, or another 'sold via/on/through X' mention) in the alert's own title or description.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}