# CPSC Supplier Recall Exposure Monitor (`blaidlink/cpsc-supplier-recall-monitor`) Actor

Match official CPSC recalls to your supplier, brand, product, category, and keyword exposure scope, then track lifecycle changes.

- **URL**: https://apify.com/blaidlink/cpsc-supplier-recall-monitor.md
- **Developed by:** [Blaidlink Labs](https://apify.com/blaidlink) (community)
- **Categories:** Automation, Developer tools, E-commerce
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 new recall exposures

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## CPSC Supplier Recall Exposure Monitor

Match recently published or updated records from the official CPSC Recall Retrieval API to a private supplier, brand, product, category, or risk-keyword scope. The Actor turns a public recall feed into a recurring supply-chain exposure workflow with deterministic reasons and lifecycle changes.

> **Unofficial tool:** This independent Blaidlink Actor is not affiliated with, sponsored by, or endorsed by the U.S. Consumer Product Safety Commission or the U.S. government. CPSC is the authoritative source. Verify consequential inventory, legal, safety, and reporting decisions against the official recall record and qualified professionals.

### What it does

- fetches a mandatory 1–31 day `LastPublishDateStart` window from the official keyless JSON API;
- fails closed if the API returns more than the configured bounded source ceiling;
- matches public recall fields against supplier/seller, brand, product, category, and keyword filters;
- supports `any` or `all` logic across populated filter groups;
- explains every exposure with the exact query group and public field that matched;
- stores only a hashed monitoring-scope key and public recall snapshots;
- establishes the first run as an unpriced baseline;
- labels later records `new`, `material-change`, `unchanged`, or `scope-resolved`;
- never treats absence from a rolling window as resolution.

The Actor intentionally omits CPSC's `ConsumerContact` field, product images, UPCs, and caller identity from output and persisted state. It does not collect private consumer reports.

### Quick start

```json
{
  "monitorId": "lighting-supply-chain",
  "supplierNames": ["Currey & Company"],
  "productTerms": ["chandelier"],
  "keywords": ["electrocution", "fire"],
  "filterMode": "any",
  "lookbackDays": 14,
  "maxSourceRecords": 500,
  "maxEvents": 50
}
````

Save the configuration as an Apify Task and schedule it daily or weekly. Keep the schedule interval shorter than `lookbackDays`. The first successful run creates the baseline; later runs surface new or changed exposure.

### Filter behavior

| Input | Public fields checked |
|---|---|
| `supplierNames` | manufacturer, importer, distributor, retailer |
| `brandNames` | title, description, product name/description/model/type |
| `productTerms` | product name, description, model, type |
| `categoryIds` | product `CategoryID` |
| `keywords` | title, description, product, hazard, remedy |

Matching is case-insensitive, accent-insensitive substring matching. With `filterMode: "all"`, every populated group must match; terms within a group are alternatives. Output reasons are ordered supplier → brand → product → category → keyword, then normalized query order.

### Lifecycle semantics

- `baseline`: matching public record seen on the first successful run; not a proposed billable event.
- `new`: a matching recall ID not present in an initialized scope.
- `material-change`: a matched recall's title, description, product, company, retailer, hazard, remedy, or injury fields changed.
- `unchanged`: same material snapshot; emitted only when requested.
- `scope-resolved`: a republished record was retrieved but no longer matches the configured scope. This **does not** mean the official recall ended or the hazard was remedied.

CPSC notes that remedy information can change. `LastPublishDateStart` allows updated official records to re-enter the bounded window. A recall simply aging outside that window remains active in state and is not falsely resolved.

### Live pricing

The public Apify Store listing uses pay-per-event pricing:

- `new-recall-exposure`: **$0.05** per delivered new exposure;
- `material-recall-change`: **$0.03** per delivered material update;
- baseline, unchanged, scope-resolved, and summary: **$0.00** Blaidlink lifecycle-event fee;
- Apify platform usage is currently absorbed by the creator rather than billed separately to the customer.

Apify also applies its small synthetic Actor-start and default-dataset-item events. The Store pricing panel is the authoritative checkout display.

The runtime only invokes named charging events if the platform reports an active pay-per-event configuration. Otherwise all local and unpriced builds use ordinary dataset writes. State advances only after all lifecycle candidates are delivered, preventing a charge/output cap from silently consuming unseen events.

### Official source and limits

- [CPSC Recall API information](https://www.cpsc.gov/Recalls/CPSC-Recalls-Application-Program-Interface-API-Information)
- [CPSC Recall Retrieval Web Services Programmer's Guide](https://www.cpsc.gov/s3fs-public/RecallRetrievalWebServicesProgrammersGuide20180917.pdf)
- [Official recalls](https://www.cpsc.gov/Recalls)

The official API performs wildcard searches and warns that misspelled parameters may return the full historical corpus. This Actor uses only documented `LastPublishDateStart` and `format=json` parameters and enforces a response ceiling. CPSC data may be corrected or republished. A match is an exposure-review lead, not proof of a supplier relationship, legal duty, product ownership, harm, liability, or required action.

### Development

```bash
npm install
npm test
npm run validate:live
```

The live validation script makes one bounded official query and applies three local scopes to that shared response. It does not deploy, publish, create an account, or configure pricing.

# Actor input Schema

## `monitorId` (type: `string`):

Stable private label for this monitoring scope. It is hashed before use as a state key.

## `supplierNames` (type: `array`):

Names matched against public manufacturer, importer, distributor, and retailer fields.

## `brandNames` (type: `array`):

Brand terms matched against recall titles, descriptions, and product fields.

## `productTerms` (type: `array`):

Terms matched against product name, description, model, and type.

## `categoryIds` (type: `array`):

Exact public CategoryID values when present in the official response.

## `keywords` (type: `array`):

Terms matched across title, description, product, hazard, and remedy text.

## `filterMode` (type: `string`):

ANY accepts a match in any populated group. ALL requires a match in every populated group.

## `lookbackDays` (type: `integer`):

Days of recently published or updated CPSC records to inspect. Use a schedule shorter than this window.

## `maxSourceRecords` (type: `integer`):

Fail closed before processing if the official API unexpectedly returns more records.

## `maxEvents` (type: `integer`):

Maximum baseline or lifecycle records emitted per run.

## `emitUnchanged` (type: `boolean`):

Include repeated unchanged matches. These records are not proposed billable events.

## `emitResolved` (type: `boolean`):

Emit when a republished record that previously matched no longer matches this scope. This does not mean the official recall ended.

## `resetState` (type: `boolean`):

Forget the saved lifecycle for this exact monitor and filter scope before the run.

## Actor input object example

```json
{
  "monitorId": "primary",
  "supplierNames": [],
  "brandNames": [],
  "productTerms": [],
  "categoryIds": [],
  "keywords": [],
  "filterMode": "any",
  "lookbackDays": 14,
  "maxSourceRecords": 500,
  "maxEvents": 50,
  "emitUnchanged": false,
  "emitResolved": true,
  "resetState": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("blaidlink/cpsc-supplier-recall-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("blaidlink/cpsc-supplier-recall-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call blaidlink/cpsc-supplier-recall-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=blaidlink/cpsc-supplier-recall-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CPSC Supplier Recall Exposure Monitor",
        "description": "Match official CPSC recalls to your supplier, brand, product, category, and keyword exposure scope, then track lifecycle changes.",
        "version": "0.1",
        "x-build-id": "HzMTWzHubZGFawvde"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/blaidlink~cpsc-supplier-recall-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-blaidlink-cpsc-supplier-recall-monitor",
                "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/blaidlink~cpsc-supplier-recall-monitor/runs": {
            "post": {
                "operationId": "runs-sync-blaidlink-cpsc-supplier-recall-monitor",
                "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/blaidlink~cpsc-supplier-recall-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-blaidlink-cpsc-supplier-recall-monitor",
                "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": {
                    "monitorId": {
                        "title": "Monitor ID",
                        "type": "string",
                        "description": "Stable private label for this monitoring scope. It is hashed before use as a state key.",
                        "default": "primary"
                    },
                    "supplierNames": {
                        "title": "Suppliers and sellers",
                        "type": "array",
                        "description": "Names matched against public manufacturer, importer, distributor, and retailer fields.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "brandNames": {
                        "title": "Brands",
                        "type": "array",
                        "description": "Brand terms matched against recall titles, descriptions, and product fields.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "productTerms": {
                        "title": "Product terms",
                        "type": "array",
                        "description": "Terms matched against product name, description, model, and type.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "categoryIds": {
                        "title": "CPSC category IDs",
                        "type": "array",
                        "description": "Exact public CategoryID values when present in the official response.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "keywords": {
                        "title": "Risk keywords",
                        "type": "array",
                        "description": "Terms matched across title, description, product, hazard, and remedy text.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "filterMode": {
                        "title": "Filter-group logic",
                        "enum": [
                            "any",
                            "all"
                        ],
                        "type": "string",
                        "description": "ANY accepts a match in any populated group. ALL requires a match in every populated group.",
                        "default": "any"
                    },
                    "lookbackDays": {
                        "title": "Republish lookback",
                        "minimum": 1,
                        "maximum": 31,
                        "type": "integer",
                        "description": "Days of recently published or updated CPSC records to inspect. Use a schedule shorter than this window.",
                        "default": 14
                    },
                    "maxSourceRecords": {
                        "title": "Source safety ceiling",
                        "minimum": 25,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Fail closed before processing if the official API unexpectedly returns more records.",
                        "default": 500
                    },
                    "maxEvents": {
                        "title": "Maximum exposure records",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum baseline or lifecycle records emitted per run.",
                        "default": 50
                    },
                    "emitUnchanged": {
                        "title": "Emit unchanged matches",
                        "type": "boolean",
                        "description": "Include repeated unchanged matches. These records are not proposed billable events.",
                        "default": false
                    },
                    "emitResolved": {
                        "title": "Emit scope resolutions",
                        "type": "boolean",
                        "description": "Emit when a republished record that previously matched no longer matches this scope. This does not mean the official recall ended.",
                        "default": true
                    },
                    "resetState": {
                        "title": "Reset this baseline",
                        "type": "boolean",
                        "description": "Forget the saved lifecycle for this exact monitor and filter scope before the run.",
                        "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
                                    }
                                }
                            },
                            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
