# 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "eCFR Scraper — US Code of Federal Regulations",
        "description": "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.",
        "version": "0.1",
        "x-build-id": "H9HpbZAckeeU0cGTV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ponderable_hydrometer~ecfr-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ponderable_hydrometer-ecfr-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/ponderable_hydrometer~ecfr-scraper/runs": {
            "post": {
                "operationId": "runs-sync-ponderable_hydrometer-ecfr-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/ponderable_hydrometer~ecfr-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-ponderable_hydrometer-ecfr-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "title"
                ],
                "properties": {
                    "title": {
                        "title": "CFR Title number",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "CFR title to scrape (1–50), e.g. 14 for Aeronautics and Space."
                    },
                    "date": {
                        "title": "Version date",
                        "type": "string",
                        "description": "Snapshot date (YYYY-MM-DD). Leave empty to use the title's latest available version."
                    },
                    "part": {
                        "title": "Part (optional)",
                        "type": "string",
                        "description": "Limit to a single part, e.g. \"1\". Leave empty to scrape all parts of the title (larger)."
                    },
                    "chapter": {
                        "title": "Chapter filter (optional)",
                        "type": "string",
                        "description": "Only include parts under this chapter identifier, e.g. \"I\"."
                    },
                    "subpart": {
                        "title": "Subpart filter (optional)",
                        "type": "string",
                        "description": "Only include sections under this subpart identifier, e.g. \"A\"."
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Cap on number of sections returned.",
                        "default": 5000
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
