Open Library API

Books API · 20M+ works · Bibliographic data · Public domain

TL;DR

Open Library is a massive open database of 20+ million books and 10+ million authors, maintained by the Internet Archive. Their REST API lets you look up any book by its Open Library work ID (e.g., OL12345W) to get full bibliographic metadata: title, author, publication date, ISBNs, subjects, descriptions, cover images, and even lending availability from partner libraries. Everything is free and open.

Quick start: https://openlibrary.org/works/OL12345W.json

No API key needed — just make a request!

How to Use This API

1. Get a Book by Work ID

https://openlibrary.org/works/OL12345W.json

Returns: title, authors, description, subjects, covers, first publish date, and more. The work ID can be found from search results or book pages.

2. Search for Books

https://openlibrary.org/search.json?q=the+great+gatsby

Full-text search across titles, authors, and subjects. Supports pagination with page and limit parameters.

3. Get a Book by ISBN

https://openlibrary.org/isbn/9780140328721.json

Direct lookup by ISBN-10 or ISBN-13. Returns the edition data.

4. JavaScript — Book Info Display

async function getBook(workId) {
  const resp = await fetch(
    `https://openlibrary.org/works/${workId}.json`
  );
  const book = await resp.json();
  
  // Get author name if available
  let author = 'Unknown';
  if (book.authors && book.authors[0]?.author?.key) {
    const aResp = await fetch(
      `https://openlibrary.org${book.authors[0].author.key}.json`
    );
    const aData = await aResp.json();
    author = aData.name;
  }
  
  return {
    title: book.title,
    author,
    subjects: book.subjects?.slice(0, 5) || [],
    description: book.description?.value || book.description || '',
    coverId: book.covers?.[0]
  };
}

getBook('OL45804W').then(book => {
  console.log(`${book.title} by ${book.author}`);
  console.log('Subjects:', book.subjects.join(', '));
});

5. Python — Search and Get Covers

import requests

def search_books(query):
    resp = requests.get(
        'https://openlibrary.org/search.json',
        params={'q': query, 'limit': 5}
    )
    return resp.json()['docs']

def get_cover_url(cover_id, size='M'):
    if not cover_id:
        return None
    return f'https://covers.openlibrary.org/b/id/{cover_id}-{size}.jpg'

books = search_books('javascript programming')
for book in books:
    title = book.get('title', 'Unknown')
    author = book.get('author_name', ['Unknown'])[0]
    cover = get_cover_url(book.get('cover_i'))
    print(f"{title} by {author}")
    if cover:
        print(f"  Cover: {cover}")
Try book OL12345W: https://openlibrary.org/works/OL12345W.json

Frequently Asked Questions

How are Open Library work IDs formatted?
Works have the pattern OL{number}W (e.g., OL12345W). Authors use OL{number}A. Editions use OL{number}M. You can find these IDs on any Open Library book or author page.
Does the API provide book cover images?
Yes! Cover IDs from the API can be used with https://covers.openlibrary.org/b/id/{cover_id}-M.jpg. Sizes: S (small), M (medium), L (large). Also supports ISBN-based covers: /b/isbn/{isbn}-M.jpg.
Can I check if a book is freely available to read?
Yes, the API includes availability data. Check for ebook_access and borrow_url fields. Some books are in the public domain and fully downloadable.
Are there rate limits?
Open Library requests rate limiting for excessive usage. For normal development, you won't hit limits. For high-volume production, use the data dumps or register for an API key.
What's the difference between works and editions?
A work is the abstract "book" (e.g., "1984" by George Orwell). An edition is a specific physical publication (e.g., the 1950 Signet Classics paperback). Editions have ISBNs, works have subjects and descriptions.
Does Open Library return full book descriptions?
Yes, works include a description field (either a string or an object with value). Many books have detailed summaries, though coverage varies by how much the community has contributed.

API Details

API URL
https://openlibrary.org
Documentation
openlibrary.org/dev/docs/api
Category
Books
Authentication
Not Required
Geographic Coverage
Global — 20M+ works, 10M+ authors

What You Can Build