# Library of Congress

> Search the Library of Congress: photographs, maps, newspapers, manuscripts, books, recordings and film from the world's largest library. Browse its digital collections, fetch an item's full catalogue record with citations, and narrow a large search with facets. No API key required.

App · Research & Academia · 7 actions. Web page: https://docs.lodol.com/docs/integrations/library-of-congress

## Actions

### Get a resource

Fetch one resource of a multi-part item - a single newspaper issue, one atlas, one reel - together with its segments: the pages of that issue or the maps in that atlas. Takes a resource id such as ggbain.37398, which may contain slashes for a dated newspaper edition.

**Inputs**

- Resource ID (`resource_id`, text, required): The resource's loc.gov id. A full resource URL is accepted and reduced to the id.
- Maximum segments (`page_size`, number): How many segments to return, 1-100. A long newspaper run has hundreds; the true total is reported either way. Defaults to 25. From 1 to 100.

**Outputs**

- `citations` (object)
- `item` (object)
- `resource` (object)
- `resources` (list)
- `segment_count` (number)
- `segments` (list)

**Example output**

```json
{
  "citations": {
    "apa": "Bain News Service, P. Calvin Coolidge with kitten. 8/2/24. [Photograph] Retrieved from the Library of Congress, https://www.loc.gov/item/2014717546/.",
    "chicago": "Bain News Service, Publisher. Calvin Coolidge with kitten. Photograph. https://www.loc.gov/item/2014717546/.",
    "mla": "Bain News Service, Publisher. Calvin Coolidge with kitten. Photograph. Retrieved from the Library of Congress, <www.loc.gov/item/2014717546/>."
  },
  "item": {
    "access_restricted": false,
    "call_number": "LC-B2- 6234-5 [P&P]",
    "contributors": [
      "Bain News Service"
    ],
    "control_number": "2014717546",
    "created_published": [
      "8/2/24 (date created or published later by Bain)"
    ],
    "date": "1924-01-01",
    "dates": [
      "1924"
    ],
    "description": "1 negative : glass ; 5 x 7 in. or smaller.",
    "digitized": true,
    "formats": [
      "photo, print, drawing"
    ],
    "genres": [
      "Glass negatives"
    ],
    "id": "https://www.loc.gov/item/2014717546/",
    "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398v.jpg",
    "image_urls": [
      "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
      "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398r.jpg",
      "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398v.jpg"
    ],
    "languages": [
      "english"
    ],
    "lccn": "2014717546",
    "locations": [],
    "medium": [
      "1 negative : glass ; 5 x 7 in. or smaller."
    ],
    "mime_types": [
      "image/gif",
      "image/jpg",
      "image/tif"
    ],
    "notes": [
      "Title from data provided by the Bain News Service on the negative.",
      "Forms part of: George Grantham Bain Collection (Library of Congress)."
    ],
    "online_formats": [
      "image"
    ],
    "original_formats": [
      "photo, print, drawing"
    ],
    "other_titles": [],
    "part_of": [
      "bain collection",
      "prints and photographs division"
    ],
    "repository": "Library of Congress Prints and Photographs Division Washington, D.C. 20540 USA",
    "reproduction_number": "LC-DIG-ggbain-37398 (digital file from original negative)",
    "resources": [
      {
        "caption": "digital file from original neg.",
        "file_count": 5,
        "fulltext_url": null,
        "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
        "pdf_url": null,
        "segment_count": null,
        "url": "https://www.loc.gov/resource/ggbain.37398/"
      }
    ],
    "rights_advisory": "No known restrictions on publication.",
    "subjects": [
      "glass negatives"
    ],
    "summary": "Photograph shows president Calvin Coolidge at his family farm in Plymouth Notch, Vermont.",
    "thumbnail_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
    "title": "Calvin Coolidge [with kitten]",
    "url": "https://www.loc.gov/item/2014717546/"
  },
  "resource": {
    "caption": "digital file from original neg.",
    "file_count": 5,
    "fulltext_url": null,
    "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
    "pdf_url": null,
    "segment_count": null,
    "url": "https://www.loc.gov/resource/ggbain.37398/"
  },
  "resources": [
    {
      "caption": "digital file from original neg.",
      "file_count": 5,
      "fulltext_url": null,
      "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
      "pdf_url": null,
      "segment_count": null,
      "url": "https://www.loc.gov/resource/ggbain.37398/"
    }
  ],
  "segment_count": 0,
  "segments": []
}
```

