ArcaneBooks – Library of Congress Control Number (LCCN) – An Overview

Introduction

This is part of my ongoing series on my ArcaneBooks project. The goal is to provide a module to retrieve book data via provided web APIs. In the SEE ALSO section later in this post I’ll provide links to previous posts which cover the background of the project, as well as how to use the OpenLibrary APIs to get data based on the ISBN.

In this post I will provide an overview of using the Library of Congress API to get data based on the LCCN, short for Library of Congress Control Number.

The next post in this series will provide code examples and an explanation of how to use PowerShell to get data using the Library of Congress API.

LCCN Overview

The abbreviation LCCN, according to the Library of Congress’s own website, stands for Library of Congress Control Number. When the system was first created in 1898, however, LCCN stood for Library of Congress Card Number, and I’ve seen it both ways in publications.

I’ve also seen a few places define it as Library of Congress Catalog Number, although this was never an official designation.

The LCCN was created in 1898 to provide a unique value to every item in the Library of Congress. This not only includes books, but works of art, manuscripts (not in book form), maps, and more.

LCCN Format

The LCCN has two parts, a prefix followed by a serial number. From 1898 to 2000 the prefix was two digits, representing the year. Beginning in 2001 the prefix became four digits, representing the year.

The serial number is simple a sequential number. 45-1 was the first number assigned in 1945. 45-1234 was the 1,234th item assigned in that year.

Be aware from 1969 to 1972 there was an experiment where the single digit of 7 was used for the prefix. They decided this scheme wasn’t going to work out, and reverted to the standard format of year followed by serial number.

Here are a few examples of real LCCNs from books in my personal collection. You can use these in your own testing.

LCCN Title
54-9698 Elements of Radio Servicing
40-33904 Radio Handbook Twenty-Second Edition
41-3345 The Radio Amateur’s Handbook 42nd Edition 1965
64-20875 Early Electrical Communication
74-75450 VHF Handbook for Radio Amateurs
76-190590 Wire Antennas for Radio Amateurs
71-120473 73 Vertical, Beam, and Triangle Antennas

Accessing Book Data from the Library of Congress

The Library of Congress actually provides two web APIs for getting book data. The first API is for accessing assets, such as digital assets. It doesn’t return much data for books.

The second is the LC Z39.50 system, accessible through lx2.loc.gov. Here is an example of calling it to retrieve a record for the book Elements of Radio Servicing, which has the LCCN of 54-9698. (It should, of course, all be used as a single line just in case your web browser wraps it.)

http://lx2.loc.gov:210/lcdb?version=3&operation=searchRetrieve&query=bath.lccn=54009698&maximumRecords=1&recordSchema=mods

Breaking it down, the root call is to http://lx2.loc.gov:210/lcdb. After this is a question mark ?, followed by the parameters.

The first parameter is version=3. This indicates which format to use for the return data. It supports two versions, 1.1 and 3. For our purposes we’ll use the most current version, 3.

Following the ampersand & is operation=searchRetrieve. This instructs the Library of Congress’s API that we want to do a search to retrieve data.

Next is the core piece, we need to tell it what LCCN number to look up, query=bath.lccn=54009698. The root object is bath, then it uses the property lccn.

The LCCN has to be formatted in a specific way. We start with the two or four digit year. In the above example, 54-9698, this would be the two digit year of 54.

Next is the serial number. If the number is less than six digits, it must be left zero padded to become six. Thus 9698 becomes 009698. The year and serial number are combined, removing any dashes, spaces, or other characters and becomes 54009698.

Following is maximumRecords=1, indicating we only expect one record back. That’s all we’ll get back with a single LCCN anyway, so this will work fine for our needs.

The final parameter is recordSchema=mods. The API supports several formats.

Record Schema Description Notes
dc Dublin Core (bibliographic records) Brings back just the basics (Name, author, etc)
mads MADS (authority records) Brief, not a lot of info
mods MODS (bibliographic records) Very readable XML schema, most info
marcxml MARCXML – the default schema Abbreviated schema, not readable
opacxml MARCXML (wth holdings attached) As above with a bit more info

You are welcome to experiment with different formats, but for this module we’ll be using mods. It provides the most information, and is in XML. XML is very easy to read, and it works great with PowerShell.

ISBN and Library of Congress

