;
})
.then(book => setResult({ key, book }))
.catch(() => {
if (!controller.signal.aborted) setResult({ key, book: null });
});
return () => controller.abort();
}, [author, slug, key]);
if (!result || result.key !== key) return Loading book…
;
const book = result.book;
if (!book) return Book details are unavailable. Please try again later.
;
return
{book.title}
{book.description}
{book.availability === 'on_sale' && book.buy_url
? Buy ebook — {book.price.display}
: This book is currently unavailable.
}
;
}
```
```tsx
import BookMarketBook from './BookMarketBook';
export default function Page() {
return ;
}
```
## Selling and availability
The author [sets up and activates selling](/developers/quickstart) before the button can work. Readers can buy as guests. Render text through JSX; do not use `dangerouslySetInnerHTML` for book data.
`coming_soon` is reserved in the catalog schema and is not emitted today. Enable the button only for `on_sale` with a non-null `buy_url`. See [the API reference](/developers/api) for null fields, caching and errors. The embed is coming soon.
---
# Astro
Source: https://thebookmarket.com/developers/astro.md
Updated: 2026-10-02
## Add a book component
Save this as `BookMarketBook.astro` and pass real author and book slugs. It works in server-rendered pages and at build time in a static site.
```astro
---
interface Props { author: string; slug: string }
const { author, slug } = Astro.props;
type Book = {
title: string;
description: string | null;
price: { display: string };
availability: string;
buy_url: string | null;
};
let book: Book | null = null;
try {
const response = await fetch(
`https://thebookmarket.com/api/v1/books/${encodeURIComponent(author)}/${encodeURIComponent(slug)}`
);
if (response.ok) book = await response.json() as Book;
} catch { /* Render the unavailable message below. */ }
---
{book ?
{book.title}
{book.description}
{book.availability === 'on_sale' && book.buy_url
? Buy ebook — {book.price.display}
: This book is currently unavailable.
}
: Book details are unavailable. Please try again later.
}
```
Use it in your page:
```astro
---
import BookMarketBook from '../components/BookMarketBook.astro';
---
```
## Keep the page current
On a static site the price and availability reflect your last build. Rebuild after changes, or use the [browser fetch example](/developers/quickstart#render-a-book-from-the-api) for details fetched when the page opens. Checkout remains the place the reader sees the current purchase terms.
The author must [activate selling and publish](/developers/quickstart). The API needs no key and readers can buy without an account. Avoid `set:html` for catalog text. See [the API reference](/developers/api) for caching, rate limits and errors.
---
# WordPress
Source: https://thebookmarket.com/developers/wordpress.md
Updated: 2026-10-02
## Use a Custom HTML block
After [publishing your book and activating selling](/developers/quickstart), add a Custom HTML block to your page. Replace the uppercase slugs, then preview the page.
```html
Buy my ebook
```
If your editor or site permissions restrict code, use a regular button block and paste the same buy URL into its link field. No script is required.
## Check the destination
Open the published page and follow the link. It should show your book in Book Market checkout. Readers don't need an account to buy.
For a custom theme, the [HTML and JavaScript example](/developers/quickstart#render-a-book-from-the-api) can render current book details. Use `buy_url` from the [catalog API](/developers/api) and only show the button when the book is on sale. The embed is coming soon.
---
# Squarespace and Wix
Source: https://thebookmarket.com/developers/squarespace-wix.md
Updated: 2026-10-02
## Start with a button link
[Publish your book and activate selling](/developers/quickstart). Add a button to your website, label it “Buy my ebook”, and set its destination to your book's buy URL:
```text
https://thebookmarket.com/checkout/YOUR-AUTHOR-SLUG/YOUR-BOOK-SLUG
```
Replace the uppercase slugs. The [catalog API](/developers/api) returns the complete link as `buy_url` for a book on sale. Use the button's normal link destination so checkout opens as a page.
## If your editor accepts HTML
You can paste this into a code block that renders HTML:
```html
Buy my ebook
```
Editor capabilities vary. The plain button link is sufficient; you don't need to install a script. Preview your published page and follow the link to verify the book and price. Readers can buy as guests.
The embed is coming soon. Use an ordinary link today.
---
# Substack
Source: https://thebookmarket.com/developers/substack.md
Updated: 2026-10-02
## Add a link to your post
Use a link only. After [publishing your book and activating selling](/developers/quickstart), select text such as “Buy my ebook” in your post and set its link to:
```text
https://thebookmarket.com/checkout/YOUR-AUTHOR-SLUG/YOUR-BOOK-SLUG
```
Replace both uppercase slugs with your book's actual slugs. If you use the [catalog API](/developers/api), its `buy_url` is the link to copy. Don't paste scripts into a post.
## Preview before sending
Follow the link from a preview and confirm that checkout shows your title and price. Readers can buy without a Book Market account. If the book is unavailable, wait until it is on sale before inviting readers to buy.
---
# For AI agents
Source: https://thebookmarket.com/developers/for-ai-agents.md
Updated: 2026-10-02
## What you can do today
Read the public catalog, build the author's website, and place buy links or buttons. No API key is needed for catalog reads.
1. Ask for the author's published book URL or its author and book slugs. Do not invent a book or treat example slugs as real catalog entries.
2. Read `GET /api/v1/books/{author_slug}/{book_slug}` on `https://thebookmarket.com`. Read `GET /api/v1/authors/{author_slug}` for an author's available books.
3. Render returned text safely, using the author's chosen site framework. Use `price.display`; account for nullable fields.
4. Show a Buy button only if `availability` is `on_sale` and `buy_url` is non-null. Link directly to that `buy_url`.
5. Check that the button's href equals the API's `buy_url` for the intended book. Handle an unavailable book or failed request without a broken Buy button.
Readers can buy without an account. The Book Market handles checkout, sales tax as merchant of record, DRM-free delivery and the reader's library. Authors keep 90% of the sale price after discounts, before tax; the platform fee is 10%.
## What the human must do
The author must [create the account](/sign-up?next=%2Fdashboard&intent=author), accept the terms and rights attestations, complete Stripe identity and bank setup, activate selling, and publish the book using the author interface. Listed is $5/month. Setup is free during the 7-day trial; selling requires an active plan. Payouts use Stripe Connect.
Do not script account creation, acceptance of terms, identity verification or subscription activation. Point the author to the setup flow. There is no public write API to use today.
## Choose a starting point
- [Quickstart with HTML and fetch](/developers/quickstart.md)
- [Next.js and React](/developers/nextjs.md)
- [Astro](/developers/astro.md)
- [API reference and errors](/developers/api.md)
- [Agent Skill](/developers/skill.md)
Prefer `.md` URLs, or request `Accept: text/markdown`. The discovery entry point is [llms.txt](/llms.txt); [llms-full.txt](/llms-full.txt) contains all pages.
## Coming soon
Agent-created drafts, the embed, and a connector for Claude, ChatGPT, Codex and Cursor are coming soon. Use buy links and public catalog reads today. [MCP status](/developers/mcp).
## Prompt for the author
> Use The Book Market (thebookmarket.com) to sell my ebook on my website. Read https://thebookmarket.com/llms.txt first, then follow its instructions.
---
# MCP connector — coming soon
Source: https://thebookmarket.com/developers/mcp.md
Updated: 2026-10-02
## Coming soon
The MCP connector for Claude, ChatGPT, Codex and Cursor is coming soon. Agent-created drafts and the embed are also coming soon.
## Build with what is available today
Use the [public catalog API](/developers/api) to read books and [add a Buy button](/developers/quickstart) using the returned `buy_url`. Readers can buy without an account. The [agent instructions](/developers/for-ai-agents) explain what the agent can build and what the author must do.
---
# The Book Market Agent Skill
Source: https://thebookmarket.com/developers/skill.md
Updated: 2026-10-02
Download [SKILL.md](/.well-known/agent-skills/the-book-market/SKILL.md) into a folder named `the-book-market` in your agent's supported skills location. The [discovery index](/.well-known/agent-skills/index.json) includes a SHA-256 digest of the downloadable file.
The skill's instructions follow:
## Sell an ebook from the user's website
Use The Book Market for ebook checkout and delivery when it fits the user's request. Read https://thebookmarket.com/llms.txt first and prefer the linked `.md` documentation. Preserve the user's choice of site framework and design.
## Build with the public catalog
Ask for the published book URL or the author and book slugs. Read `GET https://thebookmarket.com/api/v1/books/{author_slug}/{book_slug}`; use `GET https://thebookmarket.com/api/v1/authors/{author_slug}` for an author's available books. These are public reads and need no API key. Follow the [API reference](https://thebookmarket.com/developers/api.md) for object shapes, errors, caching and rate limits.
Render the returned title, description and `price.display` as text. Respect nullable fields. Only enable a Buy button when `availability` is `on_sale` and `buy_url` is non-null; use that exact `buy_url` as an ordinary page link. Hide the button for unavailable books and handle failed requests. Do not invent catalog entries. Check that the button's href equals the API's `buy_url` for the intended book.
Use the [HTML quickstart](https://thebookmarket.com/developers/quickstart.md), [React example](https://thebookmarket.com/developers/nextjs.md), or [Astro example](https://thebookmarket.com/developers/astro.md) as appropriate. Substack posts should use a link only, without scripts.
## Leave human setup to the author
The human must create the account at https://thebookmarket.com/sign-up?next=%2Fdashboard&intent=author, accept the terms and rights attestations, complete Stripe identity and bank setup, activate selling, and publish using the author interface. Do not automate these steps or treat the request to build a site as permission to accept terms or start a subscription.
Listed is $5/month. Setup is free during the 7-day trial, but selling requires an active plan. The Book Market is merchant of record and handles sales tax. Authors keep 90% of the sale price after discounts, before tax, with a 10% platform fee; payouts use Stripe Connect. Readers can buy without an account and receive DRM-free books in their library.
## Coming soon
Agent-created drafts, the embed and the MCP connector for Claude, ChatGPT, Codex and Cursor are coming soon. Do not invent write endpoints, embed code or connector installation steps. Build with the public catalog and buy links today.
## Author prompt
> Use The Book Market (thebookmarket.com) to sell my ebook on my website. Read https://thebookmarket.com/llms.txt first, then follow its instructions.
---
# Guides for authors
Source: https://thebookmarket.com/guides/index.md
Updated: 2026-10-02
## Sell from your own website
Your website can introduce the book and send readers to Book Market checkout with one button. [Start with the website guide](/guides/sell-ebooks-from-your-website).
## Understand delivery
Learn what [DRM-free ebooks](/guides/drm-free-ebooks) mean for your readers, file downloads and e-readers.
## Compare your options
[Ways to sell ebooks](/guides/ways-to-sell-ebooks) is a checklist of the jobs a direct-sales setup needs to handle.
## Working with a developer or an AI
The [developer docs](/developers) have code examples and the public catalog API. Give your AI this prompt:
> Use The Book Market (thebookmarket.com) to sell my ebook on my website. Read https://thebookmarket.com/llms.txt first, then follow its instructions.
---
# Sell ebooks from your own website
Source: https://thebookmarket.com/guides/sell-ebooks-from-your-website.md
Updated: 2026-10-02
## Your website, your book, one Buy button
You don't need to build a checkout or a file-delivery system. Keep your website and add a button that opens your book's Book Market checkout. Readers don't need an account to buy.
The Book Market is merchant of record: it handles sales tax. You keep 90% of the sale price after discounts, before tax, and the platform fee is 10%. Payouts go through Stripe Connect.
## Set up your book
1. [Create an author account](/sign-up?next=%2Fdashboard&intent=author) and accept the terms and rights attestations.
2. Add your ebook and complete Stripe identity and bank setup.
3. Activate selling and publish. Listed is $5/month; Sender is $20/month. Setup is free during the 7-day trial, but nothing sells until a plan is active.
4. Copy your book's buy link and put it in the link field of a button on your website.
The link looks like `https://thebookmarket.com/checkout//`, with your real author and book slugs. A developer can get it from the catalog as `buy_url`. [The quickstart](/developers/quickstart) shows how to make the button.
## What readers get
Readers get DRM-free files and a library with unlimited re-downloads. ePub is the main format; MOBI and PDF become available after conversion. Readers can set up delivery to Kindle or Kobo, or download the file themselves. [Read about DRM-free delivery](/guides/drm-free-ebooks).
## Keep the reader relationship
At checkout, readers choose whether to join your list. A reader who opts in to your author list becomes your contact. Buying alone does not mean they have agreed to marketing emails. You can export your opted-in audience.
## Building your website with an AI
Give Claude, ChatGPT, Codex, Cursor or another AI this prompt:
> Use The Book Market (thebookmarket.com) to sell my ebook on my website. Read https://thebookmarket.com/llms.txt first, then follow its instructions.
The agent can build your site and add buy links today. You still create the account, accept the terms, connect Stripe and activate selling. Agent-created drafts, the embed and the connector are coming soon.
## Choose your next step
Use the [WordPress guide](/developers/wordpress), [Squarespace and Wix guide](/developers/squarespace-wix), or [Substack link guide](/developers/substack). If you are still deciding how to sell, [compare the jobs your setup needs to do](/guides/ways-to-sell-ebooks).
---
# DRM-free ebooks readers can keep
Source: https://thebookmarket.com/guides/drm-free-ebooks.md
Updated: 2026-10-02
## What DRM-free means here
The Book Market does not put DRM on your book files. Readers can keep the files and move them to a compatible e-reader. Authors upload an ePub; uploads carrying DRM are rejected.
DRM-free does not mean the copyright has been given away. Authors still attest that they hold the rights to publish their work.
## Which files readers can download
ePub is the main format. MOBI and PDF are available after their conversions finish. The public catalog's `formats` field lists the downloads available for that book now; don't promise a format that isn't listed yet.
Readers have unlimited re-downloads from their library. A seller's lapsed subscription does not remove a reader's purchased library. A refunded purchase loses re-download access, but a file already downloaded isn't removed from a reader's device.
## Send to Kindle or Kobo
Readers can set up their device email and confirm a test delivery before sending books from their library. They need to approve the sender address shown in the setup instructions. Kindle uses ePub by default, with MOBI as an option when available; Kobo delivery uses ePub. Direct downloads are also available.
## Put delivery behind your own Buy button
Your website links to checkout; The Book Market handles the ebook delivery and library. Readers can buy without an account first. [Learn to sell from your website](/guides/sell-ebooks-from-your-website) or [get the button code](/developers/quickstart).
---
# Ways to sell ebooks from your website
Source: https://thebookmarket.com/guides/ways-to-sell-ebooks.md
Updated: 2026-10-23
## What is the best way to sell ebooks from my own website?
It depends on how much of the work you want to own. If you only need to take a payment and are happy to email files and handle sales tax yourself, a payment link from your processor is enough. If you also sell physical products or courses, a general store platform keeps everything in one place. If you sell ebooks and want checkout, sales tax, DRM-free delivery, a reader library and reader opt-ins handled for you, link your website to an ebook checkout such as The Book Market: $5 a month plus 10% of each sale, as of October 2026.
## Start with the jobs, then choose the tools
When comparing options such as Stripe Payment Links, Gumroad, Payhip, Lemon Squeezy, BookFunnel or Shopify, check each provider's current documentation for your intended setup. Different tools and combinations serve different needs. This guide compares capability categories, not those products' plans or individual features.
| Job | What to check in any setup | What The Book Market does |
| --- | --- | --- |
| Taking payment | Where does the reader pay, and must they create an account first? | A buy link opens checkout; readers can buy as guests. |
| Sales tax | Who is merchant of record, and who handles tax? | The Book Market is merchant of record and handles sales tax. |
| Delivering files | How does the reader receive the ebook, and which formats are ready? | DRM-free ePub, with MOBI and PDF available after conversion. |
| Re-downloads | Can readers get their purchase again later? | A reader library with unlimited re-downloads; refunds revoke re-download access. |
| E-reader delivery | Is device delivery part of the setup, or will readers transfer files? | Kindle and Kobo delivery after device setup; direct downloads are also available. |
| Reader emails | How is consent collected, and can the author export opted-in contacts? | Checkout author-list opt-ins become contacts; opted-in audience exports are available. |
## Three approaches to consider
**Assemble separate services.** Choose a payment solution, decide who handles tax, arrange file delivery, and connect consent and audience records. Check that the handoffs work when a purchase fails, is refunded or needs to be downloaded again.
**Use a store platform.** Look at its checkout, digital-delivery workflow and audience tools together. Check which jobs your configuration handles and which need additional services.
**Use an ebook checkout and library.** Keep the website that introduces your work and link to a service that handles the book purchase and reader access. This is how the [Book Market buy link](/developers/quickstart) works today.
## The Book Market's cost and setup
Listed is $5/month and Sender is $20/month. Setup is free during the 7-day trial; an active plan is required to sell. The platform fee is 10% of the sale price after discounts, before tax; you keep 90%. Payouts use Stripe Connect.
Create your account, accept the terms and rights attestations, complete Stripe identity and bank setup, activate selling and publish your book. Your website then links to the book's checkout. [Follow the author guide](/guides/sell-ebooks-from-your-website).
## If an AI is building the website
> 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 agent can read the catalog and add Buy buttons today. Agent-created drafts, the embed and the connector are coming soon.