### Get an item

Fetch one item's full catalogue record, the digitised files attached to it, and ready-made APA, Chicago and MLA citations. Takes an item id such as 2014717546, a loc.gov item URL, or an lccn.loc.gov permalink.

**Inputs**

- Item ID (`item_id`, text, required): The item's loc.gov id. A full item or lccn.loc.gov URL is accepted and reduced to the id.

**Outputs**

- `citations` (object)
- `item` (object)
- `resources` (list)

**Example output**

```json
{
  "citations": {
    "apa": "Bain News Service, P. Calvin Coolidge with kitten. 8/2/24. [Photograph] Retrieved from the Library of Congress, https://www.loc.gov/item/2014717546/.",
    "chicago": "Bain News Service, Publisher. Calvin Coolidge with kitten. Photograph. https://www.loc.gov/item/2014717546/.",
    "mla": "Bain News Service, Publisher. Calvin Coolidge with kitten. Photograph. Retrieved from the Library of Congress, <www.loc.gov/item/2014717546/>."
  },
  "item": {
    "access_restricted": false,
    "call_number": "LC-B2- 6234-5 [P&P]",
    "contributors": [
      "Bain News Service"
    ],
    "control_number": "2014717546",
    "created_published": [
      "8/2/24 (date created or published later by Bain)"
    ],
    "date": "1924-01-01",
    "dates": [
      "1924"
    ],
    "description": "1 negative : glass ; 5 x 7 in. or smaller.",
    "digitized": true,
    "formats": [
      "photo, print, drawing"
    ],
    "genres": [
      "Glass negatives"
    ],
    "id": "https://www.loc.gov/item/2014717546/",
    "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398v.jpg",
    "image_urls": [
      "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
      "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398r.jpg",
      "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398v.jpg"
    ],
    "languages": [
      "english"
    ],
    "lccn": "2014717546",
    "locations": [],
    "medium": [
      "1 negative : glass ; 5 x 7 in. or smaller."
    ],
    "mime_types": [
      "image/gif",
      "image/jpg",
      "image/tif"
    ],
    "notes": [
      "Title from data provided by the Bain News Service on the negative.",
      "Forms part of: George Grantham Bain Collection (Library of Congress)."
    ],
    "online_formats": [
      "image"
    ],
    "original_formats": [
      "photo, print, drawing"
    ],
    "other_titles": [],
    "part_of": [
      "bain collection",
      "prints and photographs division"
    ],
    "repository": "Library of Congress Prints and Photographs Division Washington, D.C. 20540 USA",
    "reproduction_number": "LC-DIG-ggbain-37398 (digital file from original negative)",
    "resources": [
      {
        "caption": "digital file from original neg.",
        "file_count": 5,
        "fulltext_url": null,
        "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
        "pdf_url": null,
        "segment_count": null,
        "url": "https://www.loc.gov/resource/ggbain.37398/"
      }
    ],
    "rights_advisory": "No known restrictions on publication.",
    "subjects": [
      "glass negatives"
    ],
    "summary": "Photograph shows president Calvin Coolidge at his family farm in Plymouth Notch, Vermont.",
    "thumbnail_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
    "title": "Calvin Coolidge [with kitten]",
    "url": "https://www.loc.gov/item/2014717546/"
  },
  "resources": [
    {
      "caption": "digital file from original neg.",
      "file_count": 5,
      "fulltext_url": null,
      "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
      "pdf_url": null,
      "segment_count": null,
      "url": "https://www.loc.gov/resource/ggbain.37398/"
    }
  ]
}
```

### Get search facets

List the filter values a search can be narrowed by, with a count for each. The Library's own advice for a large result set is to facet rather than page through it, and the 'filter' string on every value goes straight into any search action's Filters field.

