Search LOC Collections
libofcongress_searchSearch the Library of Congress digital collections by keyword. Optionally filter by material format (photos, maps, newspapers, audio, etc.), date range, subject heading, or geographic location, or scope the search to a single curated collection with collection_slug. Returns item summaries with titles, dates, descriptions, LOC IDs, and format tags. Each result carries is_item: pass the id of a result where is_item is true to libofcongress_get_item for full metadata; results where is_item is false are non-item resources (collections, exhibit and research-guide pages, newspaper-page results) with no item record — open their url instead. Use libofcongress_search_subjects first to find the exact LCSH heading spelling before applying a subject filter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | 1-indexed page number for paginating results. | |
| limit | No | Results per page. Default 25, max 100. | |
| query | Yes | Full-text search across metadata and available descriptive text. | |
| format | No | Material type filter. Options: photo, map, newspaper, manuscript, audio, film, book, notated-music. Omit to search all formats. | |
| subject | No | Subject heading filter. Use the exact label from libofcongress_search_subjects results for best precision. Example: "World War, 1939-1945". | |
| date_end | No | End year for date filter, inclusive (e.g., 1930). Omit for no upper bound. | |
| location | No | Geographic location filter (e.g., "oklahoma", "washington d.c."). Lowercase, matches LOC location facets. | |
| date_start | No | Start year for date filter, inclusive (e.g., 1920). Omit for no lower bound. | |
| collection_slug | No | Scope the search to one curated collection. Use a slug exactly as returned by libofcongress_browse_collections (e.g., "aaron-copland") — slugs are not derivable from the collection title. Cannot be combined with format; omit format and read each result's format field instead. Omit to search all of LOC. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Current 1-indexed page number. | |
| error | No | Present when the call failed. Absent on success. | |
| items | No | Item summaries matching the search query and filters. | |
| pages | No | Total retrievable pages. For result sets larger than LOC will page through (~100,000 items) this is capped, and a notice discloses how to reach the rest (partition by date/subject/location). | |
| total | No | Total number of matching items across all pages. | |
| notice | No | Recovery hint when results are empty or a page is out of range — echoes applied filters and suggests how to broaden. Absent on successful result pages. | |
| has_next | No | True when a retrievable next page follows this one. Never promises a page past LOC's ~100,000-item retrieval ceiling. | |
| totalCount | No | Total matching items across all pages — mirrors output.total for agent reasoning. | |
| effectiveQuery | No | The query as submitted to the LOC API, after trimming. | |
| effectiveCollectionSlug | No | The collection the search was scoped to, after trimming. Absent when the search covered all of LOC. |