# Product Safety Market Action Portfolio Report (`taroyamada/product-safety-market-action-portfolio-report`) Actor

Official CPSC and NHTSA public-record change signals with baseline-safe PAY\_PER\_EVENT delivery.

- **URL**: https://apify.com/taroyamada/product-safety-market-action-portfolio-report.md
- **Developed by:** [naoki anzai](https://apify.com/taroyamada) (community)
- **Categories:** Business
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 safety record rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Product Safety Market Action Portfolio Report

**Buyer:** product safety, quality, legal, and operations teams that need a small, source-linked queue of new or changed public safety records across a product or vehicle portfolio. **Input:** CPSC and NHTSA watchlists plus an isolated `monitorKey`. **Output:** a report-first portfolio row, optional raw safety records, market-action alerts, and an optional export row.

This actor uses only the official public CPSC Recalls REST API and official public NHTSA Recalls and Complaints APIs. It does not use search engines, retailer pages, manufacturer pages, social media, private feeds, or third-party safety databases.

### Run the next report

- Inspect CPSC recall evidence with [CPSC Product Recall Marketplace Watch Scraper](https://apify.com/taroyamada/cpsc-product-recall-marketplace-watch-scraper).
- Inspect NHTSA recall and complaint evidence with [NHTSA Recall Complaint Watch Scraper](https://apify.com/taroyamada/nhtsa-recall-complaint-watch-scraper).

### Input

```json
{
  "watchlists": [
    {
      "id": "children-products",
      "name": "Children product safety watch",
      "agency": "CPSC",
      "productNames": ["toy"],
      "keywords": ["choking", "burn"],
      "lookbackDays": 30
    },
    {
      "id": "vehicle-watch",
      "name": "Honda Accord watch",
      "agency": "NHTSA",
      "make": "Honda",
      "model": "Accord",
      "modelYear": 2020,
      "recordTypes": ["recall", "complaint"]
    }
  ],
  "monitorKey": "buyer-portfolio-1",
  "initialRunMode": "baseline_only",
  "generateReport": true,
  "emitRawRows": true,
  "emitUnchanged": false,
  "maxChargeUsd": 25,
  "dryRun": false
}
````

The eight control fields shown above are required. CPSC watchlists need a product, brand, category, keyword, or recall selector. NHTSA watchlists need a make/model/model year, campaign number, or ODI number. NHTSA vehicle watchlists query recalls and complaints by default; set `recordTypes` or `includeComplaints` to narrow them.

`monitorKey` is the state namespace. Keep it stable for a scheduled monitor and change it for an independent baseline. `initialRunMode` accepts `baseline_only`, `emit_current_window`, or `emit_backfill`. `emitExport` is optional and adds the $5 export event when a change exists. Network timeout, retry, rate-limit, webhook, and idempotency controls are optional.

### Output

Rows use `rowType` values `product_safety_portfolio_report`, `safety_record`, `market_action_alert`, and `product_safety_export`. Every billable row carries a deterministic `stableKey`, `idempotencyKey`, official source URLs, `limitations`, and `prohibitedInterpretations`.

The report row is emitted first. A safety record row includes normalized CPSC or NHTSA fields only when `emitRawRows` is enabled. An alert row is created for each new or changed matched record. NHTSA complaints are labeled `signalOnly`; they are not treated as proof of a defect. The output also contains `deliveryAudit` with planned and captured event prices, charge counts, idempotency keys, budget, delivery status, and state-commit status.

### Run patterns

#### 1. Establish a free baseline

Run the same watchlists with `initialRunMode: "baseline_only"` and `dryRun: false`. The actor fetches official data, saves the fingerprint snapshot, and emits zero rows and zero charges.

#### 2. Monitor the current window

Use `initialRunMode: "emit_current_window"` on a first run only when first-window records should be delivered. Later runs compare the official record fingerprints. New or changed records produce the configured report, alerts, and optional raw/export rows. A fully unchanged run always emits zero rows and zero charges, including when `emitUnchanged` is true.

#### 3. Review a historical backfill

Use `initialRunMode: "emit_backfill"` for an explicit first-run delivery of all records returned by the official APIs. Set a buyer-approved `maxChargeUsd`; the full unique event plan is checked before any push.

### Pricing

This actor uses PAY\_PER\_EVENT pricing and has no start or heartbeat charge.

| Event | Price | When emitted |
| --- | ---: | --- |
| `safety-record-row` | $0.006 | Each changed (or included unchanged-with-change) raw record when `emitRawRows` is true |
| `market-action-alert` | $0.20 | Each new or changed matched record |
| `product-safety-portfolio-report` | $8.00 | One changed portfolio report when `generateReport` is true |
| `product-safety-export` | $5.00 | One optional changed export when `emitExport` is true |

Baseline-only and unchanged runs are zero-row and zero-charge. Dry runs do not call the official APIs, write state, or push billable events.

### Source and safety limits

Source URLs are restricted in code to `saferproducts.gov`/`cpsc.gov` and `api.nhtsa.gov`/`nhtsa.gov`. A source error for any watchlist makes the entire run non-billable and prevents state advancement. State load and save fail closed; a failed save cannot be reported as a successful run. Unknown billing events, missing `chargedCount`, PPE charge-limit responses, and budget overruns stop delivery.

Public recalls and complaints are evidence for review, not a safety rating, legal conclusion, defect finding, compliance certification, or proof of injury causation. Use the source-linked official record for the final decision.

### Files

- [Input schema](INPUT_SCHEMA.json)
- [Dataset schema](dataset_schema.json)
- [Source compliance](docs/source-compliance.md)
- [Integration guide](docs/integration-guide.md)
- [Competitive snapshot](docs/store-competitive-snapshot.md)
- [Sample output](docs/sample-output.json)

# Actor input Schema

## `watchlists` (type: `array`):

CPSC product/brand/keyword selectors or NHTSA vehicle, campaign, and complaint selectors.

## `monitorKey` (type: `string`):

Stable state namespace for one buyer portfolio. Change it to start an independent monitor.

## `initialRunMode` (type: `string`):

baseline\_only stores the official snapshot with zero rows; the other modes can emit first-run changes.

## `generateReport` (type: `boolean`):

Generate portfolio report for this run.

## `emitRawRows` (type: `boolean`):

Adds safety-record-row events for changed records.

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

Only applies when another record changed; a fully unchanged run remains empty and free.

## `emitExport` (type: `boolean`):

Generate export row for this run.

## `maxChargeUsd` (type: `number`):

All unique planned events must fit before the first push.

## `dryRun` (type: `boolean`):

Uses an illustrative official-source-shaped sample without network, state, or charges.

## `requestTimeoutSeconds` (type: `integer`):

Request timeout seconds for this run.

## `rateLimitMs` (type: `integer`):

Minimum request interval ms for this run.

## `maxRetries` (type: `integer`):

Maximum retries for this run.

## `backoffBaseMs` (type: `integer`):

Backoff base ms for this run.

## `maxBackoffMs` (type: `integer`):

Maximum backoff ms for this run.

## `delivery` (type: `string`):

Delivery mode for this run.

## `webhookUrl` (type: `string`):

Optional HTTPS copy after dataset event delivery.

## Actor input object example

```json
{
  "watchlists": [
    {
      "id": "sample-cpsc",
      "name": "Sample CPSC watch",
      "agency": "CPSC",
      "productNames": [
        "battery"
      ],
      "keywords": [
        "recall"
      ],
      "lookbackDays": 30
    }
  ],
  "monitorKey": "sample-product-safety",
  "initialRunMode": "baseline_only",
  "generateReport": true,
  "emitRawRows": false,
  "emitUnchanged": false,
  "emitExport": false,
  "maxChargeUsd": 25,
  "dryRun": true,
  "requestTimeoutSeconds": 30,
  "rateLimitMs": 250,
  "maxRetries": 2,
  "backoffBaseMs": 250,
  "maxBackoffMs": 4000,
  "delivery": "dataset"
}
```

# 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("taroyamada/product-safety-market-action-portfolio-report").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("taroyamada/product-safety-market-action-portfolio-report").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 taroyamada/product-safety-market-action-portfolio-report --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=taroyamada/product-safety-market-action-portfolio-report",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Product Safety Market Action Portfolio Report",
        "description": "Official CPSC and NHTSA public-record change signals with baseline-safe PAY_PER_EVENT delivery.",
        "version": "0.1",
        "x-build-id": "JeDRhclPpv7vuPnYs"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/taroyamada~product-safety-market-action-portfolio-report/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-taroyamada-product-safety-market-action-portfolio-report",
                "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/taroyamada~product-safety-market-action-portfolio-report/runs": {
            "post": {
                "operationId": "runs-sync-taroyamada-product-safety-market-action-portfolio-report",
                "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/taroyamada~product-safety-market-action-portfolio-report/run-sync": {
            "post": {
                "operationId": "run-sync-taroyamada-product-safety-market-action-portfolio-report",
                "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",
                "required": [
                    "watchlists",
                    "monitorKey",
                    "initialRunMode",
                    "generateReport",
                    "emitRawRows",
                    "emitUnchanged",
                    "maxChargeUsd",
                    "dryRun"
                ],
                "properties": {
                    "watchlists": {
                        "title": "Safety watchlists",
                        "minItems": 1,
                        "maxItems": 100,
                        "type": "array",
                        "description": "CPSC product/brand/keyword selectors or NHTSA vehicle, campaign, and complaint selectors.",
                        "default": [
                            {
                                "id": "sample-cpsc",
                                "name": "Sample CPSC watch",
                                "agency": "CPSC",
                                "productNames": [
                                    "battery"
                                ],
                                "keywords": [
                                    "recall"
                                ],
                                "lookbackDays": 30
                            }
                        ]
                    },
                    "monitorKey": {
                        "title": "Monitor key",
                        "maxLength": 120,
                        "type": "string",
                        "description": "Stable state namespace for one buyer portfolio. Change it to start an independent monitor.",
                        "default": "sample-product-safety"
                    },
                    "initialRunMode": {
                        "title": "Initial run mode",
                        "enum": [
                            "baseline_only",
                            "emit_current_window",
                            "emit_backfill"
                        ],
                        "type": "string",
                        "description": "baseline_only stores the official snapshot with zero rows; the other modes can emit first-run changes.",
                        "default": "baseline_only"
                    },
                    "generateReport": {
                        "title": "Generate portfolio report",
                        "type": "boolean",
                        "description": "Generate portfolio report for this run.",
                        "default": true
                    },
                    "emitRawRows": {
                        "title": "Emit changed safety records",
                        "type": "boolean",
                        "description": "Adds safety-record-row events for changed records.",
                        "default": false
                    },
                    "emitUnchanged": {
                        "title": "Include unchanged records with a change",
                        "type": "boolean",
                        "description": "Only applies when another record changed; a fully unchanged run remains empty and free.",
                        "default": false
                    },
                    "emitExport": {
                        "title": "Generate export row",
                        "type": "boolean",
                        "description": "Generate export row for this run.",
                        "default": false
                    },
                    "maxChargeUsd": {
                        "title": "Maximum charge USD",
                        "minimum": 0,
                        "maximum": 5000,
                        "type": "number",
                        "description": "All unique planned events must fit before the first push.",
                        "default": 25
                    },
                    "dryRun": {
                        "title": "Dry run",
                        "type": "boolean",
                        "description": "Uses an illustrative official-source-shaped sample without network, state, or charges.",
                        "default": true
                    },
                    "requestTimeoutSeconds": {
                        "title": "Request timeout seconds",
                        "minimum": 2,
                        "maximum": 120,
                        "type": "integer",
                        "description": "Request timeout seconds for this run.",
                        "default": 30
                    },
                    "rateLimitMs": {
                        "title": "Minimum request interval ms",
                        "minimum": 0,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Minimum request interval ms for this run.",
                        "default": 250
                    },
                    "maxRetries": {
                        "title": "Maximum retries",
                        "minimum": 0,
                        "maximum": 4,
                        "type": "integer",
                        "description": "Maximum retries for this run.",
                        "default": 2
                    },
                    "backoffBaseMs": {
                        "title": "Backoff base ms",
                        "minimum": 0,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Backoff base ms for this run.",
                        "default": 250
                    },
                    "maxBackoffMs": {
                        "title": "Maximum backoff ms",
                        "minimum": 0,
                        "maximum": 15000,
                        "type": "integer",
                        "description": "Maximum backoff ms for this run.",
                        "default": 4000
                    },
                    "delivery": {
                        "title": "Delivery mode",
                        "enum": [
                            "dataset",
                            "webhook"
                        ],
                        "type": "string",
                        "description": "Delivery mode for this run.",
                        "default": "dataset"
                    },
                    "webhookUrl": {
                        "title": "Webhook URL",
                        "type": "string",
                        "description": "Optional HTTPS copy after dataset event delivery."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