**Inputs**

- Search query (`query`, text): The search to get facets for. Required unless a collection or format is given.
- Collection (`collection`, text): Get facets for one collection instead of all of loc.gov. Cannot be combined with a format.
- Format (`format`, text): Get facets for one format instead of all of loc.gov. Cannot be combined with a collection. One of: `audio` (Audio Recordings), `books` (Books & Printed Material), `film-and-videos` (Films & Videos), `legislation`, `manuscripts` (Manuscripts & Mixed Material), `maps`, `newspapers`, `notated-music` (Notated Music), `photos` (Photos, Prints & Drawings), `web-archives` (Web Archives).
- Filters (`filters`, list): Facet filters, each written as 'field:value' - for example 'subject:maps' or 'location:ohio'. Run Get search facets first to see which values a field actually takes.

**Outputs**

- `facets` (list)
- `total_results` (number)

**Example output**

```json
{
  "facets": [
    {
      "field": "original-format",
      "filters": [
        {
          "count": 7705,
          "filter": "original-format:photo, print, drawing",
          "title": "Photo, Print, Drawing",
          "value": "photo, print, drawing"
        },
        {
          "count": 29,
          "filter": "original-format:map",
          "title": "Map",
          "value": "map"
        }
      ],
      "title": "Original Format"
    }
  ],
  "total_results": 1224036
}
```

### List digital collections

List the Library's digital collections - curated groups of items such as Civil War Maps or Baseball Cards. Each row carries the slug the collection is addressed by, so this is the step that feeds Search a collection.

**Inputs**

- Results per page (`page_size`, number): How many results to return, 1-100. Defaults to 25. From 1 to 100.
- Page (`page`, number): Which page of results to return, starting at 1. Defaults to 1. At least 1.

**Outputs**

- `page` (number)
- `page_size` (number)
- `result_count` (number)
- `results` (list)
- `total_pages` (number)
- `total_results` (number)

**Example output**

```json
{
  "page": 1,
  "page_size": 25,
  "result_count": 1,
  "results": [
    {
      "access_restricted": false,
      "call_number": null,
      "contributors": [],
      "date": null,
      "dates": [],
      "description": "Maps from the Library of Congress Geography and Map Division documenting the American Civil War.",
      "digitized": true,
      "id": "https://www.loc.gov/collections/civil-war-maps/about-this-collection/",
      "image_url": "https://www.loc.gov/static/collections/civil-war-maps/500_500.jpg",
      "image_urls": [
        "https://www.loc.gov/static/collections/civil-war-maps/500_500.jpg"
      ],
      "item_count": 2338,
      "languages": [
        "english"
      ],
      "locations": [
        "united states"
      ],
      "online_formats": [
        "image"
      ],
      "original_formats": [
        "collection"
      ],
      "part_of": [
        "digital collections",
        "geography and map division"
      ],
      "resources": [],
      "subjects": [
        "civil war",
        "maps"
      ],
      "thumbnail_url": "https://www.loc.gov/static/collections/civil-war-maps/500_500.jpg",
      "title": "Civil War Maps",
      "url": "https://www.loc.gov/collections/civil-war-maps/about-this-collection/"
    }
  ],
  "total_pages": 24,
  "total_results": 594
}
```

### Search a collection

Search inside one digital collection, or browse it with no query. Takes the collection's slug, such as civil-war-maps - a full collection URL is accepted too.

**Inputs**

- Collection (`collection`, text, required): The collection's URL slug. Run List digital collections to find it.
- Search query (`query`, text): What to search for inside the collection. Leave empty to browse all of it.
- Results per page (`page_size`, number): How many results to return, 1-100. Defaults to 25. From 1 to 100.
- Page (`page`, number): Which page of results to return, starting at 1. Defaults to 1. At least 1.
- Sort by (`sort_by`, text): How to order the results. Defaults to the Library's relevance order. One of: `date` (Date, earliest first), `date_desc` (Date, latest first), `title_s` (Title, A-Z), `title_s_desc` (Title, Z-A), `shelf_id` (Call number, ascending), `shelf_id_desc` (Call number, descending).
- Filters (`filters`, list): Facet filters, each written as 'field:value' - for example 'subject:maps' or 'location:ohio'. Run Get search facets first to see which values a field actually takes.
- From year (`start_date`, text): Start of a date range, usually a year. Must be given together with the end year.
- To year (`end_date`, text): End of a date range, usually a year. Must be given together with the start year.

