GnistAI GnistAI
Log in

Getting Started with Open Library

Book metadata — search by title/author, work details, ISBNs, cover images.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Reference

Data source: Open Library (Internet Archive)

Overview

Open Library wraps Open Library (Internet Archive), handling authentication, pagination, and rate limits for you. This tutorial covers all 7 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-open-library": {
      "url": "https://context.gnist.ai/mcp/open-library/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (7)

search_books

Search Open Library for books by title, author, or subject. Returns matching books with titles, authors, publication years, ISBNs, subjects, and cover image IDs. Use the returned work key (e.g. /works/OL27448W) with get_book() for full details.

ParameterTypeRequiredDescription
querystringrequiredSearch query — title, author, or subject (e.g. "the lord of the rings", "tolkien").
limitintegeroptionalMax results to return (1-100). Default 10. (default: 10)
curl -X POST "https://context.gnist.ai/mcp/open-library/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_books", "arguments": {"query": "the lord of the rings"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/open-library/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'query': 'the lord of the rings'},
            'name': 'search_books'}},
)
print(resp.json())

get_book

Get detailed information about a book/work by its Open Library work ID. Returns title, description, subjects, author references, cover IDs, and timestamps. Work IDs end in "W" — find them via search_books().

ParameterTypeRequiredDescription
olidstringrequiredOpen Library work ID (e.g. "OL27448W" for The Lord of the Rings).
curl -X POST "https://context.gnist.ai/mcp/open-library/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_book", "arguments": {"olid": "OL27448W"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/open-library/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'olid': 'OL27448W'}, 'name': 'get_book'}},
)
print(resp.json())

search_authors

Search Open Library for authors by name. Returns matching authors with names, birth/death dates, top works, and work counts. Use the returned author key with get_author() for full bio.

ParameterTypeRequiredDescription
querystringrequiredAuthor name to search for (e.g. "tolkien", "ursula le guin").
limitintegeroptionalMax results to return (1-100). Default 10. (default: 10)
curl -X POST "https://context.gnist.ai/mcp/open-library/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_authors", "arguments": {"query": "tolkien"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/open-library/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'query': 'tolkien'}, 'name': 'search_authors'}},
)
print(resp.json())

get_author

Get detailed information about an author by Open Library author ID. Returns name, biography, birth/death dates, external links, and photo IDs. Author IDs end in "A" — find them via search_authors().

ParameterTypeRequiredDescription
olidstringrequiredOpen Library author ID (e.g. "OL26320A" for J.R.R. Tolkien).
curl -X POST "https://context.gnist.ai/mcp/open-library/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_author", "arguments": {"olid": "OL26320A"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/open-library/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'olid': 'OL26320A'}, 'name': 'get_author'}},
)
print(resp.json())

get_editions

Get all editions of a work — different publishers, languages, formats. Returns edition details including publishers, publication dates, ISBNs, page counts, languages, and cover IDs. Useful for finding specific translations or print editions.

ParameterTypeRequiredDescription
olidstringrequiredOpen Library work ID (e.g. "OL27448W").
limitintegeroptionalMax editions to return (1-100). Default 10. (default: 10)
curl -X POST "https://context.gnist.ai/mcp/open-library/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_editions", "arguments": {"olid": "OL27448W"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/open-library/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'olid': 'OL27448W'}, 'name': 'get_editions'}},
)
print(resp.json())

search_by_isbn

Look up a specific book edition by its ISBN-10 or ISBN-13. Returns the edition's title, publishers, publication date, ISBNs, page count, languages, covers, and linked work keys. Dashes in the ISBN are stripped automatically.

ParameterTypeRequiredDescription
isbnstringrequiredISBN-10 or ISBN-13 (e.g. "9780618640157" or "0618640150").
curl -X POST "https://context.gnist.ai/mcp/open-library/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_by_isbn", "arguments": {"isbn": "9780618640157"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/open-library/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'isbn': '9780618640157'}, 'name': 'search_by_isbn'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/open-library/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/open-library/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

Common Patterns

Search then retrieve
Use search_books to find items, then get_book to get full details. This two-step pattern is common for exploring data before drilling down.
Pagination
Several tools support limit, offset, or page parameters. Start with small limits during development, then increase for production queries.

FAQ

What data does Open Library provide?

Book metadata — search by title/author, work details, ISBNs, cover images. It exposes 7 tools: search_books, get_book, search_authors, get_author, get_editions, search_by_isbn, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the Open Library API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials