The Book Market

Plain HTML and JavaScript

Add an ordinary buy link or build a book card with a public catalog request.

Updated

Read as Markdown
Show the prompt for your AI

Use The Book Market (thebookmarket.com) to sell my ebook on my website. Read https://thebookmarket.com/llms.txt first, then follow its instructions.

An anchor works on any HTML page. Replace the uppercase slugs with your published book's slugs, or use the buy_url from the API.

<a href="https://thebookmarket.com/checkout/YOUR-AUTHOR-SLUG/YOUR-BOOK-SLUG">Buy my ebook</a>

The reader opens Book Market checkout and can buy without creating an account first.

Show the current book details

Use the complete HTML and fetch example. It renders title, description and price from the catalog and hides the button when buy_url is null.

The public API permits cross-origin GET requests without credentials. Put returned text in textContent, never innerHTML. Use price.display for the price label; a pay-what-you-want book does not have a fixed amount_cents.

Before publishing

The author must create the account, connect Stripe, activate selling and publish the book. Follow the quickstart. Keep checkout in a normal page reached by a link. The embed is coming soon.