# eCFR Scraper — US Code of Federal Regulations (`ponderable_hydrometer/ecfr-scraper`) Actor

Scrape the US Code of Federal Regulations (eCFR) — full regulatory text structured by section with citations and hierarchy. Any title, part, point-in-time date. Free, no key.

- **URL**: https://apify.com/ponderable\_hydrometer/ecfr-scraper.md
- **Developed by:** [Ponderable Hydrometer](https://apify.com/ponderable_hydrometer) (community)
- **Categories:** Developer tools, Automation, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.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/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

## eCFR Scraper — US Code of Federal Regulations

**Turn the eCFR's official but awkward XML into clean, section-level JSON** — one row per CFR section with heading, citation, full text and full hierarchy (chapter / part / subpart). Filter by part, chapter or subpart; snapshot any version date. Free keyless official API.

For legal/compliance datasets, regulatory monitoring, and RAG pipelines over federal regulations.

### What you get

Per section:

- **Location** — `title`, `titleName`, `date`, `chapter`, `part`, `subpart`, `sectionNumber`
- **Heading & citation** — `heading`, `citation` (e.g. `14 CFR 1.1`)
- **Text** — `text` (clean, paragraphs joined) and `paragraphs[]` (each paragraph separately)
- **Hierarchy** — `ancestry[]` (the chapter→part→subpart→section path)

### Output sample

```json
{
  "title": 14,
  "titleName": "Aeronautics and Space",
  "date": "2026-01-01",
  "chapter": "I",
  "part": "1",
  "subpart": null,
  "sectionNumber": "1.1",
  "heading": "General definitions.",
  "citation": "14 CFR 1.1",
  "text": "As used in Subchapters A through K of this chapter, unless the context requires otherwise:\n\nAdministrator means the Federal Aviation Administrator...",
  "paragraphs": [
    "As used in Subchapters A through K of this chapter, unless the context requires otherwise:",
    "Administrator means the Federal Aviation Administrator..."
  ],
  "ancestry": ["TITLE 14", "CHAPTER I", "PART 1", "SECTION 1.1"]
}
```

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `title` | integer | `14` | CFR title number (1–50). **Required.** |
| `date` | string | — | Snapshot date (`YYYY-MM-DD`); empty = title's latest version |
| `part` | string | `1` | Limit to a single part; empty scrapes all parts (larger) |
| `chapter` | string | — | Only include parts under this chapter, e.g. `I` |
| `subpart` | string | — | Only include sections under this subpart, e.g. `A` |
| `maxResults` | integer | `5000` | Cap on sections returned |

### Example input

```json
{
  "title": 14,
  "part": "1"
}
```

Whole chapter: `{"title":17,"chapter":"II","maxResults":2000}`. Dated snapshot: `{"title":40,"date":"2026-01-01","chapter":"I","maxResults":3000}`.

### Why this actor

- **Section-level structure** — one clean record per section with heading, citation and full text, not a wall of XML.
- **Full hierarchy + filters** — chapter/part/subpart context on every row, with chapter and subpart filters and deep whole-title scraping.
- **Version-dated** — reproduce the CFR exactly as it stood on any date.

### Pricing

Pay per result — **$4 per 1,000 results** (one result = one CFR section). No subscription; you pay only for what you get.

### Notes & limits

- Source is the official eCFR versioner API — free, keyless. Scraping a whole title with no `part` filter is large and slower.
- Public data; you are responsible for compliant use. Not affiliated with the US Government Publishing Office.

### Related actors

- **Congress.gov Scraper** — US bills, laws and members.
- **CourtListener Scraper** — US case law and court opinions.
- **Australia Legislation Scraper** — Australian federal Acts and instruments.

# Actor input Schema

## `title` (type: `integer`):

CFR title to scrape (1–50), e.g. 14 for Aeronautics and Space.

## `date` (type: `string`):

Snapshot date (YYYY-MM-DD). Leave empty to use the title's latest available version.

## `part` (type: `string`):

Limit to a single part, e.g. "1". Leave empty to scrape all parts of the title (larger).

## `chapter` (type: `string`):

Only include parts under this chapter identifier, e.g. "I".

## `subpart` (type: `string`):

Only include sections under this subpart identifier, e.g. "A".

## `maxResults` (type: `integer`):

Cap on number of sections returned.

## Actor input object example

```json
{
  "title": 14,
  "part": "1",
  "maxResults": 5000
}
```

# 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 = {
    "title": 14,
    "part": "1"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ponderable_hydrometer/ecfr-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 = {
    "title": 14,
    "part": "1",
}

# Run the Actor and wait for it to finish
run = client.actor("ponderable_hydrometer/ecfr-scraper").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 '{
  "title": 14,
  "part": "1"
}' |
apify call ponderable_hydrometer/ecfr-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/3FF4MECRiIFu8gf5o/builds/H9HpbZAckeeU0cGTV/openapi.json
