Library of Congress Search is a no-code web scraper that collects public open data data: title, date, contributors, subjects and original format and more. Enter search terms, search in and digital collection, start a run and download the results as Excel, CSV or JSON. It costs 1 credit per run plus 0.03 credits per result, so 100 results cost about 4 credits.
Category: Open data · Price: 1 credits per run + 0.03 per result.
Library of Congress Search
Search the Library of Congress's digital collections at loc.gov: photographs and prints, maps, books, manuscripts, recordings, films and sheet music. Search everything, one format or one digital collection, filter by date and by what is available online, and get one row per record with title, date, contributors, subjects, original and online format, language, place, a rights summary, an image link and the item page.
Typical uses
- Find historical photographs, maps or prints on a subject, with image links and rights notes.
- List everything in a digital collection, such as a set of Civil War maps, for a research inventory.
- Check which items on a topic are online as images or text, and what the Library says about reuse.
- Build image and caption datasets from public-domain material.
Input
| Field |
What to enter |
| Search terms |
One search per line, e.g. lighthouse. Leave empty to list a whole collection. |
| Search in |
Everything, or one format: photos, prints and drawings; maps; books; manuscripts; audio; films and videos; notated music. |
| Digital collection |
Optional collection name or link, e.g. civil-war-maps or https://www.loc.gov/collections/civil-war-maps/. When set, "Search in" is not used. |
| Dated from / until (year) |
Optional year range for the record's date. |
| Available online as |
Image, online text, audio, video or PDF; "Any" also includes catalogue records with nothing online. |
| Order |
Relevance, oldest first, newest first or title. |
| Records per search term |
Stop each search after this many records. |
Output example
{
"title": "Point Example lighthouse, Maine",
"date": "1905",
"contributors": ["Example Photo Company"],
"subjects": ["lighthouses", "coasts"],
"originalFormat": ["photo, print, drawing"],
"onlineFormat": ["image"],
"language": ["english"],
"location": ["maine", "united states"],
"rights": "No known restrictions on publication.",
"imageUrl": "https://tile.loc.gov/storage-services/service/pnp/example/00000/00001r.jpg",
"url": "https://www.loc.gov/item/2099000001/",
"description": "Photograph shows a lighthouse on a rocky point. 1 photographic print.",
"partOf": ["detroit publishing company", "photos, prints, drawings"],
"digitized": true,
"id": "https://www.loc.gov/item/2099000001/",
"query": "lighthouse"
}
Output fields
title, date (as the Library records it: a year, a full date or a range) and contributors (photographers, authors, mapmakers…).
subjects, originalFormat (what the original is: photo, map, book…) and onlineFormat (what you can view online: image, online text, audio…).
language and location (places the record is about), in loc.gov's lower-case form.
rights: the first rights statement loc.gov gives with the record, such as "No known restrictions on publication."
imageUrl: the largest image loc.gov lists in its search results (often a preview size, not the master file). Empty when there is no image.
url: the item page on loc.gov. id is loc.gov's own record ID.
description: the first description line. partOf: the collections and divisions the record belongs to. digitized: whether loc.gov marks it as digitised.
How it fetches data
Records come from loc.gov's public JSON API (fo=json), 100 per request, page by page until the per-search limit or the end of the results. loc.gov allows 20 requests a minute and blocks a client for an hour if it goes over, so this crawler sends at most one request every 3.5 seconds from this server, across all runs, and never retries a refused request. Each request uses a descriptive user agent. Runs work in short chunks and resume at the page they reached.
Good to know
- loc.gov may refuse this server. loc.gov sits behind Cloudflare's bot protection, which often answers automated requests, especially from shared-hosting and data-centre addresses, with a "Just a moment…" check instead of data. During our own tests loc.gov answered this way. When it happens the run stops at once and says so; no API key lifts it. Try again later, or use the proxy driver (residential proxies) or a remote worker.
- Slow by design. About 17 requests a minute means roughly 1,700 records a minute at best. A run that hits a rate limit (HTTP 429) stops and keeps what it collected, because loc.gov's block lasts an hour.
- Depth. loc.gov does not page past the 100,000th result of a search; narrow by format, date or collection for more.
- Data is uneven. Records were catalogued over many decades, so dates, contributors and subjects vary in form, and many have no image.
- Rights and reuse. The Library of Congress generally does not own rights to the items in its collections. Read each record's rights statement and item page before reuse; "No known restrictions" is the Library's assessment, not a guarantee. Credit the Library of Congress and the collection. This crawler collects metadata and links only.