Developer Utility

United States Code API

A compact, versioned JSON index for the general Code, published separately from the established Criminal Law API.

Compatibility guarantee: This general API uses its own /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 JSON

Lookup model

Finding a section

  1. Fetch data/api/v1/code/index.json and select the title.
  2. Fetch that title's manifest, for example data/api/v1/code/titles/18/manifest.json.
  3. Look up the desired section in section_to_chunk.
  4. Fetch that compact chunk and select the matching metadata object from its sections array.
  5. If complete statutory text is needed, fetch the title manifest's source_xml and locate the section by its exact USLM identifier.

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.