The Stephen King API is a free, open-source REST API providing data about Stephen King's novels, short stories, and villains. No authentication is required. All endpoints are read-only (GET requests only).
Responses are returned in JSON format. Related resources include links to their associated endpoints for easy traversal.
https://stephen-king-api.onrender.com/api
All endpoints described below are relative to this base URL.
All list endpoints support optional pagination via query parameters:
| Parameter | Type | Description |
|---|---|---|
page |
integer | Page number (starts at 1) |
limit |
integer | Items per page (max 100) |
Both page and limit must be provided together to enable pagination. Without them, all results are returned.
GET https://stephen-king-api.onrender.com/api/books
{
"data": [ ... ]
}
GET https://stephen-king-api.onrender.com/api/books?page=1&limit=5
{
"data": [ ... ],
"pagination": {
"page": 1,
"limit": 5,
"total": 75,
"totalPages": 15
}
}
Returns all books. Supports pagination.
GET https://stephen-king-api.onrender.com/api/books?page=1&limit=2
{
"data": [
{
"id": 1,
"Year": 1974,
"Title": "Carrie",
"handle": "carrie",
"Publisher": "Doubleday",
"ISBN": "978-0-385-08695-0",
"Pages": 199,
"Notes": [
"King's first published novel"
],
"villains": [
{
"name": "Margaret White",
"url": "https://stephen-king-api.onrender.com/api/villain/2"
}
],
"created_at": "2023-09-17T00:00:00.000Z"
},
{
"id": 2,
"Year": 1975,
"Title": "'Salem's Lot",
"handle": "salem-s-lot",
"Publisher": "Doubleday",
"ISBN": "978-0-385-00751-1",
"Pages": 439,
"Notes": [],
"villains": [
{
"name": "Kurt Barlow",
"url": "https://stephen-king-api.onrender.com/api/villain/1"
}
],
"created_at": "2023-09-17T00:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 2,
"total": 75,
"totalPages": 38
}
}
Returns a single book by ID.
GET https://stephen-king-api.onrender.com/api/book/3
{
"data": {
"id": 3,
"Year": 1977,
"Title": "The Shining",
"handle": "the-shining",
"Publisher": "Doubleday",
"ISBN": "978-0-385-12167-5",
"Pages": 447,
"Notes": [],
"villains": [
{
"name": "Jack Torrance",
"url": "https://stephen-king-api.onrender.com/api/villain/3"
}
],
"created_at": "2023-09-17T00:00:00.000Z"
}
}
Returns all short stories. Supports pagination.
GET https://stephen-king-api.onrender.com/api/shorts?page=1&limit=1
{
"data": [
{
"id": 1,
"title": "Jerusalem's Lot",
"type": "Short Story",
"handle": "jerusalems-lot",
"originallyPublishedIn": "Night Shift",
"collectedIn": "Night Shift",
"notes": [],
"year": 1978,
"villains": [
{
"name": "Kurt Barlow",
"url": "https://stephen-king-api.onrender.com/api/villain/1"
}
],
"created_at": "2023-09-17T00:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 1,
"total": 200,
"totalPages": 200
}
}
Returns a single short story by ID.
GET https://stephen-king-api.onrender.com/api/short/2
{
"data": {
"id": 2,
"title": "Graveyard Shift",
"type": "Short Story",
"handle": "graveyard-shift",
"originallyPublishedIn": "Cavalier",
"collectedIn": "Night Shift",
"notes": [],
"year": 1970,
"villains": [],
"created_at": "2023-09-17T00:00:00.000Z"
}
}
Villain responses include books and shorts arrays (instead of a villains array) linking to the works they appear in.
Returns all villains. Supports pagination.
GET https://stephen-king-api.onrender.com/api/villains?page=1&limit=1
{
"data": [
{
"id": 1,
"name": "Kurt Barlow",
"gender": "Male",
"status": "Undead",
"types_id": 1,
"notes": [],
"created_at": "2023-09-17T00:00:00.000Z",
"books": [
{
"title": "'Salem's Lot",
"url": "https://stephen-king-api.onrender.com/api/book/2"
}
],
"shorts": [
{
"title": "Jerusalem's Lot",
"url": "https://stephen-king-api.onrender.com/api/short/1"
}
]
}
],
"pagination": {
"page": 1,
"limit": 1,
"total": 55,
"totalPages": 55
}
}
Returns a single villain by ID.
GET https://stephen-king-api.onrender.com/api/villain/3
{
"data": {
"id": 3,
"name": "Jack Torrance",
"gender": "Male",
"status": "Deceased",
"types_id": 2,
"notes": [],
"created_at": "2023-09-17T00:00:00.000Z",
"books": [
{
"title": "The Shining",
"url": "https://stephen-king-api.onrender.com/api/book/3"
}
],
"shorts": []
}
}
| Field | Type | Description |
|---|---|---|
id |
integer | Unique identifier |
Year |
integer | Year of publication |
Title |
string | Book title |
handle |
string | URL-friendly slug |
Publisher |
string | Publisher name |
ISBN |
string | ISBN identifier |
Pages |
integer | Page count |
Notes |
string[] | Additional notes |
villains |
array | Associated villains with name and URL |
created_at |
datetime | Record creation timestamp |
| Field | Type | Description |
|---|---|---|
id |
integer | Unique identifier |
title |
string | Story title |
type |
string | Type of work (e.g. "Short Story") |
handle |
string | URL-friendly slug |
originallyPublishedIn |
string | Original publication |
collectedIn |
string | Collection it appears in |
notes |
string[] | Additional notes |
year |
integer | Year of publication |
villains |
array | Associated villains with name and URL |
created_at |
datetime | Record creation timestamp |
| Field | Type | Description |
|---|---|---|
id |
integer | Unique identifier |
name |
string | Villain name |
gender |
string? | Gender (nullable) |
status |
string | Status (e.g. "Deceased", "Undead") |
types_id |
integer | Villain type identifier |
notes |
string[] | Additional notes |
books |
array | Associated books with title and URL |
shorts |
array | Associated short stories with title and URL |
created_at |
datetime | Record creation timestamp |