Find an API

Search public APIs with auth details & Postman guides

← All APIs

GovInfo API (US Congress & Federal Register)

govinfo.gov · Government

Government API Key Free & Open Government Legal & Compliance Government Legal Open Data

Access official US government publications including Congressional bills, the Federal Register, the Code of Federal Regulations (CFR), Supreme Court decisions, and the US Code. Essential for regulatory compliance and legal research.

Authentication

API Key Free API key from api.govinfo.gov. Required on all requests.

Parameter name: api_key (in query)

Sample Requests

GET Search Federal Register by keyword

Full-text search across all GovInfo collections. Returns matching documents with links to full text.

https://api.govinfo.gov/search?query=workers compensation&api_key=YOUR_API_KEY&pageSize=10&collections=FR

Hover any highlighted part to learn what it does

curl -X GET "https://api.govinfo.gov/search?query=workers%20compensation&api_key=YOUR_API_KEY&pageSize=10&collections=FR"
import requests
params = {
    "query": "workers compensation",
    "api_key": "YOUR_API_KEY",
    "pageSize": "10",
    "collections": "FR"
}
response = requests.get(
    "https://api.govinfo.gov/search",
    params=params,
)
print(response.json())
const url = new URL('https://api.govinfo.gov/search');
url.searchParams.set('query', 'workers compensation');
url.searchParams.set('api_key', 'YOUR_API_KEY');
url.searchParams.set('pageSize', '10');
url.searchParams.set('collections', 'FR');

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	baseURL, _ := url.Parse("https://api.govinfo.gov/search")
	q := baseURL.Query()
	q.Set("query", "workers compensation")
	q.Set("api_key", "YOUR_API_KEY")
	q.Set("pageSize", "10")
	q.Set("collections", "FR")
	baseURL.RawQuery = q.Encode()
	targetURL := baseURL.String()
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.govinfo.gov/search")
uri.query = URI.encode_www_form({
  "query" => "workers compensation",
  "api_key" => "YOUR_API_KEY",
  "pageSize" => "10",
  "collections" => "FR"
})

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.govinfo.gov/search?" . http_build_query([
    "query" => "workers compensation",
    "api_key" => "YOUR_API_KEY",
    "pageSize" => "10",
    "collections" => "FR"
]);
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET Get Code of Federal Regulations section

Returns metadata for CFR Title 29 (Labor), Volume 8. Contains OSHA regulations and workers comp-related federal rules.

https://api.govinfo.gov/packages/CFR-2023-title29-vol8/summary?api_key=YOUR_API_KEY

Hover any highlighted part to learn what it does

curl -X GET "https://api.govinfo.gov/packages/CFR-2023-title29-vol8/summary?api_key=YOUR_API_KEY"
import requests
params = {
    "api_key": "YOUR_API_KEY"
}
response = requests.get(
    "https://api.govinfo.gov/packages/CFR-2023-title29-vol8/summary",
    params=params,
)
print(response.json())
const url = new URL('https://api.govinfo.gov/packages/CFR-2023-title29-vol8/summary');
url.searchParams.set('api_key', 'YOUR_API_KEY');

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	baseURL, _ := url.Parse("https://api.govinfo.gov/packages/CFR-2023-title29-vol8/summary")
	q := baseURL.Query()
	q.Set("api_key", "YOUR_API_KEY")
	baseURL.RawQuery = q.Encode()
	targetURL := baseURL.String()
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.govinfo.gov/packages/CFR-2023-title29-vol8/summary")
uri.query = URI.encode_www_form({
  "api_key" => "YOUR_API_KEY"
})

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.govinfo.gov/packages/CFR-2023-title29-vol8/summary?" . http_build_query([
    "api_key" => "YOUR_API_KEY"
]);
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));

Postman Setup Guide

Get Postman ↗
  1. Get a free API key at https://api.govinfo.gov/docs/
  2. Browse collections: FR (Federal Register), CFR (Code of Fed Regulations), BILLS (Congress), USCOURTS
  3. GET https://api.govinfo.gov/search?query={keyword}&collections={COLLECTION}&api_key=YOUR_KEY
  4. Each result includes a packageLink — follow it to get the full document details
  5. For CFR: packages are named CFR-{year}-title{N}-vol{N}
  6. Workers comp federal rules are in CFR Title 20 (Employee Benefits) and Title 29 (Labor)

What can you build with GovInfo API (US Congress & Federal Register)?

GovInfo API (US Congress & Federal Register) is a Government API. Developers commonly use government APIs for:

  • surfacing public datasets in citizen-facing apps
  • building transparency and civic engagement tools
  • accessing legislation, court records, and official data
  • powering research and journalism tools
  • creating compliance and regulatory monitoring dashboards

API Key authentication. You'll receive a key after signing up. Send it with every request — in a header or query parameter. Keep it out of client-side code and never commit it to version control. GovInfo API (US Congress & Federal Register) is free to use, making it a low-risk choice to experiment with.

New to APIs? Read our beginner's guide · Learn about API keys · What is REST?

Open documentation ↗