# Code of Federal Regulations Scraper - eCFR Data (`jungle_synthesizer/ecfr-gov-federal-regulation-scraper`) Actor

Extract the full Code of Federal Regulations at the section level: complete text, hierarchy, statutory authority, and source citations for all 50 CFR titles. Filter by title or pull the entire codified body from eCFR, the official current regulation database.

- **URL**: https://apify.com/jungle_synthesizer/ecfr-gov-federal-regulation-scraper.md
- **Developed by:** [BowTiedRaccoon](https://apify.com/jungle_synthesizer) (community)
- **Categories:** Business, Other, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 record scrapeds

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/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

## Code of Federal Regulations Scraper — eCFR Full-Text Data

Scrapes the Code of Federal Regulations (CFR) from [eCFR](https://www.ecfr.gov), the federal
government's official, continuously updated codification of U.S. regulations. Returns full
section-level text, hierarchy, statutory authority, and citation data for all 50 CFR titles —
split out by title, chapter, part, subpart, and section.

***

### eCFR Scraper Features

- Extracts the full text of every regulation section, not just the heading.
- Returns the complete hierarchy — title, chapter, part, subpart, section — pre-assembled, so you don't reconstruct it from a PDF.
- Includes the statutory authority citation and source/amendment note attached to each section.
- Filter down to one or more CFR titles, or leave it open and pull the entire codified body in a single run.
- Snapshot a specific past date to compare against the current codification.
- Every record carries a direct, citable eCFR permalink and a short-form citation like `21 CFR 101.9`.

***

### Who Uses eCFR Regulation Data?

- **Compliance teams** — watch a specific title or part for changes between two snapshot dates.
- **Legal-AI and RAG builders** — load full, structured regulatory text without re-deriving the title/chapter/part hierarchy yourself.
- **Regulatory affairs staff** — pull the authority and source citations next to the text that depends on them, instead of cross-referencing two documents.
- **Policy researchers and analysts** — compare how different agencies regulate the same subject across titles, without clicking through eCFR's own site one part at a time.
- **Compliance software vendors** — build obligation trackers off clean section text instead of parsing PDFs.

***

### How eCFR Scraper Works

1. Pick one or more CFR titles, or leave the field empty to cover all 49 active titles.
2. The scraper walks each title's official hierarchy — chapter, subchapter, part — down to the part level.
3. Every part's codified text is retrieved and split into individual section records.
4. You get one row per section, with the full hierarchy, authority, and citation already attached.

***

### Input

```json
{
  "titles": ["21"],
  "maxItems": 500
}
```

| Field    | Type    | Default | Description |
|----------|---------|---------|---------------------------------------------------------------------------------------------|
| titles   | array   | `[]`    | Limit the crawl to specific CFR titles (e.g., Title 21 - Food and Drugs). Leave empty to crawl all 49 active titles. |
| asOfDate | string  | `""`    | Fetch the codification as of a specific past date (`YYYY-MM-DD`). Leave blank to use each title's current codification. |
| maxItems | integer | `20`    | Maximum number of regulation sections to return. Set to `0` for unlimited — crawls every selected title in full. |

A run with no `titles` set starts at Title 1 and works upward — set `maxItems: 0` with no title
filter for a full, every-title harvest.

***

### eCFR Scraper Output Fields

```json
{
  "title_number": 21,
  "title_name": "Food and Drugs",
  "chapter": "Chapter I—Food and Drug Administration, Department of Health and Human Services",
  "part_number": "101",
  "part_heading": "Food Labeling",
  "subpart": "Subpart A—General Provisions",
  "section_number": "101.9",
  "section_heading": "Nutrition labeling of food.",
  "section_text": "(a) Nutrition information relating to food shall be provided for all products intended for human consumption...",
  "hierarchy_path": "Food and Drugs > Chapter I—Food and Drug Administration, Department of Health and Human Services > Part 101—Food Labeling > Subpart A—General Provisions > § 101.9",
  "authority": "15 U.S.C. 1333, 1453, 1454, 1455, 4402; 21 U.S.C. 321, 331, 342, 343, 348, 371; 42 U.S.C. 243, 264, 271.",
  "source_note": "[58 FR 2175, Jan. 6, 1993]",
  "amendment_date": "2026-10-13",
  "cfr_citation": "21 CFR 101.9",
  "edition_date": "2026-10-13",
  "url": "https://www.ecfr.gov/on/2026-10-13/title-21/section-101.9"
}
```

| Field           | Type   | Description                                                               |
|-----------------|--------|---------------------------------------------------------------------------|
| title_number    | number | CFR title number (1-50)                                                   |
| title_name      | string | CFR title name (e.g., "Food and Drugs")                                   |
| chapter         | string | Chapter label within the title                                            |
| part_number     | string | Part number within the title (e.g., "101")                                |
| part_heading    | string | Part heading/description (e.g., "Food Labeling")                          |
| subpart         | string | Subpart label within the part, where the source defines one               |
| section_number  | string | Section number (e.g., "101.9")                                            |
| section_heading | string | Section heading text                                                      |
| section_text    | string | Full codified regulatory text of the section                              |
| hierarchy_path  | string | Full breadcrumb: Title > Chapter > Part > Subpart > Section               |
| authority       | string | Statutory authority citation for the part containing this section         |
| source_note     | string | Source/amendment citation for this section, where the source provides one |
| amendment_date  | string | Date this codification is up to date as of                                |
| cfr_citation    | string | Short-form CFR citation (e.g., "21 CFR 101.9")                            |
| edition_date    | string | Snapshot date used to fetch this record                                   |
| url             | string | Canonical eCFR URL for this section                                       |

***

### FAQ

#### How do I scrape the Code of Federal Regulations?

Run eCFR Scraper with no input beyond the defaults and it starts pulling sections from Title 1
onward. Set `titles` to the CFR titles you care about and `maxItems` to however many sections you
need — there's no account or API key to set up first.

#### What data can I get from eCFR?

Every data point tied to a regulation section: the full text, its position in the CFR hierarchy,
the statutory authority behind it, the source/amendment citation, and a permalink you can hand to
someone else. Headings alone won't tell you what a rule actually requires — this returns the text.

#### Can I filter by CFR title?

Yes. Set `titles` to an array of title numbers (e.g., `["21", "40"]`) to restrict the crawl to
Food and Drugs and Protection of Environment. Leave it empty to walk all 49 active titles in
order.

#### Does this return the full regulation text or just summaries?

Full text. `section_text` is the complete codified body of the section, paragraph breaks intact —
not a snippet, not a heading-only index.

#### Can I pull a past version of the regulations?

Set `asOfDate` to a `YYYY-MM-DD` date and every record reflects the codification as it stood then.
Leave it blank and you get each title's current, up-to-date text.

#### Do I need an account or API key for eCFR?

No. eCFR Scraper needs nothing beyond your Apify account to run.

***

### Need More Features?

Need a different output shape, a new filter, or faster snapshot diffing? [File an issue](https://console.apify.com/actors/issues) or get in touch.

### Why Use eCFR Scraper?

- **Full text, not a search wrapper** — competing eCFR listings return search results; this returns the actual codified section text, hierarchy, and citations.
- **Snapshot-diff friendly** — `edition_date` and `amendment_date` are built in, so running this on a schedule gives you something to diff against, not just a fresh dump every time.
- **Covers all 50 titles** — filter down to one title for a narrow compliance watch, or leave it open and get the entire codified body in one run.

# Actor input Schema

## `sp_intended_usage` (type: `string`):

What will this data feed? E.g. lead lists, KYB checks, price tracking.

## `sp_improvement_suggestions` (type: `string`):

Provide any feedback or suggestions for improvements.

## `sp_contact` (type: `string`):

We'll personally help with your use case. No spam.

## `titles` (type: `array`):

Limit the crawl to specific CFR titles (e.g., Title 21 - Food and Drugs). Leave empty to crawl all 49 active titles.

## `asOfDate` (type: `string`):

Fetch the codification as of a specific past date (YYYY-MM-DD). Leave blank to use each title's current codification.

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

Maximum number of regulation sections to return. Set to 0 for unlimited (crawls every selected title in full).

## Actor input object example

```json
{
  "sp_contact": "Share your email here...",
  "titles": [],
  "maxItems": 20
}
```

# 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 = {
    "sp_contact": "Share your email here...",
    "titles": [],
    "asOfDate": "",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("jungle_synthesizer/ecfr-gov-federal-regulation-scraper").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 = {
    "sp_contact": "Share your email here...",
    "titles": [],
    "asOfDate": "",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("jungle_synthesizer/ecfr-gov-federal-regulation-scraper").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 '{
  "sp_contact": "Share your email here...",
  "titles": [],
  "asOfDate": "",
  "maxItems": 20
}' |
apify call jungle_synthesizer/ecfr-gov-federal-regulation-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jungle_synthesizer/ecfr-gov-federal-regulation-scraper"
        }
    }
}
```

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/uLcxz9cUrENvzSoem/builds/xLNVvGiNQmhewgI6x/openapi.json
