npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ashdev/codex-plugin-metadata-openlibrary

v1.10.5

Published

Open Library metadata plugin for Codex - fetches book metadata by ISBN or title search

Downloads

1,049

Readme

Open Library Metadata Plugin

A Codex metadata plugin that fetches book metadata from Open Library, a free and open book database with extensive ISBN coverage.

Features

  • ISBN Lookup: Direct, accurate book matching by ISBN-10 or ISBN-13
  • Title Search: Fuzzy search by title and/or author
  • Cover Images: Fetches cover images in multiple sizes (small, medium, large)
  • Author Resolution: Resolves author references to full names
  • Subject Extraction: Extracts subjects/topics from Open Library data
  • Ratings: Includes Open Library community ratings when available

Installation

From npm

npm install @ashdev/codex-plugin-metadata-openlibrary

From source

cd plugins/metadata-openlibrary
npm install
npm run build

Configuration

Register the plugin in Codex with optional configuration:

| Option | Type | Default | Description | |--------|------|---------|-------------| | maxResults | number | 10 | Maximum search results to return (1-50) |

Example Configuration

plugins:
  - name: metadata-openlibrary
    config:
      maxResults: 20

API Endpoints Used

The plugin uses the following Open Library API endpoints:

| Endpoint | Usage | |----------|-------| | /isbn/{isbn}.json | Direct ISBN lookup (edition data) | | /works/{id}.json | Work details (description, subjects) | | /authors/{id}.json | Author name resolution | | /search.json | Title/author search |

Cover Image URLs

Cover images are fetched from:

https://covers.openlibrary.org/b/isbn/{isbn}-{S|M|L}.jpg
https://covers.openlibrary.org/b/id/{cover_id}-{S|M|L}.jpg

Field Mapping

| Open Library | Codex Field | Notes | |--------------|-------------|-------| | title | title | | | subtitle | subtitle | | | authors[].name | authors | Resolved to full names with role="author" | | publishers[0] | publisher | First publisher | | publish_date | year | Parsed to extract year | | isbn_13 / isbn_10 | isbns | All ISBNs, preferring ISBN-13 | | subjects | subjects | Combined from edition and work | | description | summary | From edition or work | | first_publish_date | originalYear | From work data | | languages[0] | language | Converted to BCP47 format | | key | externalId | Work or edition key | | covers[0] | covers | S/M/L URLs generated | | ratings_average | rating | Normalized 0-100 scale |

Supported Content Types

This plugin only provides book metadata (not series). It's designed for:

  • EPUBs with ISBN metadata
  • PDFs with ISBN information
  • Novels and non-fiction books
  • Graphic novels (limited support)

For manga and comics, consider using a dedicated manga/comic metadata plugin.

Search Behavior

ISBN Search

When an ISBN is provided:

  1. Direct lookup via /isbn/{isbn}.json
  2. Returns single result with 100% confidence
  3. Falls back to title search if ISBN not found

Title Search

When searching by title/author:

  1. Searches via /search.json
  2. Returns multiple results ranked by relevance
  3. Relevance score based on: author data, ISBN availability, cover, year, subjects, ratings

Match Behavior

The match method tries to automatically identify a book:

  1. ISBN match (if available): Highest confidence (99%)
  2. Title match: Lower confidence (max 85%), boosted by title similarity and year match

Rate Limiting

Open Library recommends limiting requests to 100 per 5 minutes. The plugin includes:

  • 15-minute response caching
  • Respectful request headers
  • Single concurrent request pattern

Examples

Search by ISBN

// Plugin will fetch: https://openlibrary.org/isbn/9780553418026.json
const results = await plugin.searchBooks({
  isbn: "978-0-553-41802-6"
});

Search by Title

// Plugin will search: https://openlibrary.org/search.json?q=The+Martian&author=Andy+Weir
const results = await plugin.searchBooks({
  query: "The Martian",
  author: "Andy Weir"
});

Get Full Metadata

// Fetches edition, work, and author data
const metadata = await plugin.getBook({
  externalId: "/works/OL17091769W"
});

Development

Build

npm run build

Test

npm test

Lint

npm run lint

Type Check

npm run typecheck

API Documentation

For detailed API documentation, see:

License

MIT