Free plan

Make an e-book

Turn your text into an e-book for e-readers
POST
/v1/documents/ebook

About this tool

This tool builds an e-book in the EPUB type, which e-readers and reading apps open. You give it your text as files or type it in. It can add a cover picture, a contents page, and details such as title and author. A new chapter starts at each main heading, or at each file. The text uses simple marks, such as # for a heading.
For example, you have your story as several text files, one per chapter, and want a book you can read on an e-reader.

How to use it

  1. Choose this tool.
  2. Add your chapter files, or type or paste the text of the book.
  3. Fill in the title and author, and choose the language.
  4. Add a cover picture if you have one, and choose where a new chapter starts.
  5. Press Generate.

What you get back

You get one EPUB e-book file to download and open in any e-reader or reading app.
GOOD TO KNOW
The EPUB is structurally checked by the tests (the mimetype first and stored, every XML file well-formed, every link to a file in the book), not by EPUBCheck. Pictures in the text must be data: addresses; addresses on a server are left out. Counts as one document.
TEST IT LIVE

Try Make an e-book in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/ebook
Tool ID
documents.ebook
Authentication
API key
Accepts
JPEG, PNG, WEBP, GIF, AVIF, TIFF +15 more
Background jobs
Yes
Usage group
Documents
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/documents/ebook" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'content=# Chapter one

Once upon a time...' \
  -F 'title=My Book' \
  -F 'author=Ada Lovelace'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.documents.ebook({
    "content": "# Chapter one\n\nOnce upon a time...",
    "title": "My Book",
    "author": "Ada Lovelace"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->documents()->ebook([
    'content' => '# Chapter one

Once upon a time...',
    'title' => 'My Book',
    'author' => 'Ada Lovelace',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Make an EPUB 3 e-book from Markdown, HTML or plain text (one file per chapter, or one file split at headings), with a cover, contents, metadata, a style and right-to-left support.

Make an e-book accepts JPEG, PNG, WEBP, GIF, AVIF, TIFF, SVG, SVGZ, BMP, ICO, APNG, PNM and 9 more. Send one file per request.

Make an e-book is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/documents/ebook with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.