govinfo_search_packages
Search GovInfo packages by collection code and modification date range. Retrieve official GPO publications with metadata and pagination support.
Instructions
Search GovInfo packages in a collection modified since a date (GPO-authoritative bulk publications; api.data.gov keyed). Input collection (uppercase code — validated against the live catalog; an unknown code ⇒ invalid_input listing valid codes, NEVER a misleading empty), startDate/endDate? (YYYY-MM-DD or ISO datetime; filters by lastModified — the record UPDATE date, NOT dateIssued — disclosed in _meta), pageSize? (1..1000, def 100), pageMark? (opaque cursor, def ''). Returns { collection, packages:[{ packageId, title, dateIssued, lastModified, docClass, congress, packageLink }] } + cursor _meta. HONESTY: totalAvailable = count (the EXACT real total, NOT the page size); GovInfo uses an OPAQUE cursor, so pagination.offset/nextOffset are null — continue by passing meta.nextCursor back as pageMark (hasMore:false / nextCursor:null = last page). The raw upstream nextPage URL is never surfaced (it embeds the key). Genuine-empty ⇒ complete:true/total:0; outage/4xx THROWS (never a fake empty). CFR/ECFR/FR collections carry a note routing to the ecfr/fed_register_* tools for point lookups.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endDate | No | Optional upper bound on lastModified (same format as startDate). | |
| pageMark | No | Opaque continuation cursor. Default "*" (first page). To page, pass back the previous response's _meta.nextCursor (NOT a numeric offset — GovInfo uses an opaque cursor). | |
| pageSize | No | Rows per page (upstream pageSize), 1..1000, default 100. | |
| startDate | Yes | Lower bound on lastModified (the record's last-update date, NOT dateIssued), YYYY-MM-DD (normalized to T00:00:00Z) or a full ISO datetime. e.g. '2024-01-01'. | |
| collection | Yes | GovInfo collection code (uppercase alpha), e.g. BILLS, PLAW, CREC, USCODE, CFR, FR, BUDGET, GAOREPORTS. Validated against the live /collections catalog — an unknown code returns invalid_input listing valid codes (never a misleading empty). Use govinfo_list_collections to discover codes. |