/data/api/v1/code/ namespace. It does not replace or reshape the existing Criminal Law API.
Start here
API root
The root index lists available Code titles, their compact section manifests, and the already-published USLM XML source for each title.
data/api/v1/code/index.jsonOpen JSONLookup model
Finding a section
- Fetch
data/api/v1/code/index.jsonand select the title. - Fetch that title's manifest, for example
data/api/v1/code/titles/18/manifest.json. - Look up the desired section in
section_to_chunk. - Fetch that compact chunk and select the matching metadata object from its
sectionsarray. - If complete statutory text is needed, fetch the title manifest's
source_xmland locate the section by its exact USLMidentifier.
The API deliberately does not duplicate the entire statutory corpus in JSON. The authoritative USLM XML is already published by the site, so the compact API provides fast discovery and stable pointers while keeping one source of statutory text.
Section object
Fields
sectionCanonical section number.
citationFormatted U.S. Code citation.
identifierExact USLM section identifier used to locate complete text in the title's source_xml.
headingSection heading for discovery and display.
web_urlRelative deep link to the human-readable Code section.
Title manifest
Full-text source pointer
Every title manifest exposes source_xml and source_format: "USLM XML". A client that needs complete statutory language should fetch that file and locate the section whose identifier matches the API record.
Example
Browser JavaScript
const root = await fetch("https://nationalarchivesusar.github.io/us-code/data/api/v1/code/index.json").then(r => r.json());
const title = root.titles.find(item => item.title === "18");
const manifest = await fetch(`https://nationalarchivesusar.github.io/us-code/${title.manifest}`).then(r => r.json());
const chunkPath = manifest.section_to_chunk["1752"];
const chunk = await fetch(`https://nationalarchivesusar.github.io/us-code/${chunkPath}`).then(r => r.json());
const section = chunk.sections.find(item => item.section === "1752");
const sourceXml = `https://nationalarchivesusar.github.io/us-code/${manifest.source_xml}`;
console.log(section.identifier, sourceXml);
Versioning
Stability
v1 is the compatibility boundary. Additive fields may be introduced without changing the namespace; incompatible structural changes should use a new API version. The Code API reflects the currently published Code build.