Api
services to access GovInfo content and metadata
Install / Use
/learn @usgpo/ApiREADME
[!NOTE] The GovInfo Model Context Protocol (MCP) server is now available as a public preview. The server enables users to integrate the latest GovInfo information into their Large Language Model workflows. During the public preview, developers are encouraged to provide feedback for future enhancements. See MCP documentation for more information. Please provide feedback via an issue using the MCP label in this repository.
api
The GovInfo api is intended to provide data users with a simple means to programmatically access GovInfo content and metadata, which is stored in self-describing packages. This initial release provides functionality to retrieve lists of packages added or modified within a given time frame, summary metadata for packages, direct access to content and metadata formats, and equivalent granule information.
Interactive documentation using the OpenAPI/swagger specification is available at https://api.govinfo.gov/docs.
Table of Contents
- Keys
- Versioning
- Issues
- About the Data
- API Quickstart - sample requests
- Model Context Protocol
- Error Messages
Keys
This API requires the use of an API.data.gov key - signup here. If you already have one, go to the /docs page, click on Authorize, and enter your key. Then you can make all the requests normally.
You can send your API key in a few different ways. See api.data.gov for more information on key usage.
Information on rate limits can be found here. The rate limit is tracked on an rolling hourly basis. Here are the current default rate limits:
- 36,000 requests per hour (Primary Rate limit)
- 1,200 requests per minute
- 40 requests per second
Versioning
One of the API's design goals is to minimize breaking changes, but we are implementing versioning to allow users to specify the version required. We have not determined the number of versions that we plan to support at this time, but it will be based on usage and we will communicate with known users prior to deprecating any version.
If no version is specified in requests, the latest version of the api will be provided.
Issues
See Issues to submit an issue or comment on future development priorities.
See the labels below for additional information:
- Features - list of features that are currently under consideration by the govinfo team. Your feedback is welcome!
- Upcoming - list of features that are currently under development and will be available in an upcoming release. Once scheduled, they will be assigned to a milestone.
About the Data
Data available in the API represents official publications from all three branches of the Federal Government as made available on GPO's GovInfo. For more information about the data that's available from GovInfo, see our about page and learn what's available.
API Quickstart
This section is designed to help provide quick examples of how to use the GovInfo API. Generally, the endpoints of the API can be broken up into two main groupings:
Discovery endpoints
Use these endpoints to find content based on search, collection, official publish date, or relationships to other content on GovInfo.
Search Service
The Search Service allows for programmatic requests against the GovInfo search engine to return results similar to the results on the GovInfo user interface.
This requires a POST request. For easy examples, download Postman and import the Postman collection here
Here is a sample curl request to the Search Service
curl --location 'https://api.govinfo.gov/search' \
--data '{
"query":"collection:(USCOURTS) and naturesuit:(Securities, Commodities, Exchange) courttype:appellate",
"pageSize":"100",
"offsetMark":"*",
"sorts":[
{
"field":"score",
"sortOrder":"DESC"
}
]
}'
For an overview, see the Search Service Overview page on GovInfo.
Recommended sorts.field parameters
Currently, we are supporting the following fields for sorting - we will be making updates in the future to clarify this, but we do not plan on breaking the values listed below: | field | sortOrder options |UI Equivalent|Note| | ------------- | ------------- |------------- |------------- | | score | DESC |Relevance|relevance as determined by the search engine, use of ASC is not allowed| | publishdate | ASC,DESC |Date Old to New/New to Old|| | lastModified | ASC,DESC | N/A |sorts based on most recent add/update in GovInfo| | title | ASC,DESC| Alphabetical(Z-A)/Alphabetical(A-Z)| |
Collections Service
Base collections request
https://api.govinfo.gov/collections?api_key=DEMO_KEY
This request will provide a json list of the collections available within our system, including a collectionCode, collectionName, packageCount, and granuleCount (as applicable). All json response are returned in a minified format.
Collection update
The following request allows you to specify a collection and get a list of packageIds that have been added or modified within the specified time period. collectionCode and lastModifiedStartDate are required, as is pageSize. Optionally, you can include the lastModifiedEndDate. pageSize is limited to 1000 results.
For offsetMark, start with offsetMark=* - the API will respond with the correct offsetMark for the next page as part of the nextPage key.
lastModifiedStartDate/lastModifiedEndDate usage
lastModifiedStartDate and lastModifiedEndDate are parameters used to search against the lastModified value for the individual packages. This represents the time that this package was added or updated - equivalent to the value listed in the sitemaps. It is not the equivalent to Date Published, Date Issued, or Date Ingested in MODS.
Congressional Bills with lastModifiedStartDate only (BILLS)
https://api.govinfo.gov/collections/BILLS/2025-01-01T00:00:00Z/?offsetMark=*&pageSize=100&api_key=DEMO_KEY
Congressional Bills with lastModifiedEndDate
https://api.govinfo.gov/collections/BILLS/2025-07-03T00:00:00Z/2025-12-10T23:59:59Z?offsetMark=*&pageSize=150&api_key=DEMO_KEY
Congressional Record (CREC)
https://api.govinfo.gov/collections/CREC/2025-10-01T00:00:00Z?offsetMark=*&pageSize=10&api_key=DEMO_KEY
United States Court Opinions (USCOURTS)
https://api.govinfo.gov/collections/USCOURTS/2025-04-03T00:00:00Z?offsetMark=*&pageSize=25&api_key=DEMO_KEY
Published Service
This is similar to the collections service in that it provides users with an easy way to get a list of packages by date. The difference is that this service provides packages based on dateIssued -- this generally corresponds to the publication date of the content itself, rather than the GovInfo system update time for a publication.
Format
https:// api.govinfo.gov/published/dateIssuedStartDate/dateIssuedEndDate?offsetMark=startingRecord&pageSize=number of records in call&collection=comma-separated list of values&api_key=your api.data.gov api key
Examples
BILLS issued between January and July 2019: https://api.govinfo.gov/published/2019-01-01/2019-07-31?offsetMark=*&pageSize=100&collection=BILLS&api_key=DEMO_KEY
Federal Register and CFR packages in 2019: https://api.govinfo.gov/published/2019-01-01/2019-12-31?offset=*&pageSize=100&collection=CFR,FR&modifiedSince=2020-01-01T00:00:00&api_key=DEMO_KEY
Required parameters
dateIssuedStartDate: the earliest package you are requesting by dateIssued – YYYY-MM-DDoffsetMark: starting record. The initial request should always be*, and the API will provide the correct offsetMark value for the next page's information in thenextPagekey.- Note: offsetMark effectively replaces the
offsetparameter. The advantage of the theoffsetMarkis that it allows traversals of the results past the first 10,000 recors
- Note: offsetMark effectively replaces the
pageSize: number of records to return per request (e.g. 10)collection: comma-separated list of collections that you are requesting, e.g. https://api.govinfo.gov/published/2019-01-01/2019-12-31?offset=0&pageSize=100&collection=BILLS,BILLSTATUS&api_key=DEMO_KEY - see /collections for a list of collections by code and human-readable name.
O
Related Skills
gh-issues
345.4kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
oracle
345.4kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
tmux
345.4kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
xurl
345.4kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
Security Score
Audited on Mar 31, 2026
