The Federal Register API (https://www.federalregister.gov/api/v1, no key): document search by agency, type, publication date, term, CFR title and part, and significance; documents by number; documents on public inspection; and the agencies list.

Search results page with a cursor. Follow next-page rather than counting page numbers, and use collect to gather several pages.

Every function takes an optional trailing opts Map. Search takes the conditions listed on search-params; all of them take base-url.

Context Vars

Optional
  • federal-register.base-url

Values

MAX_PER_PAGE

MAX_PER_PAGE: Int 1000

Functions

agencies

fn (): Vec<Map>
fn (opts: Map): Vec<Map>

Every agency, as a Vec of Maps with id, name, short_name, slug, parent_id and url. slug is what the agencies condition of search takes. An unknown slug is a 400 Err, not an empty result.

Example

fincen first(filter(::federal-register/agencies(), (a) { eq(a.slug, "financial-crimes-enforcement-network") }))

collect

fn (fetch: Fn, opts: Map, limit: Int): Vec

Follow pages of a search until limit documents or the last page. fetch takes opts and returns one page. opts.per-page defaults to the smaller of limit and 1000.

Example

docs ::federal-register/collect(::federal-register/search, {cfr-title: 31, cfr-part: 1010, order: "newest"}, 250)

get-document

fn (number: Str): Map?
fn (number: Str, opts: Map): Map?

One document by number, or null when there is none. opts.fields limits the fields returned.

Example

doc ::federal-register/get-document("2026-18194")
doc.title
doc.cfr_references

get-public-inspection

fn (number: Str): Map?
fn (number: Str, opts: Map): Map?

One public inspection document by number, or null when there is none.

Example

doc ::federal-register/get-public-inspection("2026-18194")
if(is-null(doc), "not on inspection", doc.title)

next-page

fn (page: Any): Str?

The next page of a search as a value for opts.after (pure), or null on the last page. It reads next_page_url, which holds the cursor, and keeps only the path and query, so requests stay on your base-url. An Err when next_page_url is set but has no /api/v1/ path to keep, so a collect can't end early and look complete.

Example

page ::federal-register/search({term: "\"beneficial ownership\"", per-page: 100})
more ::federal-register/search({after: ::federal-register/next-page(page)})

page-params

fn (opts: Map): Map

per_page (capped at 1000) and page from opts, omitted when unset (pure).

Example

::federal-register/page-params({per-page: 5000, page: 2})  // {per_page: 1000, page: 2}

public-inspection

fn (): Map
fn (opts: Map): Map

The documents on public inspection now, filed but not yet published. Returns {count, results, special_filings_updated_at, regular_filings_updated_at}. This list has no paging and no conditions; filter results in the caller.

Example

out ::federal-register/public-inspection()
fincen filter(out.results, (d) { ::hot::str/contains(Str(d.agency_names), "Financial Crimes") })
fn (): Map
fn (opts: Map): Map

Search documents. Returns the page: count, total_pages, description (the search in words), next_page_url and results. See search-params for the conditions.

opts.after takes a value from next-page and fetches that page, which already carries the conditions.

count stops at 10000, so a count of exactly 10000 means at least that many.

Example

page ::federal-register/search({
  agencies: "financial-crimes-enforcement-network",
  type: ["RULE", "PRORULE"],
  publication-date-gte: "2026-01-01",
  cfr-title: 31,
  cfr-part: 1010,
  order: "newest"
})
first(page.results).document_number

search-params

fn (opts: Map): Map

Query parameters for a document search (pure), from these opts:

  • term: full text; wrap a phrase in double quotes
  • type: "RULE", "PRORULE", "NOTICE", "PRESDOCU", or a Vec of them
  • agencies: an agency slug or a Vec of them (slug from agencies)
  • publication-date-gte, publication-date-lte, publication-date-is: YYYY-MM-DD
  • cfr-title, cfr-part: documents affecting that part of the CFR
  • significant: true for rules deemed significant under EO 12866
  • order: "relevance", "newest" or "oldest"
  • fields: a Vec of the fields to return
  • per-page, page

Example

params ::federal-register/search-params({type: "rule", agencies: "financial-crimes-enforcement-network", significant: true})
get(params, "conditions[type][]")         // ["RULE"]
get(params, "conditions[agencies][]")     // ["financial-crimes-enforcement-network"]
get(params, "conditions[significant]")    // "1"

significant-param

fn (v: Bool?): Str?

"1" for true, "0" for false, null when unset (pure).

Example

::federal-register/significant-param(true)   // "1"
::federal-register/significant-param(false)  // "0"
::federal-register/significant-param(null)   // null