Skip to content
RAG Repo

The Electronic Code of Federal Regulations (eCFR) is a continuously updated edition of the Code of Federal Regulations, the codified, subject-organised rules issued by US federal departments and agencies. It covers all 50 titles, from agriculture to telecommunications, and unlike the official annual print edition it folds in amendments on a rolling basis, usually within a day or two of their publication in the Federal Register, so it tracks the regulations roughly as they stand today.

Best of all for a builder, eCFR publishes a full, well-documented API. You can pull the entire code, a single title, or one specific part and section, with the text exposed as `XML` alongside endpoints that describe the hierarchy and the amendment history. That granularity is a real gift: the regulations already arrive divided into titles, parts, sections, and paragraphs, which line up almost exactly with the chunks a RAG system retrieves, so you can keep the citation structure intact instead of trying to rebuild it from a flat wall of text.

All of this makes eCFR a solid backbone for a US regulatory or compliance assistant: answering questions about federal rules, tracing a requirement to its precise section, or keeping a knowledge base current as rules shift. Because you can fetch only the titles that matter to your domain, you avoid swallowing the whole code when you really need, say, just environmental or financial regulation.

Keep two things in mind. The eCFR is an editorial compilation for reference, not the official legal edition, so for anything with legal weight you should cross-check against the official CFR and the Federal Register. And because it changes continuously, you need a refresh plan: store the amendment dates and re-pull only the sections that moved, rather than assuming a single download stays accurate. On rights there is nothing to worry about, since as a work of the US Government the content is public domain and free to reuse for any purpose, commercial included.

Pair it with the Federal Register for proposed and final rule-making as it happens, and with GovInfo or the US Code when you need statutes rather than regulations.

usregulationspublic-domainapibulk-download

Related sources