**Outputs**

- `collection` (text)
- `page` (number)
- `page_size` (number)
- `result_count` (number)
- `results` (list)
- `total_pages` (number)
- `total_results` (number)

**Example output**

```json
{
  "collection": "civil-war-maps",
  "page": 1,
  "page_size": 25,
  "result_count": 1,
  "results": [
    {
      "access_restricted": false,
      "call_number": "LC-B2- 6234-5 [P&P]",
      "contributors": [
        "Bain News Service"
      ],
      "date": "1924-01-01",
      "dates": [
        "1924"
      ],
      "description": "1 negative : glass ; 5 x 7 in. or smaller.",
      "digitized": true,
      "id": "https://www.loc.gov/item/2014717546/",
      "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398v.jpg",
      "image_urls": [
        "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
        "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398r.jpg",
        "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398v.jpg"
      ],
      "languages": [
        "english"
      ],
      "locations": [],
      "online_formats": [
        "image"
      ],
      "original_formats": [
        "photo, print, drawing"
      ],
      "part_of": [
        "bain collection",
        "prints and photographs division"
      ],
      "resources": [
        {
          "caption": "digital file from original neg.",
          "file_count": 5,
          "fulltext_url": null,
          "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
          "pdf_url": null,
          "segment_count": null,
          "url": "https://www.loc.gov/resource/ggbain.37398/"
        }
      ],
      "subjects": [
        "glass negatives"
      ],
      "thumbnail_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
      "title": "Calvin Coolidge [with kitten]",
      "url": "https://www.loc.gov/item/2014717546/"
    }
  ],
  "total_pages": 49,
  "total_results": 2338
}
```

### Search by format

Search one kind of material - photos, maps, newspapers, manuscripts, books, audio, film, notated music, legislation or web archives. Leave the query empty to browse the whole format, which is what the sort and date range are for.

**Inputs**

- Format (`format`, text, required): The kind of original material to search. One of: `audio` (Audio Recordings), `books` (Books & Printed Material), `film-and-videos` (Films & Videos), `legislation`, `manuscripts` (Manuscripts & Mixed Material), `maps`, `newspapers`, `notated-music` (Notated Music), `photos` (Photos, Prints & Drawings), `web-archives` (Web Archives).
- Search query (`query`, text): What to search for within that format. Leave empty to browse everything in it.
- Results per page (`page_size`, number): How many results to return, 1-100. Defaults to 25. From 1 to 100.
- Page (`page`, number): Which page of results to return, starting at 1. Defaults to 1. At least 1.
- Sort by (`sort_by`, text): How to order the results. Defaults to the Library's relevance order. One of: `date` (Date, earliest first), `date_desc` (Date, latest first), `title_s` (Title, A-Z), `title_s_desc` (Title, Z-A), `shelf_id` (Call number, ascending), `shelf_id_desc` (Call number, descending).
- Filters (`filters`, list): Facet filters, each written as 'field:value' - for example 'subject:maps' or 'location:ohio'. Run Get search facets first to see which values a field actually takes.
- From year (`start_date`, text): Start of a date range, usually a year. Must be given together with the end year.
- To year (`end_date`, text): End of a date range, usually a year. Must be given together with the start year.

**Outputs**

- `format` (text)
- `format_label` (text)
- `page` (number)
- `page_size` (number)
- `result_count` (number)
- `results` (list)
- `total_pages` (number)
- `total_results` (number)

**Example output**

