# FDA Import Refusal History by Facility (`recordfoundry/fda-import-refusal-history`) Actor

Look up FDA import refusal records for one facility ID (FEI). Get original records, decoded refusal reasons, dates, and source evidence as JSON. Coverage starts in 2024.

- **URL**: https://apify.com/recordfoundry/fda-import-refusal-history.md
- **Developed by:** [Record Foundry](https://apify.com/recordfoundry) (community)
- **Categories:**
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$500.00 / 1,000 nonempty facility refusal reports

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## FDA Import Refusal History by Facility

Enter one exact FDA facility identifier (FEI) and receive the currently published FDA import-refusal rows for that facility, along with the original rows, decoded FDA charge definitions, archive hash, and freshness evidence.

This Actor fetches the FDA's published **2024-current** refusal-export period at run time. It is not complete supplier screening: warning letters, import alerts, recalls, and other FDA sources are `not_checked`. It makes no supplier approval, risk, or compliance determination, and it uses no LLM. Results retain the original matching evidence rows.

### Input

```json
{"fei": "3002678247"}
```

`fei` is required and must be a digits-only string. FEIs are matched exactly; the Actor accepts no URLs, file uploads, or optional search settings.

### Output

Every successful run returns one structured JSON report.

| Field | Meaning |
| --- | --- |
| `status` | `checked_matches_found` or `checked_no_matches` for the fresh export |
| `refusalLineCount` | Matching CSV lines, never shipment volume or a refusal rate |
| `chargeCounts` | FDA charge definitions with per-line counts; a repeated code in one line counts once |
| `summaries` | Deterministic refusal-line counts by month and exact product-code/description pair |
| `records` | Original matching FDA CSV rows |
| `source.publishedCoverageEndMonth` | Coverage month parsed from FDA's refusal CSV filename |
| `source.freshness` | Freshness check based on that filename, not observed row dates |
| `checks` | Explicit status for the refusal export and `not_checked` for other FDA sources |

The Actor rejects a source whose filename-derived coverage end is more than 90 days old. It also rejects unreadable or oversized archives, more than 10 ZIP members, more than 100 MB uncompressed data, more than 250,000 CSV rows, an empty refusal CSV, source schema or identity conflicts, and reports larger than 5,000 matching rows. It never silently truncates evidence.

`checked_no_matches` means no exact FEI matched this export; it is not supplier clearance. A source or validation failure fails the run and produces no dataset item or charge.

`summaries` has `summaryVersion: "1"`. `monthlyRefusalLineCounts` counts matching CSV refusal lines by `REFUSAL_DATE` month. `productCounts` groups only the exact `PRODUCT_CODE` and `PRDCT_CODE_DESC_TEXT` pair and reports its first and latest refusal date. Charge counts remain only in `chargeCounts`.

### Price

$0.50 for a successfully delivered report with one or more matching refusal lines. A successful no-match report is free. The configured run budget must cover the report charge.

### Source and limits

FDA's [Import Refusal Report](https://www.accessdata.fda.gov/scripts/ImportRefusals/index.cfm) is the publisher. The report stores its download URL, archive SHA-256, filenames, row counts, and original rows. The publisher URL supplies source context; the downloaded archive and hash are the run-specific evidence.

This is a narrow evidence lookup for the stated published period, not a substitute for full supplier due diligence or a claim of FDA archive completeness.

### Local checks

```sh
python3 -m unittest -v
```

The hosted runtime uses Python 3.12 and Apify SDK 4.0.2. Runtime memory is fixed at 512 MB.

### More from Record Foundry

[Record Foundry publisher](https://apify.com/recordfoundry) · [Austin Commercial Change-of-Use Permits](https://apify.com/recordfoundry/austin-commercial-use-changes) · [Chicago Property Use and Occupancy Changes](https://apify.com/recordfoundry/chicago-property-use-changes)

# Actor input Schema

## `fei` (type: `string`):

Digits only. This is matched exactly and is kept as a string.

## Actor input object example

```json
{}
```

# Actor output Schema

## `report` (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("recordfoundry/fda-import-refusal-history").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("recordfoundry/fda-import-refusal-history").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 '{}' |
apify call recordfoundry/fda-import-refusal-history --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,recordfoundry/fda-import-refusal-history"
        }
    }
}

```

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/boy017k05fMklomQS/builds/dMHavASPQGdZfBOlQ/openapi.json
