
Federal Register
Open DataThe Daily Journal of the United States Government. One of the difficulties for anyone seeking to use government data is to match up datasets from various Federal sources. Identifiers such as field names and agency name references often are not identical. Federal Register data originates with the files used to produce the print and PDF editions. During the publication process these are transformed into bulk XML files made available by the Government Publishing Office (GPO). Additional MODS files that contain metadata about each document are also produced at the same time.
📚 Documentation & Examples
Everything you need to integrate with Federal Register
🚀 Quick Start Examples
// Federal Register API Example
const response = await fetch('https://www.federalregister.gov/reader-aids/developer-resources', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
An Overview of Federal Register Public API
The Federal Register Public API is a set of RESTful web services that provide access to data and tools from the Federal Register. The API currently has two end-points: Documents and Search. Each end-point provides various functionalities.
In this blog, we will take a deep dive into the Federal Register Public API and provide examples of how to consume the API using JavaScript.
JavaScript Examples for Federal Register Public API
Documents Endpoint
The Documents end-point provides access to search and retrieve information about individual documents. Here is an example of how to retrieve the document in JavaScript:
fetch('https://www.federalregister.gov/api/v1/documents/2019-24499')
.then((response) => response.json())
.then((data) => console.log(data))
This code will log the JSON data for the document with document number "2019-24499".
Search Endpoint
The Search end-point provides access to search and retrieve information about multiple documents based on specific criteria. Here is an example of how to search for documents related to "Environmental Protection Agency" in JavaScript:
const params = new URLSearchParams({
conditions: '[{"field":"agency","value":"environmental-protection-agency"}]',
order: 'oldest',
per_page: 10
})
fetch(`https://www.federalregister.gov/api/v1/documents.json?${params}`)
.then((response) => response.json())
.then((data) => console.log(data))
This code will log JSON data for the 10 oldest documents related to "Environmental Protection Agency".
Conclusion
In this blog post, we have provided an overview of the Federal Register Public API and examples of how to consume the API using JavaScript. As you can see, the API is straightforward to use, and it provides a great deal of information that can be used for research and analysis. We encourage you to explore the Federal Register Public API and see what interesting information you can uncover.
📊 30-Day Uptime History
Daily uptime tracking showing online vs offline minutes