```json
{
  "format": "photos",
  "format_label": "Photos, Prints & Drawings",
  "page": 1,
  "page_size": 25,
  "result_count": 1,
  "results": [
    {
      "access_restricted": false,
      "call_number": "LC-B2- 6234-5 [P&P]",
      "contributors": [
        "Bain News Service"
      ],
      "date": "1924-01-01",
      "dates": [
        "1924"
      ],
      "description": "1 negative : glass ; 5 x 7 in. or smaller.",
      "digitized": true,
      "id": "https://www.loc.gov/item/2014717546/",
      "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398v.jpg",
      "image_urls": [
        "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
        "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398r.jpg",
        "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398v.jpg"
      ],
      "languages": [
        "english"
      ],
      "locations": [],
      "online_formats": [
        "image"
      ],
      "original_formats": [
        "photo, print, drawing"
      ],
      "part_of": [
        "bain collection",
        "prints and photographs division"
      ],
      "resources": [
        {
          "caption": "digital file from original neg.",
          "file_count": 5,
          "fulltext_url": null,
          "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
          "pdf_url": null,
          "segment_count": null,
          "url": "https://www.loc.gov/resource/ggbain.37398/"
        }
      ],
      "subjects": [
        "glass negatives"
      ],
      "thumbnail_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
      "title": "Calvin Coolidge [with kitten]",
      "url": "https://www.loc.gov/item/2014717546/"
    }
  ],
  "total_pages": 49,
  "total_results": 1224
}
```

### Search the Library

Search everything the Library of Congress publishes on loc.gov: photographs, maps, newspapers, manuscripts, books, recordings, films and web archives, alongside its own web pages and legislation. Returns one flat row per item with its title, date, contributors, subjects, rights and image URLs.

**Inputs**

- Search query (`query`, text, required): What to search for. Plain words search titles, descriptions, subjects and any available full text.
- Results per page (`page_size`, number): How many results to return, 1-100. Defaults to 25. From 1 to 100.
- Page (`page`, number): Which page of results to return, starting at 1. Defaults to 1. At least 1.
- Sort by (`sort_by`, text): How to order the results. Defaults to the Library's relevance order. One of: `date` (Date, earliest first), `date_desc` (Date, latest first), `title_s` (Title, A-Z), `title_s_desc` (Title, Z-A), `shelf_id` (Call number, ascending), `shelf_id_desc` (Call number, descending).
- Filters (`filters`, list): Facet filters, each written as 'field:value' - for example 'subject:maps' or 'location:ohio'. Run Get search facets first to see which values a field actually takes.
- From year (`start_date`, text): Start of a date range, usually a year. Must be given together with the end year.
- To year (`end_date`, text): End of a date range, usually a year. Must be given together with the start year.

**Outputs**

- `page` (number)
- `page_size` (number)
- `result_count` (number)
- `results` (list)
- `total_pages` (number)
- `total_results` (number)

**Example output**

```json
{
  "page": 1,
  "page_size": 25,
  "result_count": 1,
  "results": [
    {
      "access_restricted": false,
      "call_number": "LC-B2- 6234-5 [P&P]",
      "contributors": [
        "Bain News Service"
      ],
      "date": "1924-01-01",
      "dates": [
        "1924"
      ],
      "description": "1 negative : glass ; 5 x 7 in. or smaller.",
      "digitized": true,
      "id": "https://www.loc.gov/item/2014717546/",
      "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398v.jpg",
      "image_urls": [
        "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
        "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398r.jpg",
        "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398v.jpg"
      ],
      "languages": [
        "english"
      ],
      "locations": [],
      "online_formats": [
        "image"
      ],
      "original_formats": [
        "photo, print, drawing"
      ],
      "part_of": [
        "bain collection",
        "prints and photographs division"
      ],
      "resources": [
        {
          "caption": "digital file from original neg.",
          "file_count": 5,
          "fulltext_url": null,
          "image_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
          "pdf_url": null,
          "segment_count": null,
          "url": "https://www.loc.gov/resource/ggbain.37398/"
        }
      ],
      "subjects": [
        "glass negatives"
      ],
      "thumbnail_url": "https://tile.loc.gov/storage-services/service/pnp/ggbain/37300/37398_150px.jpg",
      "title": "Calvin Coolidge [with kitten]",
      "url": "https://www.loc.gov/item/2014717546/"
    }
  ],
  "total_pages": 49,
  "total_results": 1224
}
```
