Skip to content
OSINTtools.io

GovInfo API

US Government Publishing Office site with official federal publications: laws, Congressional Record, Federal Register, CFR.

Base URL
https://api.govinfo.gov
Sign-in
API key
Free tier
Free tier
Pricing
Free
Format
REST
Endpoints
3

Compiled by OSINTtools.io editors from api.govinfo.gov · updated Nov 29, 2026Work on this API? Claim it to keep these docs currentReport a mistake

Introduction

The GovInfo API gives programmatic access to U.S. Government Publishing Office collections such as Congressional Bills, the Federal Register and court opinions, at the package and granule level, with links to download each document.

An investigator can list collections, find packages issued or modified in a date window, and fetch a package's summary with download links in several formats. Calls need an api.data.gov key in the api_key parameter; DEMO_KEY works for testing with lower limits. Large result sets are paged with offsetMark (start with *) and the nextPage value in each response.

The docs also describe a POST /search endpoint, related-document endpoints and granule endpoints; the README does not describe their response fields, so only three endpoints are written out here. Interactive docs are at https://api.govinfo.gov/docs.

Quick start

  1. Get a key

    Create an account with GovInfo and copy your api key (free tier). Where to get it

  2. Make your first request

    List collection codes with package and granule counts.. Replace YOUR_API_KEY and run it in a terminal, or use Try it on the endpoint.

    curl 'https://api.govinfo.gov/collections?api_key=YOUR_API_KEY'
  3. Read the response

    A 200 response looks like this.

    {
      "collections": [
        {
          "collectionCode": "EXAMPLE",
          "collectionName": "Example Collection",
          "packageCount": 100,
          "granuleCount": 500
        }
      ]
    }

Authentication

Send your API key in the api_key query parameter of every request.

Key from api.data.gov; DEMO_KEY has lower limits.

Get a key from GovInfo

Try it on this page keeps your key in your browser; it is never sent to OSINTtools.io.

Rate limits and pricing

36,000 requests per hour, 1,200 per minute, 40 per second (rolling window); X-RateLimit-Limit and X-RateLimit-Remaining headers are returned

Free tier. Pricing: free.

Errors

StatusMeaning
401API_KEY_MISSING: no API key was included
429Rate limit exceeded
503MODS or ZIP file is being generated; retry after the Retry-After value (typically 30 seconds)

Discovery

  • Passive: the target is not contacted

Returns the collections available through the API.

Response fields · 4Show

collectionCodestring

Collection code

collectionNamestring

Collection name

packageCountinteger

Number of packages

granuleCountinteger

Number of granules, where applicable

curl 'https://api.govinfo.gov/collections?api_key=YOUR_API_KEY'
Replace YOUR_API_KEY with your key
Response
{
  "collections": [
    {
      "collectionCode": "EXAMPLE",
      "collectionName": "Example Collection",
      "packageCount": 100,
      "granuleCount": 500
    }
  ]
}
  • Passive: the target is not contacted

Paginate with offsetMark, starting at * and then using the nextPage value from the response. An end date can be added as a second path segment.

Path parameters

dateIssuedStartDatestringrequired

Start of the issue date window

Example: 2026-01-01

Query parameters

offsetMarkstringrequired

Pagination mark; start with *

Example: *
pageSizeintegerrequired

Results per page

Example: 100
collectionstringrequired

Collection code

Example: EXAMPLE
docClassstring

Document class filter

Example: hr
congressstring

Congress number filter

Example: 119
modifiedSincestring

ISO 8601 date-time; only items modified since

Example: 2026-01-01T00:00:00Z
Response fields · 1Show

nextPagestring

URL supplying the offsetMark for the next page

curl 'https://api.govinfo.gov/published/2026-01-01?offsetMark=*&pageSize=100&collection=EXAMPLE&api_key=YOUR_API_KEY'
Replace YOUR_API_KEY with your key
Response
{
  "nextPage": "https://api.govinfo.gov/published/2026-01-01?offsetMark=EXAMPLE_MARK&pageSize=100&collection=EXAMPLE"
}

Retrieval

Metadata and download links for one package.

GET/packages/{packageId}/summary

  • Passive: the target is not contacted

Roughly the same information as the package details page. Content is also available at /packages/{packageId}/{format} for htm, xml, pdf, mods, premis and zip.

Path parameters

packageIdstringrequired

Package identifier

Example: EXAMPLE-PACKAGE-1
Response fields · 7Show

txtLinkstring

Text download link

xmlLinkstring

XML download link

pdfLinkstring

PDF download link

modsLinkstring

MODS download link

premisLinkstring

PREMIS download link

zipLinkstring

ZIP download link

billStatusLinkstring

Bill status link, for bills

curl 'https://api.govinfo.gov/packages/EXAMPLE-PACKAGE-1/summary?api_key=YOUR_API_KEY'
Replace YOUR_API_KEY with your key
Response
{
  "download": {
    "pdfLink": "https://api.govinfo.gov/packages/EXAMPLE-PACKAGE-1/pdf",
    "xmlLink": "https://api.govinfo.gov/packages/EXAMPLE-PACKAGE-1/xml"
  }
}