Posted on by & filed under epub, tools.

Valid EPUB

Our web tool for using the open-source epubcheck validator got a quick refresh:

Now includes epubpreflight results

EpubCheck’s lesser-known companion checks for additional issues like content documents that exceed 300K, which can’t be loaded on the Sony Reader. The complete (short!) list:

  • Content files that are empty or are >300k
  • Image files that are empty or are >10MB

Simple API service

This has been part of Bookworm for some time but I’m finally documenting it: there’s also a machine-readable API for the validator. It’s very simple — you get back an XML document indicating whether the file was valid, and if invalid, the list of errors.

Just POST an epub file as a series of bytes to and look at the response. Here’s a sample interaction using curl, but you could use your favorite HTTP client.

Successful validation

$ curl --data-binary @pg345.epub
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">

Invalid ePub

$ curl --data-binary @invalid.epub

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
        <error>ERROR: temp.epub/metadata.opf(6): attribute "files-as" from namespace "" not allowed at this point; ignored</error>
        <error>ERROR: temp.epub/metadata.opf(9): unknown element "series_index" from namespace ""</error>


5 Responses to “Web-based ePub validator adds Preflight and API”

  1. Michael Pastore

    Thanks, Liza. A great tool just got better.

    Every week, someone on the Net complains about how confusing it is to make an EPUB ebook. Using this tool, it’s not very difficult to fix your EPUBs, whether they are first made by InDesign, by less-expensive software programs, or by hand coding.

    Michael Pastore
    50 Benefits of Ebooks

  2. liza

    I don’t actually believe epub is easy to create at all without a background in XML and HTML/CSS, and I wish it were simpler to do by hand. But that’s a post for later this month…

  3. Michael Pastore

    Liza, you are right about this. I spoke too quickly (I’m accustomed to my own blogs, where I can edit and update my words.) I should have said: EPUB-making is not easy, but your tool makes it easier to work with EPUB.

    I *wish* that EPUB making was simpler: then more publishers would embrace it.

    Michael Pastore
    50 Benefits of Ebooks


  1.  3 tiny bash scripts for ePub creation : Threepress Consulting blog
  2.  Threepress aktualisiert Online-Epub-Validator | e-Leseratte