# Supplier Compliance Screen (FDA + EPA ECHO) (`moonee/supplier-compliance-screen`) Actor

Checks supplier names against public FDA enforcement and EPA ECHO facility records.

- **URL**: https://apify.com/moonee/supplier-compliance-screen.md
- **Developed by:** [Francesco](https://apify.com/moonee) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 results

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

## Supplier Compliance Screen

Supplier Compliance Screen is a public Apify Actor that checks up to three US company names against public **openFDA enforcement** and **EPA ECHO facility** records. It writes one dataset row per company only when every requested FDA and EPA lookup for that company validates. Companies with a failed lookup are not written to the dataset; their partial findings and errors are stored in the run's Key-Value Store (see below). Each match links to the official source.

**Independent product disclaimer:** Supplier Compliance Screen is an independent product and is not affiliated with, endorsed by, or sponsored by the US Food and Drug Administration (FDA) or the US Environmental Protection Agency (EPA). Agency names are used only to identify public data sources.

This is an approximate name search for research support. A match does not establish wrongdoing; verify every record with the source agency before acting. Results are not legal, regulatory, or compliance advice.

### Input

```json
{
  "companies": ["Tyson Foods", "Blue Bell Creameries", "Johnson & Johnson"],
  "companyStates": ["AR", "TX", "NJ"],
  "sources": ["fda", "epa"],
  "lookbackYears": 5,
  "maxMatchesPerCompany": 10
}
```

- `companies`: 1–3 non-empty company names; at most one dataset row per unique name, written only if that company's lookups validate.
- `state`: optional global two-letter state abbreviation for EPA ECHO.
- `companyStates`: optional state list aligned by index with `companies`; each provided state overrides the global `state` for that company.
- `sources`: `fda`, `epa`, or both. Defaults to both.
- `lookbackYears`: FDA date window, from 1 to 10 years. EPA results use the agency's current summary window.
- `maxMatchesPerCompany`: FDA result cap across food, drug, and device endpoints, from 1 to 10. EPA facility rows are capped at 10.

### Output

Each successful dataset item includes `company`, `query`, `fda.recalls`, `epa.facilities`, `riskScore` (0–100), `riskBasis`, `sourcesChecked`, `fetchedAt`, `errors` (empty), and a disclaimer. A score is a transparent count-based signal, not a legal or compliance conclusion. FDA returns enforcement records; EPA fields are ECHO facility indicators.

If any requested FDA or EPA lookup fails after retries, that company's partial findings and `errors` are saved immediately in the run's default Key-Value Store under a per-company key such as `FAILED_LOOKUPS_1` (JSON). They are omitted from the default dataset because the current PPE configuration automatically charges for each default dataset item. The run log identifies affected companies and points to their records. This keeps failed lookups inspectable without charging the per-item event; it also means consumers that only read the default dataset will not see partial rows.

### Billing regression check

Run `npm test` in this directory (no Apify cloud run): regression tests verify an all-success company writes exactly one default dataset item; a failed company writes its complete partial result and error to its own `FAILED_LOOKUPS_{n}` KVS key without adding a default dataset item; and multiple companies are handled independently. Before release, review a free or explicitly authorized cloud run only if the account can run it without PPE charges; otherwise validate after the event configuration and code have been approved together.

### Sources and operating behavior

- FDA: `https://api.fda.gov/{food,drug,device}/enforcement.json` (official, keyless API; terms: <https://open.fda.gov/terms/>).
- EPA: <https://echodata.epa.gov/echo/echo_rest_services.get_facilities> (official ECHO search service).
- The Actor makes sequential requests, waits between source calls and companies, retries throttling/server errors with backoff, uses no proxy, and limits each run to three companies.
- EPA name search uses ECHO's `p_fn` facility-name parameter, state filter, and a small response set. The API's returned facility rows may not correspond to the corporate parent.

### Run locally

Requires Node.js 20+ and the Apify CLI.

```sh
npm install
apify run
```

`INPUT.json` contains a small three-company sample. The Actor uses public endpoints only and does not evade CAPTCHA, WAF, or access controls.

### Test input

The three sample names from the candidate brief are Tyson Foods (AR), Blue Bell Creameries (TX), and Johnson & Johnson (NJ); `companyStates` applies their individual state filters by list order in the bundled input.

### Scope

The Actor screens public records for research support. It does not make compliance determinations, verify corporate identity, or replace review of the linked agency records. Pricing and run limits are shown on the Apify Store listing and may change.

# Actor input Schema

## `companies` (type: `array`):

Company names to search (maximum 3 per run).

## `state` (type: `string`):

Optional US state abbreviation used for the EPA ECHO search.

## `companyStates` (type: `array`):

Optional two-letter state list aligned by index with companies; overrides global state.

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

Public sources to query.

## `lookbackYears` (type: `integer`):

FDA records older than this many years are omitted. EPA results use EPA's current summary window.

## `maxMatchesPerCompany` (type: `integer`):

Maximum FDA records across food, drug, and device enforcement endpoints.

## Actor input object example

```json
{
  "companies": [
    "Tyson Foods"
  ],
  "sources": [
    "fda",
    "epa"
  ],
  "lookbackYears": 5,
  "maxMatchesPerCompany": 10
}
```

# Actor output Schema

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

Dataset items with the FDA and EPA ECHO records and screening summary for each company with fully validated lookups.

# 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 = {
    "companies": [
        "Tyson Foods"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("moonee/supplier-compliance-screen").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 = { "companies": ["Tyson Foods"] }

# Run the Actor and wait for it to finish
run = client.actor("moonee/supplier-compliance-screen").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 '{
  "companies": [
    "Tyson Foods"
  ]
}' |
apify call moonee/supplier-compliance-screen --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,moonee/supplier-compliance-screen"
        }
    }
}
```

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/AKktB9xOoMXtd3adi/builds/rTxS4LYYMyTZhkOHC/openapi.json
