Skip to content
OSINTtools.io

loc.gov API (Library of Congress) API

Search the Library of Congress's digital collections, newspapers and web archives by keyword; returns JSON or YAML.

Base URL
https://www.loc.gov
Sign-in
No key
Free tier
Free tier
Pricing
Free
Format
REST
Endpoints
6

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

Introduction

The loc.gov API returns structured JSON or YAML data about Library of Congress collections: items (books, photos, maps, newspapers, manuscripts, audio, video), collections and their metadata. It does not include library catalog records. Investigators use it to search digitized collections.

Any loc.gov page can be requested as data by adding fo=json. No key or authentication is needed. Paging past the 100,000th result is not supported; use facets to narrow.

The limit for this API is 20 requests per minute, with a 1 hour block when exceeded; limits can be lower under heavy traffic and 429 or CAPTCHA pages may appear.

Quick start

  1. No key needed

    The loc.gov API (Library of Congress) API answers without an account or key.

  2. Make your first request

    Search everything on loc.gov.. Replace the example values and run it in a terminal, or use Try it on the endpoint.

    curl 'https://www.loc.gov/search/?q=bridges&fo=json'
  3. Read the response

    A 200 response looks like this.

    {
      "results": [
        {
          "id": "https://www.loc.gov/item/00000000/"
        }
      ],
      "pagination": {}
    }

Authentication

No key or account: every endpoint answers without one.

Rate limits and pricing

20 requests per minute; blocked for 1 hour if exceeded

Free tier. Pricing: free.

Errors

StatusMeaning
429Rate limit exceeded; pause requests

Format slugs include audio, books, film-and-videos, legislation, manuscripts, maps, newspapers, photos, notated-music, web-archives.

Path parameters

formatstringrequired

Format slug

Example: photosOne of: audio, books, film-and-videos, legislation, manuscripts, maps, newspapers, photos, notated-music, web-archives

Query parameters

qstringtakes your name

Keyword search

Example: bridges
fostringrequired

Response format

Example: jsonOne of: json, yaml
fastring

Filters as filter-name:value

Example: location:washington d.c.
Response fields · 2Show

results[]object

Matching records

paginationobject

Paging information

curl 'https://www.loc.gov/photos/?fo=json'
No key needed
Response
{
  "results": [
    {
      "id": "https://www.loc.gov/item/00000000/"
    }
  ],
  "pagination": {}
}

Collections

  • Passive: the target is not contacted

Returns a results list.

Query parameters

fostringrequired

Response format

Example: jsonOne of: json, yaml
Response fields · 1Show

results[]object

Collections

curl 'https://www.loc.gov/collections/?fo=json'
No key needed
Response
{
  "results": [
    {
      "id": "https://www.loc.gov/collections/civil-war-maps/"
    }
  ]
}

One collection and its items.

GET/collections/{collection}/

  • Passive: the target is not contacted

The collection name is a kebab-case slug such as civil-war-maps.

Path parameters

collectionstringrequired

Collection slug

Example: civil-war-maps

Query parameters

fostringrequired

Response format

Example: jsonOne of: json, yaml
qstring

Keyword search within the collection

Example: river
Response fields · 1Show

results[]object

Items in the collection

curl 'https://www.loc.gov/collections/civil-war-maps/?fo=json'
No key needed
Response
{
  "results": [
    {
      "id": "https://www.loc.gov/item/00000000/"
    }
  ]
}

Items

  • Passive: the target is not contacted

Use the item ID or the id URL from search results. at can limit to item, resources, cite_this and similar.

Path parameters

item_idstringrequired

Item ID

Example: 00000000

Query parameters

fostringrequired

Response format

Example: jsonOne of: json, yaml
atstring

Return only selected attributes

Example: item,resources
Response fields · 2Show

itemobject

Bibliographic data

resources[]object

Digitized resources

curl 'https://www.loc.gov/item/00000000/?fo=json'
No key needed
Response
{
  "item": {},
  "resources": []
}
  • Passive: the target is not contacted

For example one digitized newspaper edition and its pages.

Path parameters

resource_idstringrequired

Resource ID

Example: 00000000

Query parameters

fostringrequired

Response format

Example: jsonOne of: json, yaml
Response fields · 2Show

resourceobject

The resource

segments[]object

Parts such as pages

curl 'https://www.loc.gov/resource/00000000/?fo=json'
No key needed
Response
{
  "resource": {},
  "segments": []
}