# Product Category & Industry Snapshot (CPSC, FDA, Federal Spend) (`open-data-tools-hq/product-category-snapshot`) Actor

Market-level snapshot of any product category or NAICS industry from official U.S. data: CPSC recall trends, hazards, units, countries of manufacture; FDA enforcement counts by class and year; federal spending by year, state and agency. Structured numbers, no AI text.

- **URL**: https://apify.com/open-data-tools-hq/product-category-snapshot.md
- **Developed by:** [Open Data Tools](https://apify.com/open-data-tools-hq) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 snapshot returneds

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Product Category & Industry Snapshot: Recalls, FDA Enforcement, Federal Spend

Type a **product category** (for example "stroller", "e-bike", "space heater", "infant formula") or a **NAICS industry code**, and get a structured, numbers-only **market snapshot** compiled from official U.S. government data:

| Section | Source | What you get |
|---|---|---|
| Consumer product recalls | CPSC Recalls API (saferproducts.gov) | Total recalls, recalls by year, approximate units recalled, recalls with injury or incident reports, hazard categories (fire, choking, fall, tip-over...), remedy types, countries of manufacture, latest recall date |
| FDA enforcement | openFDA (food, drug, device) | Enforcement reports by year, by Class I/II/III, by status, voluntary vs. FDA-mandated |
| Industry federal demand | USAspending.gov | Federal obligations per fiscal year, growth rate (CAGR), top states by place of performance, top awarding agencies |

**No AI-written text and no guesswork**: every number is computed from public records at run time, with the sources listed in each row.

### Who uses this

- Product managers, sourcing teams, and Amazon/e-commerce sellers sizing **safety risk** in a category before launching or importing
- Insurance and compliance analysts comparing hazard profiles across categories
- Market researchers, consultants, and students building industry overviews
- GovCon strategists sizing federal demand for a NAICS code

### What this is NOT

This actor describes **categories and industries**, not individual businesses or people. It does not score, rank, or profile any company or person, and should not be used for credit, hiring, tenancy, insurance underwriting of individuals, or legal evidence.

### Input example

```json
{
  "productCategories": ["stroller", "space heater", "infant formula"],
  "naicsCodes": ["336991"],
  "yearsBack": 10,
  "includeRecentRecalls": 3
}
```

### Output example (abridged)

```json
{
  "snapshotType": "productCategory",
  "query": "stroller",
  "periodStart": "2016-10-27",
  "periodEnd": "2026-10-27",
  "cpscConsumerProductRecalls": {
    "totalRecalls": 28,
    "recallsByYear": { "2020": 5, "2022": 4, "2025": 3, "2026": 3 },
    "unitsRecalledApprox": 1289607,
    "recallsWithReportedInjuries": 19,
    "hazardCategories": [ { "name": "fall", "count": 17 }, { "name": "choking", "count": 6 }, { "name": "entrapment", "count": 4 } ],
    "remedyTypes": [ { "name": "Repair", "count": 12 }, { "name": "Refund", "count": 10 } ],
    "countriesOfManufacture": [ { "name": "China", "count": 25 }, { "name": "Vietnam", "count": 1 } ],
    "latestRecallDate": "2026-07-23"
  },
  "fdaEnforcementReports": {
    "food": { "totalEnforcementReports": 0 },
    "drug": { "totalEnforcementReports": 0 },
    "device": { "totalEnforcementReports": 2, "reportsByYear": { "2021": 2 }, "byClassification": { "Class II": 2 } }
  }
}
```

```json
{
  "snapshotType": "industryNaics",
  "query": "336991",
  "federalDemand": {
    "federalObligationsByFiscalYearUsd": { "2017": 4619396.44, "2023": 9398502.99, "2026": 6804612.53 },
    "federalObligationsCagrPct": 4.4,
    "topStatesByPlaceOfPerformanceUsd": [ { "state": "TX", "name": "Texas", "amountUsd": 949469.62 } ],
    "topAwardingAgenciesUsd": [ { "agency": "Department of the Interior", "amountUsd": 1543845.89 } ]
  }
}
```

### Notes

- CPSC matching is by product name keyword. Try singular forms and synonyms ("heater" and "space heater").
- Hazard categories are assigned by transparent keyword rules on the official hazard text. One recall can count in several categories.
- `unitsRecalledApprox` parses "About 52,000" style figures from the notices and is approximate.
- openFDA data is provided "as is" by FDA, and FDA asks that it not be used for medical decisions.
- Priced per snapshot (one row = one category or industry).

### Legal

All data comes from U.S. government sources (CPSC, FDA/openFDA, U.S. Treasury/USAspending). This actor is not affiliated with or endorsed by any of these agencies.

# Actor input Schema

## `productCategories` (type: `array`):

Product keywords (3-80 chars). One snapshot per keyword, built from CPSC recalls and openFDA enforcement reports.

## `naicsCodes` (type: `array`):

Optional 2-6 digit NAICS codes. One industry snapshot each: federal obligations by fiscal year, growth, top states and agencies.

## `yearsBack` (type: `integer`):

How many years of history to aggregate (1-18).

## `sources` (type: `array`):

Which product data sources to include.

## `includeRecentRecalls` (type: `integer`):

Optionally attach the latest public recall notices (date, title, link) to each product snapshot.

## Actor input object example

```json
{
  "productCategories": [
    "stroller",
    "space heater",
    "infant formula"
  ],
  "yearsBack": 10,
  "sources": [
    "cpsc",
    "fda"
  ],
  "includeRecentRecalls": 0
}
```

# Actor output Schema

## `results` (type: `string`):

Default dataset items (overview view in Console).

# 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 = {
    "productCategories": [
        "stroller",
        "space heater",
        "infant formula"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("open-data-tools-hq/product-category-snapshot").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 = { "productCategories": [
        "stroller",
        "space heater",
        "infant formula",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("open-data-tools-hq/product-category-snapshot").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "productCategories": [
    "stroller",
    "space heater",
    "infant formula"
  ]
}' |
apify call open-data-tools-hq/product-category-snapshot --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,open-data-tools-hq/product-category-snapshot"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Lze6ibVOHlFnvsogD/builds/VQkN7vUc8d0UzF3uY/openapi.json
