Client Package for the U.S. Federal Register API

Access data from the Federal Register API <>.

CRAN Version Downloads Build Status

This package provides access to the API for the United States Federal Register. The API provides access to all Federal Register contents since 1994, including Executive Orders by Presidents Clinton, Bush, and Obama and all "Public Inspection" Documents made available prior to publication in the Register. The API returns basic details about each entry in the Register and provides URLs for HTML, PDF, and plain text versions of the contents thereof, and the data are fully searchable. The federalregister package provides access to all version 1 API endpoints.

Installing the package

The package can be installed from GitHub:

if (!require('devtools')) {

Example Code

Below are some examples of possible uses of the package.

Contents of the Federal Register Over Time

One way to use federalregister is to retrieve details about the contents of the Federal Register over-time, perhaps Executive Orders by President.

## Loading required package: federalregister
clinton <- fr_search(presidential_document_type='executive_order', president='william-j-clinton', per_page=1000)
bush <- fr_search(presidential_document_type='executive_order', president='george-w-bush', per_page=1000)
obama <- fr_search(presidential_document_type='executive_order', president='barack-obama', per_page=1000)
# number of Executive Orders
c(clint=clinton$count, bush=bush$count, obama=obama$count)
## clint  bush obama 
##   308   295   240

Prevalence of Agency Mentions

Each Federal Registry entry includes data on agency mentions (i.e., what agencies the entry applies to). We can use this information to analyze which agencies are getting attention, even over time.

a <- c('barry-m-goldwater-scholarship-and-excellence-in-education-foundation',
out <- lapply(a, function(x) fr_search(agencies=x, fields='', per_page=1000)$results)
setNames(sapply(out, length), a)
## barry-m-goldwater-scholarship-and-excellence-in-education-foundation 
##                                                                   15 
##                                   assassination-records-review-board 
##                                                                  108 
##                                           arctic-research-commission 
##                                                                   64

Executive Orders, by President

One cool feature of the Federal Register API is the ability to retrieve Executive Orders. Constructing the necessary API request, for example, to retrieve all Executive Orders for 2013 from President Obama is a bit complicated:[correction]=0&conditions[president]=barack-obama&conditions[presidential_document_type_id]=2&conditions[publication_date][year]=2013&conditions[type]=PRESDOCU&fields[]=executive_order_number&fields[]=title&fields[]=publication_date&fields[]=signing_date&fields[]=citation&fields[]=document_number&fields[]=executive_order_notes&fields[]=html_url&fields[]=full_text_xml_url&fields[]=body_html_url&fields[]=json_url&order=executive_order_number&per_page=1000

Doing it using federalregister is quite a bit easier:

clinton <-  fr_search(presidential_document_type='executive_order', 
                      president='william-j-clinton', per_page=1000)
bush <-     fr_search(presidential_document_type='executive_order', 
                      president='george-w-bush', per_page=1000)
obama <-    fr_search(presidential_document_type='executive_order', 
                      president='barack-obama', per_page=1000)
# number of Executive Orders
c(clint=clinton$count, bush=bush$count, obama=obama$count)
## clint  bush obama 
##   308   295   240

Text-mining the Federal Register

The API returns metadata about entries in the Federal Register, including links to HTML, PDF, and plain text versions of entries in the Federal Register. Using federalregister to retrieve the plain text URLs, it is then possible to reconstruct the contents of the Register for use in, e.g., some kind of text mining analysis.

arecord <- fr_get('E9-1719')
full <- httr::content(httr::GET(arecord[[1]]$raw_text_url), "text", encoding = "UTF-8")
cat(substring(full, 1, 1000))
## Executive Order 13490 of January 21, 2009 
## Ethics Commitments by Executive Branch Personnel 
## By the authority vested in me as President by the Constitution and the laws of the United States of America, including section 301 of title 3, United States Code, and sections 3301 and 7301 of title 5, United States Code, it is hereby ordered as follows: 
## Section 1. 
## Ethics Pledge. Every appointee in every executive agency appointed on or after January 20, 2009, shall sign, and upon signing shall be contractually committed to, the following pledge upon becoming an appointee: 
## <U+0093>As a condition, and in consideration, of my employment in the United States Government in a position invested with the public trust, I commit myself to the following obligations, which I understand are binding on me and are enforceable under law: 
## <U+0093>1. Lobbyist Gift Ban . I will not accept gifts from registered lobbyists or lobbying organizations for the duration of my service as an appointee. 
## <U+0093>2. Revolving Door Ban<U+0097>All


CHANGES TO federalregister 0.2


  • Exposed ... (or, in two cases getopts) arguments to control behavior of HTTP requests.
  • Replaced use of RCurl with httr. (#2)
  • Replaced use of RJSONIO with jsonlite. (#2)


  • Fixed a bug related to class assignment for the output object in fr_agencies (#1, h/t Stephen Kaluzny)

CHANGES TO federalregister 0.1

  • First version released

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.2.0 by Thomas J. Leeper, 5 years ago

Report a bug at

Browse source code at

Authors: Thomas J. Leeper

Documentation:   PDF Manual  

Task views:

GPL-2 license

Imports httr, curl, jsonlite

See at CRAN