Skip to main content

Fake Book Data API

MOCK DATA

Fake books with genre-flavored titles, checksum-valid ISBN-13s, authors, page counts and invented publishers. Filter by genre and page range.

Generated test data for fixtures and development

Base URL
/api/books
Capabilities
1 route Seedable
Last updated
July 29, 2026

GET /api/books

Live requestRuns against the public API
No key required
GET/api/books?genre=fantasy&count=5

Request parameters

Only generate books in this genre — the title is assembled from the genre's own word pools and the genre field matches. Omit for a random mix.

Minimum page count (inclusive). Must be ≤ maxPages.

Maximum page count (inclusive). Must be ≥ minPages.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/books?genre=fantasy&count=5"
const res = await fetch("https://randomapi.dev/api/books?genre=fantasy&count=5");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/books?genre=fantasy&count=5").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/books?genre=fantasy&count=5"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 3
genre enum

Only generate books in this genre — the title is assembled from the genre's own word pools and the genre field matches. Omit for a random mix.

allowed: fantasy | scifi | mystery | thriller | romance | horror | literary | history | biography | selfhelp | children | poetry
example: genre=fantasy
minPages int

Minimum page count (inclusive). Must be ≤ maxPages.

default: 120
allowed: 20 – 2000
example: minPages=200
maxPages int

Maximum page count (inclusive). Must be ≥ minPages.

default: 600
allowed: 20 – 2000
example: maxPages=400
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=title,author
exclude list

Return all fields except these (comma-separated).

example: exclude=publisher
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 7
title string

Genre-flavored title assembled from the genre's word pools.

example: The Ashen Throne of the Winter Court

author string

Fake author full name (given name + family name).

example: Nora Bellamy

isbn13 string (ISBN-13)

13 digits starting with 978, with a valid ISBN-13 check digit (kept as a string to preserve leading digits). Not registered to a real book.

example: 9781639284719

genre string

One of the 12 genres; always matches the pools the title came from.

example: fantasy

pages integer

Page count within minPages..maxPages (inclusive).

example: 384

publishedYear integer

Publication year, 1900 to the current year.

example: 1987

publisher string

Invented publishing house from a fixed fictional list — never a real company.

example: Hartwell & Sons

Documented examples

Build-generated requests and complete responses
3
Five fantasy novels
GET /api/books?genre=fantasy&count=5
{
  "data": [
    {
      "title": "Sunken Grimoire",
      "author": "Kaylie Gorczany-Considine",
      "isbn13": "9785004797361",
      "genre": "fantasy",
      "pages": 296,
      "publishedYear": 2001,
      "publisher": "Thornquill Press"
    },
    {
      "title": "The Crown of Shadowfell",
      "author": "Waino Marvin",
      "isbn13": "9789125678875",
      "genre": "fantasy",
      "pages": 458,
      "publishedYear": 1984,
      "publisher": "Lanternlight Books"
    },
    {
      "title": "Ashen Crown",
      "author": "Hailee Streich",
      "isbn13": "9785050180360",
      "genre": "fantasy",
      "pages": 497,
      "publishedYear": 1964,
      "publisher": "Marlowe & Finch"
    },
    {
      "title": "The Fabled Throne",
      "author": "Otis Hodkiewicz",
      "isbn13": "9789863190998",
      "genre": "fantasy",
      "pages": 191,
      "publishedYear": 2026,
      "publisher": "Copperbeam Books"
    },
    {
      "title": "Ashen Grimoire",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Reproducible epics over 500 pages
GET /api/books?minPages=500&maxPages=1200&seed=42&count=3
{
  "data": [
    {
      "title": "The Effigy of the Attic",
      "author": "Kaylie Gorczany-Considine",
      "isbn13": "9780047973635",
      "genre": "horror",
      "pages": 1061,
      "publishedYear": 1969,
      "publisher": "Foxglove Press"
    },
    {
      "title": "The Shattered Dragon of Stormhold",
      "author": "Waino Marvin",
      "isbn13": "9781256788775",
      "genre": "fantasy",
      "pages": 967,
      "publishedYear": 1949,
      "publisher": "Copperbeam Books"
    },
    {
      "title": "The Penguin of the Blueberry Patch",
      "author": "Hailee Streich",
      "isbn13": "9780501803676",
      "genre": "children",
      "pages": 853,
      "publishedYear": 1925,
      "publisher": "Thornquill Press"
    }
  ],
  "meta": {
    "endpoint": "books",
    "count": 3,
    "seed": 42,
    "params": {
      "minPages": 500,
      "maxPages": 1200
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Short children's picture books
GET /api/books?genre=children&minPages=20&maxPages=48&count=10
{
  "data": [
    {
      "title": "Giggly Firefly",
      "author": "Kaylie Gorczany-Considine",
      "isbn13": "9785004797361",
      "genre": "children",
      "pages": 30,
      "publishedYear": 2001,
      "publisher": "Thornquill Press"
    },
    {
      "title": "The Bear Cub of the Blueberry Patch",
      "author": "Waino Marvin",
      "isbn13": "9789125678875",
      "genre": "children",
      "pages": 40,
      "publishedYear": 1984,
      "publisher": "Lanternlight Books"
    },
    {
      "title": "Snuggly Bear Cub",
      "author": "Hailee Streich",
      "isbn13": "9785050180360",
      "genre": "children",
      "pages": 42,
      "publishedYear": 1964,
      "publisher": "Marlowe & Finch"
    },
    {
      "title": "The Brave Acorn",
      "author": "Otis Hodkiewicz",
      "isbn13": "9789863190998",
      "genre": "children",
      "pages": 24,
      "publishedYear": 2026,
      "publisher": "Copperbeam Books"
    },
    {
      "title": "Snuggly Firefly",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Generates believable book records for library and bookstore demos. Titles are assembled from per-genre word pools (adjective + noun + motif), so ?genre=fantasy really returns things like The Ashen Throne of the Winter Court — never a cookbook. The genre field always matches the pools the title was built from; omit genre for a random mix across all 12.

Every isbn13 is a 13-digit Bookland EAN that starts with 978 and carries a valid ISBN-13 check digit, so it passes any standard ISBN validator or barcode renderer. Honesty note: the nine digits between the prefix and the check digit are random — these ISBNs are not registered to real books. Likewise every publisher is an invented house (e.g. Hartwell & Sons) drawn from a fixed fictional list, never a real company, and authors are fake names.

minPages/maxPages bound the pages field inclusively (defaults 120–600, hard limits 20–2000); minPages above maxPages is a 400, not a silent fix. publishedYear falls between 1900 and the current year. With a seed the same request returns byte-identical books forever.

Use it for

  • Seed a library, bookstore or reading-app demo with genre-consistent inventory
  • Test ISBN validation and barcode rendering against checksum-valid ISBN-13s
  • Reproducible catalog fixtures via seed — the same shelf in every CI run

Frequently asked questions

Are the ISBNs valid?

Structurally, yes — every isbn13 has a correct check digit, so it passes format validators. The numbers are fake: they don't resolve to real published books.

Can I filter by genre or length?

Yes — genre restricts records to one genre and minPages/maxPages genuinely constrain the page count.

Are these real books?

No — titles, authors and publishers are generated, and the endpoint is honestly badged mock. For real reference data, this isn't it.

Standards & references