It is possible to use the Library of Congress to look up the ISBN. In my testing though, the interface provided by OpenLibrary provided more data. Thus we’ll be using it for looking up ISBNs in this module.

We’ll use the LCCN API for books where we only have the LCCN.

See Also

The ArcaneBooks Project – An Introduction

ArcaneBooks – ISBN Overview, PowerShell, and the Simple OpenLibrary ISBN API

ArcaneBooks – PowerShell and the Advanced OpenLibrary ISBN API

Conclusion

In this document we covered the basics of the LCCN as well as the web API provided by the Library of Congress. Understanding this information is important when we integrate the call into our PowerShell code.

The ArcaneBooks Project – An Introduction

Introduction

As some of you may know, I’ve been a ham (amateur) radio operator since 1999, holding the call sign N4IXT. I’m a member of several clubs, including the Birmingham Amateur Radio Club, the Shelby County Amateur Radio Club (where I’m also the webmaster), and the Amateur Radio Relay League (ARRL), in which I am a life member.

More importantly for this post, I am a member of the Alabama Historical Radio Society. We are beginning a project to catalog our exhibits and library into cloud based software named PastPerfect. As part of this effort we’ll be entering data for our extensive library into the software.

Naturally we want to automate as much of this as possible, since the collection is rather extensive. Some of our books are so old they have neither an ISBN (International Standard Book Number) or a Library of Congress Catalog Number (LCCN for short). Others have only the LCCN, the newer books have an ISBN, and a very few have both.

In the process of meeting with other museums I learned this is a need for many other organizations. So I decided to do something about it.

I plan to create a PowerShell module with cmdlets that can retrieve book metadata, such as title, author, and the like. This module will then be made available as on open source project on my website so other groups can use it as well.

As a source a user can pass in either an ISBN or LCCN number, or better yet pipe in an entire list of numbers from a text file, and generate book data.

The sources we’ll use are the Library of Congress and the Open Library site, which is part of the Internet Archive. Both provide web APIs we can use to retrieve data, and we’ll document that information in upcoming posts.

Why PowerShell?

You may be wondering why I chose PowerShell for this project. There were several good reasons.

First, and people often forget this, PowerShell is multi-platform. It can run on Windows, MacOS, and Linux. If you want to learn more on this you should watch my Pluralsight course PowerShell 7 Quick Start for Developers on Linux, macOS and Windows.

Next, the PowerShell code is viewable by anyone. Any user can download the code and easily examine it before running. This should address security concerns by many organizations.

The third reason is readability. As many will point out, there are other languages such as Python that will meet the above needs. In general though, code from other languages can be hard to read and execute for people who aren’t developers. I’m imagining my module will be used by many people with only a basic understanding of tech. As such a simple command like Get-BookByISBN -ISBN 1234567890 will be much easier to use.

Finally, well hey I just love PowerShell! As I need to turn this project around quickly I wanted to use something I already know and love.

The Plan

In the next two posts I will cover what ISBNs and LCCNs are, and the web APIs (Application Programming Interface) that we’ll use to get the data.

I’ll then begin a series of posts documenting the PowerShell code needed to retrieve the book data, and how you can use the book data for your organization.

The series will wrap up with the creation of the ArcaneBooks PowerShell Module, and its publication to my Github site.

Kusto Will Return!

For those of you who have been following Kusto Query Language series over the last few years, don’t worry it will return! I’m just taking a short diversion for the next month or so to document this project. Then we’ll return to the world of Kusto.

Conclusion

In this post I established the groundwork for my new ArcaneBooks PowerShell project. In the next few posts we’ll cover terms and data sources, then look at the PowerShell code needed to achieve our results.

I have a long series of blog posts on PowerShell, you’ll find them listed at my Fun With PowerShell Roundup

If you want to take a deeper dive into PowerShell, I have many PowerShell courses at Pluralsight, you’ll find them listed on my About Me page.

One course that may be especially helpful is my Pluralsight course PowerShell 7 Quick Start for Developers on Linux, macOS and Windows, as it dives into the creation of functions, modules, and more.

If you don’t have a Pluralsight subscription, just go to my list of courses on Pluralsight . At the top is a Try For Free button you can use to get a free 10 day subscription to Pluralsight, with which you can watch my courses, or any other course on the site.