# Library of Congress API

> Library of Congress returns digital collection and historic newspaper search results, available as a workflow and API.

Library of Congress (LOC) searches digital collections by keywords, format, and date range; provide a query, with other inputs optional. Search historic newspapers returns newspaper pages matching text, with optional state and issue-year filters; provide a query.

- Page: https://fous.com/tools/library-of-congress
- Handle: `@library-of-congress`
- Category: [Education](https://fous.com/tools/category/education)
- Source website: https://loc.gov
- Last verified: Oct 7, 2026

## Methods

### Search collections

Operation `search_collections`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Search Library of Congress digital collections by keywords, format, and date range. Results follow Library search relevance; rights notes may be unavailable for some records.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `page` | integer | no | `2` | Page of search results, for example 2. |
| `query` | string | yes | `"Civil War maps"` | Keywords to search, for example Civil War photographs. |
| `format` | string | no | `"maps"` | Material format, for example maps; any searches all formats. |
| `end_year` | integer | no | `1865` | Latest year, for example 1865. |
| `start_year` | integer | no | `1861` | Earliest year, for example 1861. |
| `max_results` | integer | no | `2` | Results per page, for example 20. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "page": {
      "type": "integer",
      "default": 1,
      "minimum": 1,
      "description": "Page of search results, for example 2.",
      "x-fous-developer": true,
      "examples": [
        2,
        1
      ]
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Keywords to search, for example Civil War photographs.",
      "examples": [
        "Civil War maps",
        "Civil War photographs",
        "Abraham Lincoln"
      ]
    },
    "format": {
      "enum": [
        "any",
        "photos",
        "maps",
        "manuscripts",
        "newspapers",
        "audio",
        "films",
        "books"
      ],
      "type": "string",
      "default": "any",
      "description": "Material format, for example maps; any searches all formats.",
      "examples": [
        "maps",
        "photos",
        "audio"
      ]
    },
    "end_year": {
      "type": "integer",
      "maximum": 9999,
      "minimum": 1,
      "description": "Latest year, for example 1865.",
      "examples": [
        1865
      ]
    },
    "start_year": {
      "type": "integer",
      "maximum": 9999,
      "minimum": 1,
      "description": "Earliest year, for example 1861.",
      "examples": [
        1861
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Results per page, for example 20.",
      "x-fous-developer": true,
      "examples": [
        2,
        3
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "page": 2,
      "query": "Civil War maps",
      "format": "maps",
      "max_results": 2
    },
    {
      "page": 1,
      "query": "Civil War photographs",
      "format": "photos",
      "end_year": 1865,
      "start_year": 1861,
      "max_results": 3
    },
    {
      "query": "Abraham Lincoln",
      "format": "audio",
      "max_results": 2
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `results` | array |  | Matching collections and digital items, in Library search order. |
| `results[].date` | string or null | `"1910"` |  |
| `results[].title` | string or null | `"The American Civil War--maps"` |  |
| `results[].format` | string or null | `"Map"` |  |
| `results[].summary` | string or null | `"Title from cover. Issued to accompany Formby, John. The American Civil War, a concise history of its causes, progress, ` |  |
| `results[].item_link` | string | `"https://www.loc.gov/item/2009581125/"` |  |
| `results[].rights_and_usage` | string or null | `"The content of the Library of Congress Geography and Map Division digitized collections is free to use and reuse unless` |  |
| `results[].thumbnail_image_link` | string or null | `"https://tile.loc.gov/storage-services/service/gmd/gmd370m/g3701m/g3701sm/gcw0066000/ca000001.gif"` |  |
| `results[].creators_or_contributors` | string or null | `"formby, john"` |  |

**Example input**

```json
{
  "page": 2,
  "query": "Civil War maps",
  "format": "maps",
  "max_results": 2
}
```

**Example output**

```json
{
  "results": [
    {
      "date": "1910",
      "title": "The American Civil War--maps",
      "format": "Map",
      "summary": "Title from cover. Issued to accompany Formby, John. The American Civil War, a concise history of its causes, progress, and results (New York, Scribners, 1910). Includes maps of the principal campaigns…",
      "item_link": "https://www.loc.gov/item/2009581125/",
      "rights_and_usage": "The content of the Library of Congress Geography and Map Division digitized collections is free to use and reuse unless a Rights Advisory statement is present that indicates otherwise. Credit Line: Li…",
      "thumbnail_image_link": "https://tile.loc.gov/storage-services/service/gmd/gmd370m/g3701m/g3701sm/gcw0066000/ca000001.gif",
      "creators_or_contributors": "formby, john"
    },
    {
      "date": "1910",
      "title": "The American Civil War--maps",
      "format": "Map",
      "summary": "Title from cover. Issued to accompany Formby, John. The American Civil War, a concise history of its causes, progress, and results (London, John Murray, 1910). Includes maps of the principal campaigns…",
      "item_link": "https://www.loc.gov/item/2009581126/",
      "rights_and_usage": "The content of the Library of Congress Geography and Map Division digitized collections is free to use and reuse unless a Rights Advisory statement is present that indicates otherwise. Credit Line: Li…",
      "thumbnail_image_link": "https://tile.loc.gov/storage-services/service/gmd/gmd370m/g3701m/g3701sm/gcw0065000/ca000001.gif",
      "creators_or_contributors": "formby, john"
    }
  ]
}
```

### Search historic newspapers

Operation `search_historic_newspapers`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Search historic U.S. newspaper pages by text, with optional state and issue-year filters. Returns relevance-ranked page records with snippets and image links; newspaper OCR may contain transcription errors.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `page` | integer | no | `2` | Result page to retrieve, for example 2. |
| `query` | string | yes | `"suffrage"` | Words to find in newspaper text, for example Titanic. |
| `state` | string | no | `"New York"` | US state name to limit results, for example Montana. Leave blank for all states. |
| `end_year` | integer | no | `1920` | Latest issue year, for example 1913. |
| `start_year` | integer | no | `1915` | Earliest issue year, for example 1912. |
| `max_results` | integer | no | `2` | Number of page results to return, for example 20. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "page": {
      "type": "integer",
      "default": 1,
      "minimum": 1,
      "description": "Result page to retrieve, for example 2.",
      "x-fous-developer": true,
      "examples": [
        2,
        1
      ]
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Words to find in newspaper text, for example Titanic.",
      "examples": [
        "suffrage",
        "Titanic",
        "zxqnotawordtitanic123321"
      ]
    },
    "state": {
      "type": "string",
      "default": "",
      "description": "US state name to limit results, for example Montana. Leave blank for all states.",
      "examples": [
        "New York",
        "Montana"
      ]
    },
    "end_year": {
      "type": "integer",
      "maximum": 2100,
      "minimum": 1600,
      "description": "Latest issue year, for example 1913.",
      "examples": [
        1920,
        1912
      ]
    },
    "start_year": {
      "type": "integer",
      "maximum": 2100,
      "minimum": 1600,
      "description": "Earliest issue year, for example 1912.",
      "examples": [
        1915,
        1912
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Number of page results to return, for example 20.",
      "x-fous-developer": true,
      "examples": [
        2,
        3
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "page": 2,
      "query": "suffrage",
      "state": "New York",
      "end_year": 1920,
      "start_year": 1915,
      "max_results": 2
    },
    {
      "page": 1,
      "query": "Titanic",
      "state": "Montana",
      "end_year": 1912,
      "start_year": 1912,
      "max_results": 3
    },
    {
      "query": "zxqnotawordtitanic123321",
      "max_results": 2
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `newspaper_pages` | array |  | Historic newspaper pages in search relevance order. |
| `newspaper_pages[].city` | string or null | `"New York"` | City of publication. |
| `newspaper_pages[].state` | string or null | `"New York"` | State of publication. |
| `newspaper_pages[].snippet` | string or null | `"... men and women of the suffrage states are practically unanimous on these points. Must Rrcogrcize Fact \"With tlie ov` | Short excerpt of newspaper text around the search words. |
| `newspaper_pages[].page_link` | string | `"https://www.loc.gov/resource/sn83030214/1918-01-09/ed-1/?sp=7&q=suffrage"` | Newspaper page link. |
| `newspaper_pages[].issue_date` | string or null | `"1918-01-09"` | Issue date (YYYY-MM-DD). |
| `newspaper_pages[].page_number` | integer or null | `7` | Printed issue page number when known. |
| `newspaper_pages[].newspaper_title` | string or null | `"New-york tribune"` | Newspaper name. |
| `newspaper_pages[].page_image_link` | string or null | `"https://tile.loc.gov/image-services/iiif/service:ndnp:dlc:batch_dlc_brown_ver02:data:sn83030214:00206532221:1918010901:` | Page image link. |

**Example input**

```json
{
  "page": 2,
  "query": "suffrage",
  "state": "New York",
  "end_year": 1920,
  "start_year": 1915,
  "max_results": 2
}
```

**Example output**

```json
{
  "newspaper_pages": [
    {
      "city": "New York",
      "state": "New York",
      "snippet": "... men and women of the suffrage states are practically unanimous on these points. Must Rrcogrcize Fact \"With tlie ovcrwhelming testimony on tlie one hand that woman suffrage in practice is a…",
      "page_link": "https://www.loc.gov/resource/sn83030214/1918-01-09/ed-1/?sp=7&q=suffrage",
      "issue_date": "1918-01-09",
      "page_number": 7,
      "newspaper_title": "New-york tribune",
      "page_image_link": "https://tile.loc.gov/image-services/iiif/service:ndnp:dlc:batch_dlc_brown_ver02:data:sn83030214:00206532221:1918010901:0187/full/pct:12.5/0/default.jpg"
    },
    {
      "city": "New York",
      "state": "New York",
      "snippet": "Worn SuffrageOver There and Over Here By MARIE DE MONTALVO Editor The New Citizen SUFFRAGE is still an issueexcept for Canada an allAmerica issue In the United States ten…",
      "page_link": "https://www.loc.gov/resource/sn83030214/1918-11-03/ed-2/?sp=32&q=suffrage",
      "issue_date": "1918-11-03",
      "page_number": 32,
      "newspaper_title": "New-york tribune",
      "page_image_link": "https://tile.loc.gov/image-services/iiif/service:ndnp:dlc:batch_dlc_allen_ver02:data:sn83030214:00206532324:1918110302:0066/full/pct:12.5/0/default.jpg"
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@library-of-congress",
  "visibility": "public",
  "operation": "search_collections",
  "version": 1,
  "input": {
    "page": 2,
    "query": "Civil War maps",
    "format": "maps",
    "max_results": 2
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@library-of-congress\",\n  \"visibility\": \"public\",\n  \"operation\": \"search_collections\",\n  \"version\": 1,\n  \"input\": {\n    \"page\": 2,\n    \"query\": \"Civil War maps\",\n    \"format\": \"maps\",\n    \"max_results\": 2\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@library-of-congress",
  "visibility": "public",
  "operation": "search_collections",
  "version": 1,
  "input": {
    "page": 2,
    "query": "Civil War maps",
    "format": "maps",
    "max_results": 2
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/library-of-congress`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `search_collections`: Search collections. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `search_historic_newspapers`: Search historic newspapers. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-library-of-congress https://api.fous.com/mcp/tools/library-of-congress --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Find collection items about a topic, period, or format
- Review historic newspaper coverage within a date range
- Locate newspaper pages published in a particular state
- Gather item titles, dates, formats, and summaries for research
- Collect newspaper snippets and page images for historical analysis

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this Library of Congress tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a Library of Congress account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from loc.gov when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Oct 7, 2026.

### What digital collections match a topic or date range?

Search collections finds matching digital collections and items using keywords and optional format and date filters.

### Which historic newspaper pages contain certain words?

Search historic newspapers finds text matches, with optional state and issue-year filters. Newspaper OCR may contain transcription errors.

## Related

- [Open Library API](https://fous.com/tools/open-library.md): Open Library returns book search results, catalog details, and author works; availability reflects listed editions, not current loan availability, and catalog details may be missing.
- [National Archives API](https://fous.com/tools/national-archives.md): Search the public U.S. National Archives Catalog for historical records.
- [The New York Times API](https://fous.com/tools/the-new-york-times.md): The New York Times provides current section headlines and summaries, keyword-matched public listings with dates, authors, sections and links, and Best Sellers lists for the latest issue or dates within a week.
- [OverDrive API](https://fous.com/tools/overdrive.md): Find ebooks and audiobooks at public libraries.
- [Congress.gov API](https://fous.com/tools/congress-gov.md): Congress.gov returns federal bills and resolutions matching topic, Congress, status, or chamber, and provides an individual bill’s status, summary, titles, actions, and related bills; summaries may be unavailable.
- [The Wall Street Journal API](https://fous.com/tools/the-wall-street-journal.md): The Wall Street Journal provides news-section headlines and searchable public article headlines and summaries, with available story details and publication dates for search filtering.
- [AP News API](https://fous.com/tools/ap-news.md): AP News provides reporting, up to 50 public-page headlines, searchable articles visible in its search, and full text when accessible.
- [NPR API](https://fous.com/tools/npr.md): NPR returns displayed section headlines, searchable articles with summaries and publication details, and available article text; date-filtered searches may miss older stories edited much later.
- [All Education tools](https://fous.com/tools/category/education)
