# Regulatory Compliance Search API: Federal Register & FDA (`truenorth/regulatory-compliance-search-api`) Actor

Search official Federal Register documents and openFDA drug enforcement recalls in one normalized compliance dataset. Fast REST API, zero scraping.

- **URL**: https://apify.com/truenorth/regulatory-compliance-search-api.md
- **Developed by:** [TrueNorth](https://apify.com/truenorth) (community)
- **Categories:** Developer tools, Automation, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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

## Regulatory Compliance Search API: Federal Register & openFDA

The **Regulatory Compliance Search API** is a high-performance, browser-free Apify Actor that queries official government REST endpoints—specifically the **Federal Register API v1** and the **openFDA Drug Enforcement API v1**—and unifies their results into a single, normalized JSON dataset.

It eliminates the fragmentation of monitoring federal rulemaking and pharmaceutical enforcement actions across separate tools, delivering clean, structured data for compliance officers, legal tech developers, and AI/RAG pipelines.

> \[!IMPORTANT]
> **Scope Notice & Legal Disclaimer**:
> This Actor provides targeted access strictly to official **Federal Register** publications and **openFDA Drug Enforcement** recall records. It does **NOT** provide complete legal or global regulatory coverage (e.g., state-level statutes, international dockets, SEC EDGAR financial filings, or European ESEF reporting are unsupported). Outputs do not constitute legal, medical, or regulatory compliance advice. Always verify original documents via official agency URLs.

***

### Key Features

- **Cross-Source Normalization**: Seamlessly combines Federal Register documents (Rules, Proposed Rules, Notices, Executive Orders) and openFDA Drug Recalls (Class I, II, III) into one standardized schema (`RegulatoryComplianceRecord`).
- **100% API-Driven**: Queries official, SLA-backed public REST APIs (`federalregister.gov` and `api.fda.gov`). No fragile HTML web scraping, headless browsers, or DOM selectors.
- **Advanced Upstream Filtering**:
  - **Federal Register**: Filter by search terms, document types, issuing agency slugs/IDs, date ranges (`YYYY-MM-DD`), and sort order (`newest`, `oldest`, `relevance`).
  - **openFDA**: Filter using full Lucene search syntax (e.g., `reason_for_recall:"contamination"`, `classification:"Class I"`).
- **Built-in Resilience & Deduplication**: Automatic handling of HTTP 429 rate limits with exponential backoff. Global in-memory deduplication ensures you never pay for duplicate records within a run.
- **AI & RAG Ready**: Clean JSON output structure optimized for direct ingestion into LLM vector databases (Pinecone, Qdrant, Chroma) and agent frameworks (LangChain, LlamaIndex, MCP).

***

### Input Parameters

| Field                                | Type    | Default                            | Description                                                                                  |
| :----------------------------------- | :------ | :--------------------------------- | :------------------------------------------------------------------------------------------- |
| `sources`                            | Array   | `["FEDERAL_REGISTER", "OPEN_FDA"]` | Active sources to query. Controls execution order and global record allocation.              |
| `federalRegisterTerm`                | String  | *Optional*                         | Keyword or phrase query for Federal Register (e.g., `"cybersecurity"`, `"sanctions"`).       |
| `federalRegisterDocumentTypes`       | Array   | *Optional*                         | Filter by document type: `"Rule"`, `"Proposed Rule"`, `"Notice"`, `"Executive Order"`.       |
| `federalRegisterAgencies`            | Array   | *Optional*                         | Array of agency slugs or IDs (e.g., `["federal-communications-commission"]` or `["161"]`).   |
| `federalRegisterPublicationDateFrom` | String  | *Optional*                         | Earliest publication date in `YYYY-MM-DD` format.                                            |
| `federalRegisterPublicationDateTo`   | String  | *Optional*                         | Latest publication date in `YYYY-MM-DD` format.                                              |
| `federalRegisterOrder`               | String  | `"newest"`                         | Result ordering: `"newest"`, `"oldest"`, or `"relevance"`.                                   |
| `openFdaSearch`                      | String  | *Optional*                         | openFDA Lucene query expression (e.g., `reason_for_recall:"contamination"`).                 |
| `openFdaApiKey`                      | String  | *Optional*                         | Optional private openFDA API key for elevated rate limits. Passed securely to `api.fda.gov`. |
| `pageSize`                           | Integer | `100`                              | Upstream records requested per page (1–100).                                                 |
| `maxItems`                           | Integer | `100`                              | Maximum total unique dataset records to save globally (1–10,000).                            |
| `maxPagesPerSource`                  | Integer | `100`                              | Maximum upstream pages to fetch per source (1–1,000).                                        |

***

### Input Examples

#### Example 1: Cross-Source Multi-Agency Search

```json
{
  "sources": ["FEDERAL_REGISTER", "OPEN_FDA"],
  "federalRegisterTerm": "cybersecurity",
  "federalRegisterDocumentTypes": ["Rule", "Proposed Rule"],
  "openFdaSearch": "reason_for_recall:\"contamination\"",
  "pageSize": 50,
  "maxItems": 100
}
```

#### Example 2: Targeted Federal Register Agency Monitoring

```json
{
  "sources": ["FEDERAL_REGISTER"],
  "federalRegisterTerm": "spectrum",
  "federalRegisterAgencies": ["federal-communications-commission"],
  "federalRegisterPublicationDateFrom": "2026-01-01",
  "federalRegisterOrder": "newest",
  "maxItems": 25
}
```

#### Example 3: openFDA Class I Drug Recall Search

```json
{
  "sources": ["OPEN_FDA"],
  "openFdaSearch": "classification:\"Class I\" AND status:\"Ongoing\"",
  "pageSize": 20,
  "maxItems": 50
}
```

***

### Output Schema & Dataset Views

Every saved record adheres strictly to the `RegulatoryComplianceRecord` dataset schema:

| Field                    | Type           | Description                                                                                                   |
| :----------------------- | :------------- | :------------------------------------------------------------------------------------------------------------ |
| `id`                     | String         | Unique deterministic record ID (`FR-<document_number>` or `FDA-<recall_number                                 | event_id>`). |
| `source`                 | String         | Source authority (`"FEDERAL_REGISTER"` or `"OPEN_FDA"`).                                                      |
| `title`                  | String         | Document title or normalized product description snippet.                                                     |
| `documentType`           | String         | Normalized category: `"RULE"`, `"PROPOSED_RULE"`, `"NOTICE"`, `"EXECUTIVE_ORDER"`, or `"ENFORCEMENT_RECALL"`. |
| `authorityAgency`        | String         | Issuing agency or FDA recalling firm.                                                                         |
| `publicationDate`        | String         | Publication or report date in `YYYY-MM-DD` format.                                                            |
| `severityClassification` | String         | Risk level: `"CLASS_I"`, `"CLASS_II"`, `"CLASS_III"`, `"RULEMAKING"`, or `"INFORMATIONAL"`.                   |
| `status`                 | String         | Status: `"ACTIVE"`, `"PROPOSED"`, `"ONGOING"`, `"TERMINATED"`, or `"COMPLETED"`.                              |
| `summary`                | String         | Plaintext abstract, recall reason, or document excerpt.                                                       |
| `url`                    | String         | Canonical URL to official government publication or safety alert.                                             |
| `pdfUrl`                 | String | Null | Direct link to official PDF document (Federal Register only; null for openFDA).                               |
| `geography`              | Object         | Jurisdiction object containing `country`, `state`, `city`, and `distributionPattern`.                         |
| `sourceDataRaw`          | Object         | Complete, un-mutated JSON payload received from upstream API.                                                 |
| `retrievedAt`            | String         | ISO 8601 UTC timestamp of retrieval.                                                                          |

#### Output Sample JSON

```json
{
  "id": "FR-2026-15123",
  "source": "FEDERAL_REGISTER",
  "title": "Review of Submarine Cable Landing License Rules and Procedures...",
  "documentType": "RULE",
  "authorityAgency": "Federal Communications Commission",
  "publicationDate": "2026-07-27",
  "severityClassification": "RULEMAKING",
  "status": "ACTIVE",
  "summary": "In this document, the Federal Communications Commission adopted a Second Report and Order...",
  "url": "https://www.federalregister.gov/documents/2026/07/27/2026-15123/review-of-submarine-cable...",
  "pdfUrl": "https://www.govinfo.gov/content/pkg/FR-2026-07-27/pdf/2026-15123.pdf",
  "geography": {
    "country": "United States",
    "state": null,
    "city": null,
    "distributionPattern": null
  },
  "sourceDataRaw": { ... },
  "retrievedAt": "2026-07-27T09:21:13.107Z"
}
```

#### Dataset Views

- **`overview`**: Tabular view displaying `id`, `source`, `title`, `documentType`, `authorityAgency`, `publicationDate`, `severityClassification`, `status`, and `url`.
- **`federal-register`**: Filtered view for Federal Register items with `pdfUrl`.
- **`openfda-enforcement`**: Filtered view for openFDA recalls highlighting `geography`.

#### Key-Value Store `OUTPUT` Summary

At run completion, a summary object is written to the Key-Value store under key `OUTPUT`:

```json
{
  "status": "SUCCEEDED",
  "selectedSources": ["FEDERAL_REGISTER", "OPEN_FDA"],
  "recordsWritten": 100,
  "duplicatesSkipped": 0,
  "invalidRecords": 0,
  "sourceResults": [
    {
      "source": "FEDERAL_REGISTER",
      "pagesFetched": 1,
      "recordsReceived": 50,
      "recordsWritten": 50,
      "stopReason": "SOURCE_EXHAUSTED",
      "errorCode": null
    }
  ],
  "startedAt": "2026-07-27T09:21:10.000Z",
  "finishedAt": "2026-07-27T09:21:13.251Z"
}
```

***

### AI & RAG Use Cases

1. **RAG Knowledge Base Ingestion**: Feed clean, structured regulatory updates directly into vector databases (Pinecone, Qdrant, Chroma) to power enterprise compliance AI assistants.
2. **Automated Regulatory Horizon Scanning**: Monitor agency rulemakings (`PROPOSED_RULE`) and critical drug recalls (`CLASS_I`) to trigger real-time compliance workflow alerts.
3. **AI Agent Tooling / Function Calling**: Integrate structured regulatory search into AI agent frameworks (LangChain, LlamaIndex, AutoGen, MCP).
4. **Pharma & Supply Chain Risk Intelligence**: Cross-reference pharmaceutical suppliers against openFDA enforcement actions and safety alerts.

***

### Limitations & Scope Boundaries

- **Supported Sources**: Federal Register API v1 and openFDA Drug Enforcement API v1 ONLY.
- **Unsupported Coverage**: Does NOT search SEC EDGAR filings, European ESEF financial reporting, state court dockets, or international regulatory bodies.
- **Upstream Rate Limits**: Federal Register public limit (~1,000 req/hr). openFDA public limit (240 req/min, 1,000 req/day/IP; supply `openFdaApiKey` for up to 120,000 req/day).
- **Compliance Disclaimer**: Data is retrieved directly from official government REST APIs without alteration. Always verify original document links before taking regulatory or legal action.

***

### Pricing

- **Pay-Per-Event (PPE)**: **USD 0.002 per record** ($2.00 per 1,000 records). Charged only for successfully saved unique dataset items.
- **Platform Usage Costs**: Compute, memory, and proxy costs are passed through directly without actor startup fees or markup.

***

### Local Development & Verification

```bash
## Install dependencies
pnpm install --frozen-lockfile

## Run test suite
pnpm test

## Check TypeScript types & build
pnpm typecheck
pnpm build

## Validate JSON Schemas
pnpm validate:schemas
```

# Actor input Schema

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

Official sources to search.

## `federalRegisterTerm` (type: `string`):

Optional term for Federal Register search.

## `federalRegisterDocumentTypes` (type: `array`):

Document types to include.

## `federalRegisterAgencies` (type: `array`):

Agency slugs to include.

## `federalRegisterPublicationDateFrom` (type: `string`):

Earliest publication date in ISO format.

## `federalRegisterPublicationDateTo` (type: `string`):

Latest publication date in ISO format.

## `federalRegisterOrder` (type: `string`):

Result ordering.

## `openFdaSearch` (type: `string`):

Optional openFDA search query.

## `openFdaApiKey` (type: `string`):

Optional openFDA API key.

## `pageSize` (type: `integer`):

Records requested per upstream page.

## `maxItems` (type: `integer`):

Maximum records written to dataset.

## `maxPagesPerSource` (type: `integer`):

Maximum upstream pages fetched per source.

## Actor input object example

```json
{
  "sources": [
    "FEDERAL_REGISTER",
    "OPEN_FDA"
  ],
  "federalRegisterOrder": "newest",
  "pageSize": 100,
  "maxItems": 100,
  "maxPagesPerSource": 100
}
```

# 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("truenorth/regulatory-compliance-search-api").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("truenorth/regulatory-compliance-search-api").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 truenorth/regulatory-compliance-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,truenorth/regulatory-compliance-search-api"
        }
    }
}

```

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/wBuR9zTwe9JgOdFt0/builds/uTAcfEdbbzcHCJWE3/openapi.json
