<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: J Singerman</title>
    <description>The latest articles on DEV Community by J Singerman (@j_singerman_7013c94a80bdd).</description>
    <link>https://dev.to/j_singerman_7013c94a80bdd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F99mvlsfu5tfj9m7ku25d.png</url>
      <title>DEV Community: J Singerman</title>
      <link>https://dev.to/j_singerman_7013c94a80bdd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/j_singerman_7013c94a80bdd"/>
    <language>en</language>
    <item>
      <title>I built the API that published my 5 books on Amazon KDP</title>
      <dc:creator>J Singerman</dc:creator>
      <pubDate>Mon, 02 Nov 2026 20:51:45 +0000</pubDate>
      <link>https://dev.to/j_singerman_7013c94a80bdd/i-built-the-api-that-published-my-5-books-on-amazon-kdp-b05</link>
      <guid>https://dev.to/j_singerman_7013c94a80bdd/i-built-the-api-that-published-my-5-books-on-amazon-kdp-b05</guid>
      <description>&lt;p&gt;I'm a solo dev. I also write nonfiction books — ancient scripture, Apollo, declassified aerospace records, that corner of the shelf. I have five of them live on Amazon KDP as paperbacks right now.&lt;/p&gt;

&lt;p&gt;The part nobody warns you about isn't the writing. It's the formatting. Specifically: turning a manuscript into an EPUB 3 file that doesn't embarrass you on a Kindle.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pain
&lt;/h2&gt;

&lt;p&gt;Every book meant the same miserable checklist:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Metadata&lt;/strong&gt; — title, author, identifiers, language, all in the right XML, or retailers mangle your listing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The OPF manifest&lt;/strong&gt; — every single file in the book (every chapter, every image, every stylesheet) declared in &lt;code&gt;content.opf&lt;/code&gt;, in order, spelled exactly right. Miss one and the whole archive is invalid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The NCX table of contents&lt;/strong&gt; — the navigation file Kindle actually uses. Hand-writing &lt;code&gt;toc.ncx&lt;/code&gt; for a 40-chapter book is the kind of work that makes you question your life choices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Typography that survives Kindle&lt;/strong&gt; — embedded CSS that looks fine in a validator and then renders like a ransom note on an actual e-ink device. Drop caps, block quotes, tables: each one a small adventure.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I did this by hand for the first book. By the second, I was writing scripts. By the third, the scripts had become a thing with a name. By the fifth, it was an API.&lt;/p&gt;

&lt;p&gt;That's the honest origin story. EpubCraft wasn't a product idea. It was me refusing to hand-write another NCX file.&lt;/p&gt;

&lt;p&gt;Could I have used existing tools? Sure, and I tried. Desktop converters are fine until your book has real structure — parts, chapters, subsections, tables, epigraphs — and then you're fighting the tool's opinions about what a book should look like. Word-to-EPUB pipelines mangle nonfiction formatting in ways you only discover after publishing. I wanted something headless and deterministic: same manuscript in, same valid book out, every time, scriptable, no GUI clicking through export dialogs at midnight.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;EpubCraft is a headless EPUB 3 and KDP-compliant document compiler. You POST it a manuscript — Markdown or HTML — and it hands back a valid EPUB 3 archive: metadata, OPF manifest, NCX table of contents, embedded CSS typography, all assembled correctly.&lt;/p&gt;

&lt;p&gt;It runs on Vercel Edge, it's one of 16 production APIs I run behind a RapidAPI gateway, and every endpoint has automated test coverage. Here's what it does, endpoint by endpoint, in plain language:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;POST /v1/compileEpub&lt;/code&gt;&lt;/strong&gt; — the main one. Send your manuscript plus options (title, author, theme), get back a compiled EPUB 3 file. This is the whole pipeline: parse, validate, assemble manifest, build TOC, embed styles, zip it into a valid archive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;GET /v1/listThemes&lt;/code&gt;&lt;/strong&gt; — lists the available typography themes. Pick the visual style without writing CSS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;POST /v1/validateManuscript&lt;/code&gt;&lt;/strong&gt; — checks your manuscript &lt;em&gt;before&lt;/em&gt; you compile. Catches the structural problems that would produce a broken ebook, so you fix the input instead of debugging the output.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;GET /v1/downloadSampleEpub&lt;/code&gt;&lt;/strong&gt; — grabs a sample compiled book so you can see exactly what the output looks like before you commit your own manuscript to it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing exotic. It just does the boring, exact, unforgiving work of EPUB assembly the same way every time — which is precisely what hand-formatting never does.&lt;/p&gt;

&lt;p&gt;The determinism is the whole point, by the way. When Amazon flags something in your file six months later, or you need to push a corrected second edition, you re-run the same manuscript through the same pipeline and get the same book back, fixed. Try that with a folder of hand-edited XML and a prayer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proof
&lt;/h2&gt;

&lt;p&gt;This isn't a demo. All five of my books went through this pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;Before the Bible: The Dead Sea Scrolls, the Book of Enoch, and the Battle to Define Sacred Scripture&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;ANOMALIES BEYOND THE ATMOSPHERE: Evaluating Unidentified Objects, Rhythmic Flashers, and Orbital Trajectories in Gemini, Apollo, and Skylab Debriefs&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Did We Walk on the Moon! The Apollo Hoax Paradox: Why faking the lunar landings was more difficult than flying them&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Beyond Propulsion: The DIA's Advanced Aerospace Papers&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The Black Ledger: 75 Years of Declassified Intelligence Records, Nuclear Incursions, and the Government's Secret UAP Paper Trail&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Five real books, live on Amazon. The compiler that built them is the same one behind the API. If it can survive my 40-chapter manuscripts with tables, block quotes, and footnotes, it can survive yours.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick example
&lt;/h2&gt;

&lt;p&gt;Here's what a compile request looks like. (Illustrative example — sample content, not a real book.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"https://epub-craft-api.vercel.app/v1/compileEpub"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{
    "title": "My Sample Book",
    "author": "Jane Example",
    "language": "en",
    "theme": "serif-classic",
    "format": "markdown",
    "manuscript": "# Chapter 1\n\nIt was a dark and stormy night...\n\n# Chapter 2\n\n...and then the formatting just worked."
  }'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--output&lt;/span&gt; my-sample-book.epub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What comes back is a valid EPUB 3 archive — metadata set, manifest complete, NCX table of contents built from your headings, typography embedded. The thing you'd otherwise spend a weekend assembling by hand, returned in one call.&lt;/p&gt;

&lt;p&gt;If you want to check your manuscript first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"https://epub-craft-api.vercel.app/v1/compileEpub"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{ "manuscript": "# Chapter 1\n\nHello?", "validate_only": true }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(The exact request/response shapes are in the OpenAPI 3.0 docs on the RapidAPI listing — that's the source of truth, not this post.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;EpubCraft is live on RapidAPI with a free tier. Compile something, break something, tell me what the validator yells about.&lt;/p&gt;

&lt;p&gt;And if you're self-publishing and fighting KDP formatting — metadata weirdness, TOC problems, Kindle typography crimes — ask in the comments. I've published five books through this pipeline. I've seen every way it can go wrong, usually at 2am the night before I wanted to hit publish.&lt;/p&gt;

</description>
      <category>books</category>
      <category>api</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
