This is a stable and reliable unofficial API for Project Gutenberg API.
Use the package manager pip to install requests.
pip install requests
Get your free credentials at RapidAPI.
import requests
url = "https://project-gutenberg-api.p.rapidapi.com/books/{id}" # in this example 15
headers = {
"Content-Type": "application/json",
"X-RapidAPI-Key": "22606cdc51mshb55e1156ae0b717p1f67c2jsn0b17cef6e7c0",
"X-RapidAPI-Host": "project-gutenberg-api.p.rapidapi.com"
}
response = requests.get(url, headers=headers)
print(response.json())
{
"id": 15,
"title": "Moby-Dick; or, The Whale",
"authors": [
{
"name": "Melville, Herman",
"birth_year": 1819,
"death_year": 1891
}
],
"translators": [],
"subjects": [
"Adventure stories",
"Ahab, Captain (Fictitious character) -- Fiction",
"Mentally ill -- Fiction",
"Psychological fiction",
"Sea stories",
"Ship captains -- Fiction",
"Whales -- Fiction",
"Whaling -- Fiction",
"Whaling ships -- Fiction"
],
"bookshelves": [
"Adventure",
"Best Books Ever Listings"
],
"languages": [
"en"
],
"copyright": false,
"media_type": "Text",
"formats": {
"text/html; charset=utf-8": "https://www.gutenberg.org/files/15/15-h/15-h.htm",
"application/epub+zip": "https://www.gutenberg.org/ebooks/15.epub.images",
"application/rdf+xml": "https://www.gutenberg.org/ebooks/15.rdf",
"application/x-mobipocket-ebook": "https://www.gutenberg.org/ebooks/15.kindle.images",
"image/jpeg": "https://www.gutenberg.org/cache/epub/15/pg15.cover.medium.jpg",
"text/plain; charset=utf-8": "https://www.gutenberg.org/files/15/15-0.txt",
"text/html": "https://www.gutenberg.org/ebooks/15.html.images"
},
"download_count": 872
}