# Food Safety Report — Recalls & Supply Chain Risk (`ryanclinton/food-safety-report`) Actor

Generate a comprehensive food safety supply chain risk report by querying 7 data sources in parallel — FDA food recalls, FDA adverse events, UK Food Hygiene ratings, Open Food Facts product data, UN COMTRADE trade flows, OpenAQ air quality, and NOAA weather alerts.

- **URL**: https://apify.com/ryanclinton/food-safety-report.md
- **Developed by:** [ryan clinton](https://apify.com/ryanclinton) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$200.00 / 1,000 analysis runs

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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## Food Safety Report

Generate a comprehensive food safety supply chain risk report by querying 7 data sources in parallel -- FDA food recalls, FDA adverse events, UK Food Hygiene ratings, Open Food Facts product data, UN COMTRADE trade flows, OpenAQ air quality, and NOAA weather alerts. Applies four scoring models to produce a composite risk score with contamination pathway analysis and actionable recommendations.

### Features

- Queries 7 food safety and environmental data sources simultaneously for complete supply chain coverage
- Scores ingredient risk based on FDA recall severity classification (Class I/II/III) and adverse event outcomes including hospitalizations and deaths
- Maps contamination pathways across biological (Salmonella, Listeria, E. coli), chemical (allergens, heavy metals, pesticides), and environmental (air particulate) vectors
- Evaluates supplier hygiene using UK Food Standards Agency ratings and Open Food Facts Nutri-Score grades
- Assesses seasonal risk by correlating weather alerts with historical recall patterns and cold chain disruption potential
- Produces a weighted composite score (0-100) with LOW/MODERATE/HIGH/CRITICAL risk levels

### Use Cases

- **Food Safety Managers**: Screen ingredients, suppliers, or product categories for recall history, contamination pathways, and current seasonal risks before procurement decisions
- **Supply Chain Risk Analysts**: Evaluate trade flow volumes against recall frequency to identify high-risk import corridors for food commodities
- **Quality Assurance Teams**: Monitor supplier hygiene ratings and contamination signals to prioritize audit schedules and testing programs
- **Insurance Underwriters**: Assess food safety exposure for manufacturers and distributors based on ingredient risk profiles and environmental factors
- **Regulatory Compliance Officers**: Track FDA enforcement patterns, recall trends, and adverse event burdens to maintain compliance readiness

### How to Use

1. Click **Try for free** on this page
2. Enter the **Product or Supplier Name** to analyze (e.g., "salmon", "peanut butter", "Nestle")
3. Optionally specify a **Food Category** (e.g., "seafood", "dairy") and **Country** for trade flow context
4. Click **Start** and wait for the run to finish
5. Download results from the **Dataset** tab in JSON, CSV, or Excel

### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| query | string | Yes | Food product, ingredient, supplier, or brand to analyze (e.g., "salmon", "peanut butter", "Nestle") |
| category | string | No | Optional food category to narrow search (e.g., "seafood", "dairy", "produce", "supplements") |
| country | string | No | Optional origin country for trade flow analysis (e.g., "US", "China", "Brazil") |

### Output Example

```json
{
  "query": "salmon",
  "compositeScore": 47,
  "riskLevel": "MODERATE",
  "ingredientRisk": {
    "score": 38,
    "recallCount": 6,
    "adverseEventCount": 12,
    "tradeFlowVolume": 2340000000,
    "riskCorrelation": 0.26,
    "riskLevel": "MODERATE",
    "topRecallReasons": [
      { "reason": "Potential Listeria monocytogenes contamination", "count": 3 },
      { "reason": "Undeclared sulfites", "count": 2 }
    ]
  },
  "contaminationPathways": {
    "score": 42,
    "biologicalRisk": 16,
    "chemicalRisk": 12,
    "environmentalRisk": 5,
    "pathways": ["Biological: listeria", "Chemical: allergen", "Chemical: sulfite"]
  },
  "supplierHygiene": {
    "score": 72,
    "establishmentsChecked": 15,
    "averageRating": 4.2,
    "hygieneLevel": "GOOD"
  },
  "seasonalRisk": {
    "score": 31,
    "activeWeatherAlerts": 3,
    "severeAlerts": 1,
    "currentSeasonRisk": "MODERATE"
  },
  "allSignals": [
    "6 FDA food recalls - elevated ingredient risk",
    "Multiple biological pathogen detections in recall history",
    "1 severe/extreme weather alerts - food safety impact"
  ],
  "recommendations": [
    "Multiple contamination pathways identified - review HACCP plan",
    "Biological pathogen risk elevated - enhance microbiological testing"
  ]
}
````

### Scoring Model

The composite risk score (0-100) is a weighted average of four independent scoring dimensions:

- **Ingredient Risk (30% weight)**: Scores 0-100 based on FDA recall severity (Class I = 10 points, Class II = 5, Class III = 2), adverse event burden (serious outcomes weighted 5x), trade flow volume amplifier, and recall-to-trade correlation ratio. Higher trade volumes with more recalls indicate systemic ingredient problems.
- **Contamination Pathways (25% weight)**: Scores 0-100 across three vectors. Biological risk (max 30) detects pathogens like Salmonella, Listeria, E. coli, and Campylobacter in recall reasons. Chemical risk (max 30) flags allergens, heavy metals, pesticides, melamine, and aflatoxin. Environmental risk (max 20) uses OpenAQ PM2.5 readings against WHO guidelines.
- **Supplier Hygiene (25% weight, inverted)**: Scores 0-100 where higher means better hygiene. Based on UK Food Hygiene rating averages (0-5 scale), five-star percentage bonus, zero/one-star penalty, establishment volume reliability, and Open Food Facts Nutri-Score grades. Inverted in the composite so low hygiene increases overall risk.
- **Seasonal Risk (20% weight)**: Scores 0-100 from active weather alerts (extreme/severe weighted higher), recall seasonality ratio comparing current month to historical average, recent recall volume, and heat-specific alerts that amplify spoilage and pathogen growth risk.

Risk levels: LOW (0-24), MODERATE (25-49), HIGH (50-74), CRITICAL (75-100).

### How Much Does It Cost?

Each run costs approximately $0.25-$0.60 in platform usage. The Apify Free plan provides $5 of monthly usage, enough for 8-20 food safety reports. Paid plans start at $49/month for higher volume.

### Programmatic Access

#### Python

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("ryanclinton/food-safety-report").call(run_input={
    "query": "salmon",
    "category": "seafood",
    "country": "US"
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### JavaScript

```javascript
import { ApifyClient } from "apify-client";
const client = new ApifyClient({ token: "YOUR_API_TOKEN" });
const run = await client.actor("ryanclinton/food-safety-report").call({
    query: "salmon",
    category: "seafood",
    country: "US"
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

### FAQ

**What FDA data is included?**
The report pulls from two FDA sources: the food recall database (covering all Class I, II, and III recalls with reason codes and classification severity) and the CAERS adverse event reporting system (including outcomes such as hospitalizations, emergency room visits, and deaths linked to food products).

**How are contamination pathways identified?**
Recall reasons are parsed for biological pathogens (Salmonella, Listeria, E. coli, Campylobacter, Norovirus, Botulism, Clostridium) and chemical hazards (undeclared allergens, lead, mercury, arsenic, pesticides, melamine, aflatoxin, sulfites). Environmental risk uses real-time air quality readings from OpenAQ compared against WHO PM2.5 guidelines.

**What is the UK Food Hygiene rating?**
The UK Food Standards Agency rates food establishments on a 0-5 scale based on hygiene practices, structural compliance, and confidence in management. The actor uses these ratings as a proxy for supplier quality when establishments are found matching the query.

**Can I monitor specific suppliers over time?**
Yes. Schedule this actor to run daily or weekly via the Apify platform scheduler. Each run captures the current state of recalls, adverse events, and environmental conditions, allowing you to track risk trends over time.

### Integrations

Use this actor with:

- [Zapier](https://apify.com/integrations/zapier) for automated workflows
- [Make](https://apify.com/integrations/make) for complex automations
- [Google Sheets](https://apify.com/integrations/google-sheets) for spreadsheet export
- The [Apify API](https://docs.apify.com/api/v2) for programmatic access

# Actor input Schema

## `query` (type: `string`):

Food product, ingredient, supplier, or brand to analyze (e.g. 'salmon', 'peanut butter', 'Nestlé')

## `category` (type: `string`):

Optional food category to narrow the search (e.g. 'seafood', 'dairy', 'produce', 'supplements')

## `country` (type: `string`):

Optional origin country for trade flow analysis and location context (e.g. 'US', 'China', 'Brazil')

## Actor input object example

```json
{
  "query": "salmon"
}
```

# Actor output Schema

## `results` (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 = {
    "query": "salmon"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ryanclinton/food-safety-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 = { "query": "salmon" }

# Run the Actor and wait for it to finish
run = client.actor("ryanclinton/food-safety-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 '{
  "query": "salmon"
}' |
apify call ryanclinton/food-safety-report --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Food Safety Report — Recalls & Supply Chain Risk",
        "description": "Generate a comprehensive food safety supply chain risk report by querying 7 data sources in parallel — FDA food recalls, FDA adverse events, UK Food Hygiene ratings, Open Food Facts product data, UN COMTRADE trade flows, OpenAQ air quality, and NOAA weather alerts.",
        "version": "1.0",
        "x-build-id": "BFG7CASA2i4IdCwg7"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ryanclinton~food-safety-report/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ryanclinton-food-safety-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/ryanclinton~food-safety-report/runs": {
            "post": {
                "operationId": "runs-sync-ryanclinton-food-safety-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/ryanclinton~food-safety-report/run-sync": {
            "post": {
                "operationId": "run-sync-ryanclinton-food-safety-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": [
                    "query"
                ],
                "properties": {
                    "query": {
                        "title": "Product or Supplier Name",
                        "type": "string",
                        "description": "Food product, ingredient, supplier, or brand to analyze (e.g. 'salmon', 'peanut butter', 'Nestlé')"
                    },
                    "category": {
                        "title": "Food Category",
                        "type": "string",
                        "description": "Optional food category to narrow the search (e.g. 'seafood', 'dairy', 'produce', 'supplements')"
                    },
                    "country": {
                        "title": "Country",
                        "type": "string",
                        "description": "Optional origin country for trade flow analysis and location context (e.g. 'US', 'China', 'Brazil')"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
