The loc.gov API is a work in progress and subject to change. Once the API leaves Beta, we anticipate release of an official version of this documentation at loc.gov.

Introduction

The loc.gov JSON API provides structured data about Library of Congress collections. The API was originally designed to power the loc.gov website, but in addition to providing HTML for the website it can provide a wealth of information in JSON format.

API stands for “application programming interface”. You can write code that sends queries to the API in the form of URLs or web requests (like your browser makes) and get back responses that have structured data. That data, in JSON format, is more easily used by software programs and in analysis tools. With an API, you can do things like:

  • dynamically include content from a website in your own website
  • send a query for data to feed a Twitter bot
  • create a dataset for analysis, visualization, or mapping.

The loc.gov JSON API provides information about things you can find on the Library of Congress website:

  • items (books, archived websites, photos, and videos)
  • collections (thematic or otherwise grouped items that have been digitized)
  • images (thumbnails and higher resolution formats)

There are other specialized APIs and bulk downloads you may want to check out, too.

The API does not include records from the library catalog (although items that have been digitized are retrievable). See the MARC Open Access dataset for bulk access to the catalog records up through 2014.

Base URL

All URLs start with https://www.loc.gov/ and need to include fo=json as a parameter to get JSON.

No API key or authentication is required.

Requests

Get started by learning about requests, query parameters, and pagination.

Responses

See Responses for info about fields in search results and examples.

Tutorials

How-to