# eCFR Regulations Search — Full-Text Federal Regulations API (`compute-edge/ecfr-regulations-search-scraper`) Actor

Search the Electronic Code of Federal Regulations (eCFR) API to extract full-text regulation data with enriched citations, regulatory hierarchy, and LLM-ready excerpts. Filter by query term and result count.

- **URL**: https://apify.com/compute-edge/ecfr-regulations-search-scraper.md
- **Developed by:** [Compute Edge](https://apify.com/compute-edge) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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.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

## eCFR Regulations Search — Full-Text Federal Regulations API

### Overview

The **eCFR Regulations Search Actor** is a powerful tool for searching the Electronic Code of Federal Regulations (eCFR) — the official, up-to-date text of all federal regulations maintained by the U.S. Government Publishing Office (GPO). This actor searches the eCFR's public API, extracts full-text regulation data with enriched citations and regulatory hierarchy, and outputs LLM-ready excerpts perfect for compliance automation, regulatory research, and policy analysis.

**Who needs this?**
- **Compliance officers** — Track regulatory requirements across titles and parts
- **Regulatory affairs teams** — Monitor changes and new regulations in their industry
- **Lawyers & legal researchers** — Full-text search with context and citations
- **Policy analysts** — Research specific regulation areas with structured data
- **GRC platforms** — Embed regulation search into compliance workflows
- **AI/LLM applications** — Feed LLM-ready excerpts into RAG pipelines for regulatory intelligence

### Features

- **Full-text search** across all 50 titles of the Code of Federal Regulations
- **Enriched citations** — Automatically constructs hierarchical citations (e.g., "Title 6 → Chapter I → Part 158 → § 158.201")
- **LLM-ready excerpts** — HTML tags stripped, plain text output optimized for AI models
- **Regulatory hierarchy** — Returns complete structural context (title, chapter, part, subpart, section)
- **Relevance scoring** — Results ranked by relevance to your search
- **Effective dates** — Tracks when regulations became effective and when they were superseded
- **Direct links** — eCFR URLs for each regulation for quick access to full text
- **Pagination** — Handles large result sets automatically; configurable result limits

### Data Fields

| Field | Type | Description |
|-------|------|-------------|
| `citation` | string | Hierarchical citation (e.g., "Title 6 → Chapter I → Part 158 → § 158.201") |
| `type` | string | Regulation type: Section, Appendix, Interp, etc. |
| `excerptText` | string | Full-text excerpt with search terms highlighted (HTML tags removed, LLM-ready) |
| `score` | number | Relevance score from the eCFR search engine (higher = more relevant) |
| `starts_on` | date | Date the regulation became effective |
| `ends_on` | date | Date the regulation was superseded or removed (null if still active) |
| `ecfrUrl` | string | Direct link to the regulation on eCFR.gov |
| `searchQuery` | string | The search query used |
| `hierarchy` | object | Structured regulatory hierarchy (title, chapter, part, section, etc.) |
| `headings` | object | Human-readable headings for each hierarchy level |
| `fetchedAt` | datetime | ISO 8601 timestamp of when the data was retrieved |

### How to Use

#### Step 1: Configure Your Search

In the Apify console or your API call, provide:

```json
{
  "query": "data privacy",
  "maxResults": 200
}
````

**Parameters:**

- **`query`** (string, required): Your search term. Examples:
  - `"cybersecurity"` — Returns DHS, NIST, and other cybersecurity regulations
  - `"environmental protection"` — Returns EPA and other environmental regs
  - `"data privacy"` — Returns HIPAA, FCPA, FTC, and privacy-related rules
  - `"pharmaceutical"` — Returns FDA pharmaceutical regulations
  - `"financial disclosure"` — Returns SEC and financial disclosure rules

- **`maxResults`** (integer, default 200, min 1, max 10000): Maximum regulation records to return. The actor will paginate until this limit or the end of results.

#### Step 2: Run the Actor

Click **Start** in the Apify console, or use the API:

```bash
curl -X POST https://api.apify.com/v2/acts/{actorId}/runs \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "cybersecurity", "maxResults": 500}'
```

#### Step 3: Retrieve Results

Results are saved to the actor's default dataset. Access via:

- **Console**: View results directly in the Apify console
- **API**: `GET https://api.apify.com/v2/datasets/{datasetId}/items`
- **Download**: Export as JSON, CSV, or XML

### Example Output

```json
{
  "citation": "Title 6 → Chapter I → Part 158 → § 158.201",
  "type": "Section",
  "excerptText": "Cybersecurity is a matter of homeland security and one of the core missions of the Department. Cybersecurity responsibilities are vested in the Secretary and distributed throughout the Department with responsibilities relating to cybersecurity...",
  "score": 8.947,
  "starts_on": "2021-11-15",
  "ends_on": null,
  "ecfrUrl": "https://www.ecfr.gov/current/title-6/section-158.201",
  "searchQuery": "cybersecurity",
  "hierarchy": {
    "title": "6",
    "chapter": "I",
    "part": "158",
    "subpart": "B",
    "section": "158.201"
  },
  "headings": {
    "title": "Domestic Security",
    "chapter": "Department of Homeland Security, Office of the Secretary",
    "part": "Cybersecurity Talent Management System (CTMS)",
    "subpart": "DHS Cybersecurity Service",
    "section": "Cybersecurity mission."
  },
  "fetchedAt": "2025-06-12T14:32:18.542Z"
}
```

### Pricing

The **eCFR Regulations Search Actor** is priced at **$0.003 per result** in addition to Apify's compute unit costs.

**Pricing examples:**

- 200 results → $0.60 (plus compute)
- 500 results → $1.50 (plus compute)
- 2,000 results → $6.00 (plus compute)

Apify's compute units are typically $0.25–$0.50 per run depending on actor complexity and runtime. See [Apify pricing](https://apify.com/pricing) for details.

### FAQ

**Q: What is the eCFR?**
A: The Electronic Code of Federal Regulations (eCFR) is the official, regularly updated full-text repository of U.S. federal regulations maintained by the Government Publishing Office (GPO). It's the source of truth for all CFR titles (1-50).

**Q: How often is the eCFR updated?**
A: The eCFR is updated daily to reflect new regulations, amendments, and supersessions. This actor retrieves the latest version every run.

**Q: Can I search across all 50 titles?**
A: Yes! The eCFR API searches all titles by default. Your search term will return results from any title matching your query.

**Q: How accurate are the citations?**
A: Citations are auto-constructed from the eCFR's official hierarchy. The `hierarchy` and `headings` fields contain the raw structured data from the API, which is the authoritative source.

**Q: What if I get 0 results?**
A: Your search term didn't match any regulations in the eCFR. Try:

- Broader terms (e.g., `"financial"` instead of `"offshore derivative swap"`)
- Acronyms (e.g., `"HIPAA"` or `"FCPA"`)
- Agency names (e.g., `"EPA"` or `"FDA"`)

**Q: Can I use this data in a RAG or LLM pipeline?**
A: Yes! The `excerptText` field is stripped of HTML and optimized for AI models. The `citation` field provides precise regulatory context. Feed these into your LLM context for accurate compliance queries.

**Q: How large can my result set be?**
A: Up to 10,000 results per run. If you need more, run multiple searches with different query terms or use the API's built-in pagination.

**Q: Is there a rate limit?**
A: The eCFR API itself has no documented rate limits. The actor adds a 300ms delay between pages to be respectful.

**Q: What if a regulation is superseded?**
A: The `ends_on` field will show the date it was removed/superseded. The `ecfrUrl` will still link to the archive or note the supersession. Always check `ends_on` to identify inactive regulations.

### Use Cases

#### Compliance Monitoring

Search your industry's key terms ("healthcare", "HIPAA", "FDA approval") and monitor for new or updated regulations. Feed results into your GRC platform.

#### Regulatory Intelligence

Track regulatory changes by searching broad terms quarterly ("environmental", "financial reporting", "data protection") and analyzing trends.

#### Legal Research

Search for specific regulatory provisions (e.g., "electronic signatures", "good faith standard") with full-text context and precise citations.

#### Policy Analysis

Analyze how multiple regulations address the same issue (e.g., search "consumer privacy" across all titles) to understand fragmentation and overlap.

#### AI/LLM Integration

Feed `excerptText` + `citation` into a compliance chatbot or RAG system to provide users with accurate regulatory guidance.

### Legal Disclaimer

This actor retrieves publicly available U.S. government data from the Electronic Code of Federal Regulations (eCFR). All data is in the public domain. This tool is provided for informational purposes only and is not a substitute for legal or regulatory advice. Always verify critical compliance requirements with official sources and consult with qualified legal counsel. The accuracy and completeness of data depend on the eCFR's updates; this actor reflects the state of the eCFR at the time of execution.

### Support

For issues, feature requests, or data quality questions, contact the actor developer or open an issue in the Apify Actor documentation.

### Related Actors

- **[eCFR Agencies Scraper](https://console.apify.com/actors/...)** — Extract structured data about federal agencies from eCFR.
- **[CISA KEV Scraper](https://console.apify.com/actors/...)** — Track CISA's Known Exploited Vulnerabilities for compliance and security audits.
- **[Regulations.gov Scraper](https://console.apify.com/actors/...)** — Scrape proposed rules and public comments from Regulations.gov.

***

**Actor Version**: 0.1\
**Last Updated**: June 2025\
**Data Source**: Electronic Code of Federal Regulations (eCFR) API\
**Maintained By**: seatsignal

# Actor input Schema

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

Full-text search term to query the eCFR database. Examples: 'cybersecurity', 'environmental protection', 'data privacy'.

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

Maximum number of regulation records to return. Set between 1 and 10000.

## Actor input object example

```json
{
  "query": "cybersecurity",
  "maxResults": 200
}
```

# Actor output Schema

## `dataset` (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 = {
    "query": "cybersecurity"
};

// Run the Actor and wait for it to finish
const run = await client.actor("compute-edge/ecfr-regulations-search-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 = { "query": "cybersecurity" }

# Run the Actor and wait for it to finish
run = client.actor("compute-edge/ecfr-regulations-search-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 '{
  "query": "cybersecurity"
}' |
apify call compute-edge/ecfr-regulations-search-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "eCFR Regulations Search — Full-Text Federal Regulations API",
        "description": "Search the Electronic Code of Federal Regulations (eCFR) API to extract full-text regulation data with enriched citations, regulatory hierarchy, and LLM-ready excerpts. Filter by query term and result count.",
        "version": "0.1",
        "x-build-id": "BbAAiKZ1dpWWsVfqU"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/compute-edge~ecfr-regulations-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-compute-edge-ecfr-regulations-search-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/compute-edge~ecfr-regulations-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-compute-edge-ecfr-regulations-search-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/compute-edge~ecfr-regulations-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-compute-edge-ecfr-regulations-search-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": {
                    "query": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Full-text search term to query the eCFR database. Examples: 'cybersecurity', 'environmental protection', 'data privacy'.",
                        "default": "cybersecurity"
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of regulation records to return. Set between 1 and 10000.",
                        "default": 200
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
