# eCFR US Federal Regulations Scraper (`parseforge/ecfr-code-federal-regulations-scraper`) Actor

Scrape the US Code of Federal Regulations from eCFR public API. Get title structure, chapters, parts, sections, amendment history, full regulation text. No API key required.

- **URL**: https://apify.com/parseforge/ecfr-code-federal-regulations-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $32.40 / 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 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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

![ParseForge Banner](https://raw.githubusercontent.com/ParseForge/apify-assets/main/parseforge-banner.png)

## ⚖️ eCFR US Federal Regulations Scraper

> 🚀 **Search and export the US Code of Federal Regulations in seconds.** Run full-text queries across every title, chapter, part, and section. No API key, no registration, no manual CSV wrangling.

> 🕒 **Last updated:** 2026-05-12 · **📊 Up to 28 fields** per record · **🇺🇸 50 CFR titles** · **📚 Full-text search across all parts** · **♻️ Live per run**

The **eCFR US Federal Regulations Scraper** pulls structured records from the Electronic Code of Federal Regulations, the official up-to-date version of US federal regulations published by the National Archives. The Actor supports two modes: **full-text search** across every regulation (returning matching sections with hierarchy, excerpts, scores, and effective dates) and **titles browse** (returning the 50 CFR titles with their latest amendment metadata).

eCFR is updated continuously as agencies publish final rules in the Federal Register, with currency stamps showing how recent the published text is for each title. Whether you are tracking regulatory references in privacy law, federal acquisition rules, food and drug regulations, or environmental policy, this Actor returns the official text in clean JSON without browser automation or login workflows.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Compliance and legal teams, policy analysts, RegTech vendors, government affairs, academics, journalists, GovTech vendors, ML researchers | Regulatory monitoring, compliance crosswalks, citation extraction, RegTech datasets, policy research, training data for legal AI |

---

### 📋 What the eCFR US Federal Regulations Scraper does

Two modes in a single Actor:

- 🔍 **Search mode.** Full-text search across every CFR title with hit scoring, hierarchy, and excerpts.
- 📚 **Titles mode.** Browse the 50 CFR titles with their latest amendment dates and currency stamps.
- 🪜 **Full hierarchy.** Every search hit includes title, subtitle, chapter, subchapter, part, subpart, subject group, and section.
- 📅 **Effective dates.** `startsOn` and `endsOn` per hit, plus title-level `latestAmendedOn` and `upToDateAsOf`.
- 🏷️ **Change types.** Each hit lists the change types that produced it (`effective`, `initial`, `amended`, etc.).

In search mode, each record includes the type (section, part, appendix), heading hierarchy, structured URL, hit excerpt, score, structure index, reserved and removed flags, and effective dates. In titles mode, each record includes the title number, name, latest amendment date, latest issue date, currency stamp, and reserved flag.

> 💡 **Why it matters:** the CFR runs to over 200,000 pages. Searching for regulatory references manually is slow, and bulk PDF dumps go stale. eCFR is the daily authoritative version, but its API output requires custom parsing. This Actor flattens search results and title metadata into query-ready tables on every run.

---

### 🎬 Full Demo

_🚧 Coming soon: a 3-minute walkthrough showing how to go from sign-up to a downloaded dataset._

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td><code>mode</code></td><td>string</td><td><code>"search"</code></td><td>Either <code>search</code> (full-text) or <code>titles</code> (browse the 50 CFR titles).</td></tr>
<tr><td><code>query</code></td><td>string</td><td><code>"privacy"</code></td><td>Free-text query. Required in search mode, ignored in titles mode.</td></tr>
<tr><td><code>maxItems</code></td><td>integer</td><td><code>10</code></td><td>Records to return. Free plan caps at 10, paid plan at 1,000,000.</td></tr>
</tbody>
</table>

**Example: 100 sections mentioning privacy.**

```json
{
    "mode": "search",
    "query": "privacy",
    "maxItems": 100
}
````

**Example: browse all CFR titles.**

```json
{
    "mode": "titles",
    "maxItems": 50
}
```

> ⚠️ **Good to Know:** the search endpoint returns hierarchy headings as HTML, which the Actor strips to plain text. The `excerpt` field highlights matched passages around the query terms. Search hits include sections, parts, appendices, and subtitles, distinguished by the `type` field.

***

### 📊 Output

Each search hit contains **28 fields**, each title record contains **9 fields**. Download the dataset as CSV, Excel, JSON, or XML.

#### 🧾 Schema (search mode)

| Field | Type | Example |
|---|---|---|
| 🏷️ `mode` | string | `"search"` |
| 🗂️ `type` | string | `"Section"` |
| 📚 `title` | string | null | `"Domestic Security"` |
| 📚 `subtitle` | string | null | `""` |
| 📚 `chapter` | string | null | `"Privacy and Civil Liberties Oversight Board"` |
| 📚 `subchapter` | string | null | `""` |
| 📚 `part` | string | null | `"Implementation of the Privacy Act of 1974"` |
| 📚 `subpart` | string | null | `""` |
| 📚 `subjectGroup` | string | null | `""` |
| 📚 `section` | string | null | `"Privacy Act requests."` |
| 📚 `appendix` | string | null | `""` |
| 🔗 `url` | string | `"https://www.ecfr.gov/current/title-6/chapter-X/part-1002/section-1002.3"` |
| 🔢 `titleNum` | string | null | `"6"` |
| 🔢 `chapterNum` | string | null | `"X"` |
| 🔢 `partNum` | string | null | `"1002"` |
| 🔢 `subpartNum` | string | null | `null` |
| 🔢 `sectionNum` | string | null | `"1002.3"` |
| 📰 `sectionHeading` | string | null | `"Privacy Act requests."` |
| 📰 `partHeading` | string | null | `"Implementation of the Privacy Act of 1974"` |
| 💬 `excerpt` | string | `"request to the Privacy Act Officer..."` |
| 📅 `startsOn` | ISO 8601 | null | `"2016-12-22"` |
| 📅 `endsOn` | ISO 8601 | null | `null` |
| 💯 `score` | number | null | `33.469017` |
| 🔢 `structureIndex` | number | null | `10415` |
| 🔒 `reserved` | boolean | null | `false` |
| 🗑️ `removed` | boolean | null | `false` |
| 🏷️ `changeTypes` | string\[] | `["effective", "initial"]` |
| 🕒 `scrapedAt` | ISO 8601 | `"2026-05-12T16:30:12.756Z"` |

#### 🧾 Schema (titles mode)

| Field | Type | Example |
|---|---|---|
| 🏷️ `mode` | string | `"titles"` |
| 🔢 `number` | number | `1` |
| 📰 `name` | string | `"General Provisions"` |
| 🔗 `url` | string | `"https://www.ecfr.gov/current/title-1"` |
| 📅 `latestAmendedOn` | ISO 8601 | null | `"2026-04-30"` |
| 📅 `latestIssueDate` | ISO 8601 | null | `"2026-04-30"` |
| 📅 `upToDateAsOf` | ISO 8601 | null | `"2026-05-08"` |
| 🔒 `reserved` | boolean | `false` |
| 🕒 `scrapedAt` | ISO 8601 | `"2026-05-12T16:30:12.756Z"` |

#### 📦 Sample records

<details>
<summary><strong>⚖️ Federal Acquisition Regulation section: Privacy training (48 CFR 24.301)</strong></summary>

```json
{
    "mode": "search",
    "type": "Section",
    "title": "Federal Acquisition Regulations System",
    "chapter": "Federal Acquisition Regulation",
    "subchapter": "Socioeconomic Programs",
    "part": "Protection of Privacy and Freedom of Information",
    "subpart": "Privacy Training",
    "section": "Privacy training.",
    "url": "https://www.ecfr.gov/current/title-48/chapter-1/part-24/subpart-24.3/section-24.301",
    "titleNum": "48",
    "chapterNum": "1",
    "partNum": "24",
    "subpartNum": "24.3",
    "sectionNum": "24.301",
    "sectionHeading": "Privacy training.",
    "partHeading": "Protection of Privacy and Freedom of Information",
    "excerpt": "for ensuring that initial privacy training, and annual privacy training thereafter, is completed... the privacy training shall cover... The provisions of the Privacy Act of 1974",
    "startsOn": "2017-01-19",
    "score": 33.62094,
    "structureIndex": 11397,
    "reserved": false,
    "removed": false,
    "changeTypes": ["effective", "initial"],
    "scrapedAt": "2026-05-12T16:30:12.756Z"
}
```

</details>

<details>
<summary><strong>⚖️ PCLOB Privacy Act requests (6 CFR 1002.3)</strong></summary>

```json
{
    "mode": "search",
    "type": "Section",
    "title": "Domestic Security",
    "chapter": "Privacy and Civil Liberties Oversight Board",
    "part": "Implementation of the Privacy Act of 1974",
    "section": "Privacy Act requests.",
    "url": "https://www.ecfr.gov/current/title-6/chapter-X/part-1002/section-1002.3",
    "titleNum": "6",
    "chapterNum": "X",
    "partNum": "1002",
    "sectionNum": "1002.3",
    "sectionHeading": "Privacy Act requests.",
    "partHeading": "Implementation of the Privacy Act of 1974",
    "excerpt": "request to the Privacy Act Officer. Written requests may be sent to: Privacy Act Officer... Privacy and Civil Liberties Oversight Board, 2100 K Street NW., Suite 500, Washington",
    "startsOn": "2016-12-22",
    "score": 33.469017,
    "structureIndex": 10415,
    "reserved": false,
    "removed": false,
    "changeTypes": ["effective", "initial"],
    "scrapedAt": "2026-05-12T16:30:12.756Z"
}
```

</details>

<details>
<summary><strong>⚖️ PCLOB Responses to Privacy Act requests (6 CFR 1002.4)</strong></summary>

```json
{
    "mode": "search",
    "type": "Section",
    "title": "Domestic Security",
    "chapter": "Privacy and Civil Liberties Oversight Board",
    "part": "Implementation of the Privacy Act of 1974",
    "section": "Responses to Privacy Act requests.",
    "url": "https://www.ecfr.gov/current/title-6/chapter-X/part-1002/section-1002.4",
    "titleNum": "6",
    "chapterNum": "X",
    "partNum": "1002",
    "sectionNum": "1002.4",
    "sectionHeading": "Responses to Privacy Act requests.",
    "excerpt": "(a) Acknowledgement. The Privacy Act Officer shall provide you with a written acknowledgment... If you make your request in person, the Privacy Act Officer shall respond to your request",
    "startsOn": "2016-12-22",
    "score": 33.13851,
    "structureIndex": 10416,
    "reserved": false,
    "removed": false,
    "changeTypes": ["effective", "initial"],
    "scrapedAt": "2026-05-12T16:30:12.756Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 🇺🇸 | **Official eCFR feed.** Pulls from the National Archives' Electronic Code of Federal Regulations, the up-to-date authoritative version. |
| 🪜 | **Full hierarchy.** Title, subtitle, chapter, subchapter, part, subpart, subject group, and section per hit. |
| 📚 | **Two modes.** Search returns matching sections with excerpts and scores. Titles mode lists every CFR title with amendment metadata. |
| 📅 | **Effective dates.** `startsOn`, `endsOn`, and title-level currency stamps tell you exactly how fresh each rule is. |
| ⚡ | **Fast.** Up to 100 search hits per page, 10,000 records in around fifteen minutes. |
| 🔁 | **Always fresh.** Every run pulls live eCFR data so newly published rules appear within hours. |
| 🚫 | **No authentication.** Works with public regulatory data. No login or API key needed. |

> 📊 The CFR is the codified body of US federal regulations, organised by subject across 50 titles. eCFR is the daily authoritative version.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| **⭐ eCFR US Federal Regulations Scraper** *(this Actor)* | $5 free credit, then pay-per-use | **All 50 CFR titles** | **Live per run** | full-text query | ⚡ 2 min |
| Official eCFR search UI | Free | Same data, manual | Live | UI filters | 🐢 Manual export per query |
| Government Publishing Office bulk dumps | Free | Annual snapshot | Yearly | None | 🕒 Multi-day ETL |
| Paid regulatory intelligence platforms | $1,000+/month | Multi-jurisdiction | Daily | Many | ⏳ Vendor onboarding |

Pick this Actor when you want the live CFR in clean JSON, with server-side full-text search and zero pipeline maintenance.

***

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the eCFR US Federal Regulations Scraper page on the Apify Store.
3. 🎯 **Set input.** Pick `search` or `titles` mode, enter a query if searching, and set `maxItems`.
4. 🚀 **Run it.** Click **Start** and let the Actor collect your data.
5. 📥 **Download.** Grab your results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to downloaded dataset: **3-5 minutes.** No coding required.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### ⚖️ Compliance & Legal

- Track CFR references in your compliance manuals
- Build internal regulatory crosswalks across agencies
- Audit which sections of CFR apply to your operations
- Spot newly effective rules in your jurisdiction

</td>
<td width="50%" valign="top">

#### 🏛️ Government Affairs & Policy

- Monitor regulatory changes by agency
- Quantify rulemaking activity per title over time
- Brief leadership on incoming federal rules
- Map rule changes to legislative initiatives

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### 🧠 RegTech & Legal AI

- Train and fine-tune legal LLMs on CFR text
- Build citation extractors and validators
- Power regulatory chatbots with grounded references
- Create searchable in-product compliance views

</td>
<td width="50%" valign="top">

#### 📰 Journalism & Research

- Investigate specific rules and amendment histories
- Compare regulatory texts before and after reform
- Cite specific sections and effective dates in stories
- Academic studies of US regulatory growth and reform

</td>
</tr>
</table>

***

### 🌟 Beyond business use cases

Data like this powers more than commercial workflows. The same structured records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Empirical datasets for papers, thesis work, and coursework
- Longitudinal studies tracking changes across snapshots
- Reproducible research with cited, versioned data pulls
- Classroom exercises on data analysis and ethical scraping

</td>
<td width="50%">

#### 🎨 Personal and creative

- Side projects, portfolio demos, and indie app launches
- Data visualizations, dashboards, and infographics
- Content research for bloggers, YouTubers, and podcasters
- Hobbyist collections and personal trackers

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Transparency reporting and accountability projects
- Advocacy campaigns backed by public-interest data
- Community-run databases for local issues
- Investigative journalism on public records

</td>
<td width="50%">

#### 🧪 Experimentation

- Prototype AI and machine-learning pipelines with real data
- Validate product-market hypotheses before engineering spend
- Train small domain-specific models on niche corpora
- Test dashboard concepts with live input

</td>
</tr>
</table>

***

### 🔌 Automating eCFR US Federal Regulations Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify API documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. Hourly, daily, or weekly refreshes keep downstream databases in sync automatically.

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

Pick a mode, optionally provide a search query, click Start, and the Actor calls the official eCFR JSON API, flattens hierarchy headings, strips HTML, and emits clean JSON. No browser automation, no captchas, no setup.

#### 📏 How accurate is the data?

Records come straight from the official National Archives eCFR, which is the daily authoritative version of US federal regulations. Effective dates are sourced from the Federal Register and reflected in `startsOn`, `endsOn`, and `upToDateAsOf` per record.

#### 🔁 How often is the dataset refreshed?

eCFR is updated continuously as agencies publish final rules in the Federal Register. Every run of this Actor fetches the live API, so your dataset reflects the same currency stamps the official site shows.

#### 📚 Can I get the full regulation text per section?

Search mode returns excerpts around matched terms, not the full body text. For full section text, follow the `url` field per record to the official eCFR rendering. A bulk full-text companion is on the roadmap.

#### ⏰ Can I schedule regular runs?

Yes. Use Apify Schedules to run this Actor on any cron interval (hourly, daily, weekly) and keep a downstream database in sync.

#### ⚖️ Is this data legal to use?

eCFR is a US government publication and is in the public domain. It is intended for unrestricted public use, including for commercial purposes.

#### 💼 Can I use this data commercially?

Yes. US federal regulations are in the public domain. Many RegTech, legal AI, and compliance products are built on this same feed.

#### 💳 Do I need a paid Apify plan to use this Actor?

No. The free Apify plan is enough for testing and small runs (10 records per run). A paid plan lifts the limit and gives you access to scheduling, higher concurrency, and larger datasets.

#### 🔁 What happens if a run fails or gets interrupted?

Apify automatically retries transient errors. If a run still fails, you can inspect the log in the Runs tab, fix the input, and re-run. Partial datasets from failed runs are preserved so you never lose progress.

#### 🔢 What is `structureIndex`?

A stable position pointer within the CFR structure that the eCFR API uses to order hits. It is useful for joining results against the structured CFR XML and tracking position changes over time.

#### 🆘 What if I need help?

Our support team is here to help. Contact us through the Apify platform or use the Tally form linked below.

***

### 🔌 Integrate with any app

eCFR US Federal Regulations Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Get run notifications in your channels
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Pipe regulatory data into your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits and releases
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets straight to Sheets

You can also use webhooks to trigger downstream actions when a run finishes. Push fresh regulation data into your compliance system, or alert your legal team in Slack when target sections change.

***

### 🔗 Recommended Actors

- [**📄 SEC EDGAR Full-Text Search Scraper**](https://apify.com/parseforge/sec-edgar-full-text-search-scraper) - US securities filings full text
- [**📜 UK Contracts Finder Scraper**](https://apify.com/parseforge/uk-contracts-finder-scraper) - UK public sector procurement notices
- [**🇪🇺 CORDIS EU Research Projects Scraper**](https://apify.com/parseforge/cordis-eu-research-scraper) - Horizon Europe and Framework Programme grants
- [**🔬 UKRI Gateway to Research Scraper**](https://apify.com/parseforge/ukri-gateway-to-research-scraper) - UK research council grants and projects
- [**🇫🇮 Finland YTJ Companies Scraper**](https://apify.com/parseforge/finland-ytj-companies-scraper) - Finnish business registry with 1M+ companies

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more reference-data scrapers.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by the National Archives, the Government Publishing Office, or any US government body. All trademarks mentioned are the property of their respective owners. Only publicly available public-domain regulatory data is collected.

# Actor input Schema

## `mode` (type: `string`):

What to scrape

## `query` (type: `string`):

Free-text search across all regulations

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## Actor input object example

```json
{
  "mode": "search",
  "query": "privacy",
  "maxItems": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

Overview of scraped data

## `fullData` (type: `string`):

Complete dataset

# 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 = {
    "mode": "search",
    "query": "privacy",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/ecfr-code-federal-regulations-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 = {
    "mode": "search",
    "query": "privacy",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/ecfr-code-federal-regulations-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 '{
  "mode": "search",
  "query": "privacy",
  "maxItems": 10
}' |
apify call parseforge/ecfr-code-federal-regulations-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "eCFR US Federal Regulations Scraper",
        "description": "Scrape the US Code of Federal Regulations from eCFR public API. Get title structure, chapters, parts, sections, amendment history, full regulation text. No API key required.",
        "version": "0.0",
        "x-build-id": "nV0VVg2P3NJ0khYLr"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~ecfr-code-federal-regulations-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-ecfr-code-federal-regulations-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/parseforge~ecfr-code-federal-regulations-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-ecfr-code-federal-regulations-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/parseforge~ecfr-code-federal-regulations-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-ecfr-code-federal-regulations-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",
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "search",
                            "titles"
                        ],
                        "type": "string",
                        "description": "What to scrape",
                        "default": "search"
                    },
                    "query": {
                        "title": "Search query (for search mode)",
                        "type": "string",
                        "description": "Free-text search across all regulations"
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
