The Books API provides information about book reviews and The New York Times bestsellers lists.
Bring your own key. This API needs your own NYTimes Books key - get one from the provider, add it once below, and the proxy injects it on every call. Your OmniStream plan covers the unified SDK, key storage, and proxy - the provider's own rate limits still apply to your key.
This is a community listing. If you own this API, you can request ownership.
npm install omnistream-sdkimport { OmniClient } from "omnistream-sdk";
const omni = new OmniClient({ token: process.env.OMNI_KEY! });
// One key reaches every API on the marketplace.
const data = await omni.call("nytimes-books/GET_lists-format");One install, one key - the same client calls every API on the marketplace.
The name of the Times best-seller list. To get valid values, use a list names request. Be sure to replace spaces with hyphens (e.g., e-book-fiction or hardcover-fiction, not E-Book Fiction or Hardcover Fiction). (The parameter is not case sensitive.)
The number of weeks that the best seller has been on list-name, as of bestsellers-date
YYYY-MM-DD The week-ending date for the sales reflected on list-name. Times best-seller lists are compiled using available book sale data. The bestsellers-date may be significantly earlier than published-date. For additional information, see the explanation at the bottom of any best-seller list page on NYTimes.com (example: Hardcover Fiction, published Dec. 5 but reflecting sales to Nov. 29).
YYYY-MM-DD The date the best-seller list was published on NYTimes.com (compare bestsellers-date)
International Standard Book Number, 10 or 13 digits
YYYY-MM-DD The date the best-seller list was published on NYTimes.com (compare bestsellers-date)
The rank of the best seller on list-name as of bestsellers-date
The rank of the best seller on list-name one week prior to bestsellers-date
Sets the starting point of the result set
Sets the sort order of the result set
Best Seller List
Best Seller History List
Best Seller List Names
Best Seller List Overview
/**
* NYTimesBooks - generated by OmniStream from NYTimes Books's OpenAPI spec.
* One typed method per endpoint. A single Omni key reaches the API.
*/
const DEFAULT_BASE = "https://grid.skinvaults.online/v1/proxy/nytimes-books";
export class NYTimesBooksError extends Error {
status: number;
code?: string;
constructor(status: number, code: string | undefined, message?: string) {
super(message || `NYTimesBooks error ${status}`);
this.name = "NYTimesBooksError";
this.status = status;
this.code = code;
}
}
export interface NYTimesBooksOptions {
baseUrl?: string;
fetch?: typeof fetch;
timeoutMs?: number;
}
export class NYTimesBooks {
/** @param token Your OmniStream key (one key for every API). */
constructor(private token: string, private opts: NYTimesBooksOptions = {}) {
if (!token) throw new Error("NYTimesBooks: token is required");
}
rateLimit: { remainingMinute?: number; remainingDay?: number } | null = null;
private async _request(method: string, path: string, { params, body }: { params?: Record<string, unknown>; body?: unknown } = {}): Promise<any> {
const f = this.opts.fetch ?? globalThis.fetch;
const url = new URL((this.opts.baseUrl ?? DEFAULT_BASE).replace(/\/+$/, "") + path);
if (params) for (const [k, v] of Object.entries(params)) if (v != null) url.searchParams.set(k, String(v));
const headers: Record<string, string> = { "x-omni-key": this.token };
if (body !== undefined) headers["content-type"] = "application/json";
const res = await f(url, { method, headers, body: body !== undefined ? JSON.stringify(body) : undefined });
this.rateLimit = {
remainingMinute: Number(res.headers.get("x-ratelimit-remaining-minute")) || undefined,
remainingDay: Number(res.headers.get("x-ratelimit-remaining-day")) || undefined,
};
const data = await res.json().catch(() => ({}));
if (!res.ok) throw new NYTimesBooksError(res.status, data?.error?.code, data?.error?.message);
return data.data ?? data;
}
/** Best Seller List */
gETListsFormat(params: { "format": string; "list"?: string; "weeks-on-list"?: number; "bestsellers-date"?: string; "date"?: string; "isbn"?: string; "published-date"?: string; "rank"?: number; "rank-last-week"?: number; "offset"?: number; "sort-order"?: string }): Promise<any> {
return this._request("GET", "/lists.{format}", { params });
}
/** Best Seller History List */
gETListsBestSellersHistoryJson(params: { "age-group"?: string; "author"?: string; "contributor"?: string; "isbn"?: string; "price"?: string; "publisher"?: string; "title"?: string }): Promise<any> {
return this._request("GET", "/lists/best-sellers/history.json", { params });
}
/** Best Seller List Names */
gETListsNamesFormat(params: { "format": string; "api-key"?: string }): Promise<any> {
return this._request("GET", "/lists/names.{format}", { params });
}
/** Best Seller List Overview */
gETListsOverviewFormat(params: { "format": string; "published_date"?: string; "api-key"?: string }): Promise<any> {
return this._request("GET", "/lists/overview.{format}", { params });
}
/** Best Seller List by Date */
gETListsDateListJson(params: { "date": string; "list": string; "isbn"?: number; "list-name"?: string; "published-date"?: string; "bestsellers-date"?: string; "weeks-on-list"?: number; "rank"?: string; "rank-last-week"?: number; "offset"?: number; "sort-order"?: string }): Promise<any> {
return this._request("GET", "/lists/{date}/{list}.json", { params });
}
/** Reviews */
gETReviewsFormat(params: { "format": string; "isbn"?: number; "title"?: string; "author"?: string; "api-key"?: string }): Promise<any> {
return this._request("GET", "/reviews.{format}", { params });
}
}
export default NYTimesBooks;
No reviews yet. Be the first to rate this API.
Yes. NYTimes Books uses apiKey authentication, so you bring your own key from the provider. You store it once on OmniStream and the proxy injects it into every call, so your code only ever sends your Omni key.
The Books API provides information about book reviews and The New York Times bestsellers lists. It exposes 6 endpoints over GET, including GET /lists.{format}, GET /lists/best-sellers/history.json, GET /lists/names.{format}.
Install the OmniStream SDK for your language and call NYTimes Books through it. The client is generated from this API's OpenAPI spec, so parameters and responses are fully typed, and the same client also calls every other API in the marketplace.
You can start on the free plan. OmniStream charges for the unified SDK, key storage and proxy rather than for NYTimes Books itself, and NYTimes Books's own rate limits still apply to your provider key.
DEV Community: Access Forem and DEV Community articles, users, comments, and other resources via a simple REST API.
Best Seller List by Date
Reviews