How it's built

One fetch function. No database.

This whole site runs on the PangoBooks Public API. It's plain JSON over HTTPS, it needs no API key, and it allows 10 requests per minute for free (30 with a signed-in account).

  1. 01

    Snapshot what rarely changes

    The bibliography is a typed list in the repo. A script asks the API once for each book's PangoBooks page and cover and saves the answers, so those pages load with zero API calls.

  2. 02

    Ask the API for live inventory

    Prices, signed copies, and first editions come from a few book search requests. No key, no SDK, no account.

  3. 03

    Cache it and link out

    Each response is cached for an hour and shared by every visitor, so the site stays far under the free rate limit. Every book links to PangoBooks.

The entire API client

import { cacheLife } from "next/cache";

export async function pangoGet<T>(path: string, params = {}) {
  "use cache";
  cacheLife("hours");

  const query = new URLSearchParams(params);
  const res = await fetch(`https://pangobooks.com/api/public/v1${path}?${query}`);
  const json = await res.json();
  return json.data as T;
}

Fetching a deals shelf

const paperbacks = await pangoGet("/search", {
  q: "stephen king",
  type: "books",
  binding: "paperback",
  condition: "Good,Excellent,Like New,New",
  sort: "price_asc",
});

paperbacks.hits[0];
// { title, price_usd, condition, cover_url, urls: { book } }

Endpoints this site uses

Book search (live)

Every deals shelf. Only the filters change: binding, condition, signed, edition, and sort.

GET https://pangobooks.com/api/public/v1/search?q=stephen+king&type=books&binding=paperback&condition=Good%2CExcellent%2CLike+New%2CNew&sort=price_asc&limit=10

Author (snapshot)

The headline stats and the most popular titles on the home page, saved to a JSON file by a script.

GET https://pangobooks.com/api/public/v1/authors/stephen-king

Title search (snapshot)

The same script matched each book in the bibliography to its PangoBooks title page and cover.

GET https://pangobooks.com/api/public/v1/search?q=the+stand+stephen+king&type=titles&limit=10

The API also covers ISBN pricing comps, every live offer for an ISBN, single listings, seller storefronts, and curated collections. Explore the full reference and playground ↗