apyhub
Back

Calculate Book Print Cost & Cover Size API

What it does

Calculate Book Print Cost & Cover Size helps you work out the numbers you need to print a paperback. Send the book's page count, trim size and pricing details, and get back structured results for cost, royalty and cover measurements.

Use the royalty endpoint to find the print cost per copy and the royalty you earn at a given list price. It also returns a table of royalties at nearby prices, and can work out the list price needed to hit a target royalty or how many copies you must sell to recover an upfront cost. Use the spine endpoint to calculate the spine width and the full wrap-cover size from the trim size, page count and paper thickness. It returns the cover in inches and pixels, the position of the back cover, spine and front cover, and warnings when the page count falls outside the printer's limits.

Both endpoints return warnings instead of hiding problems, such as a negative royalty or a very narrow spine. They fit pricing calculators, cover designers, automated cover generators and any tool that prepares books for print.

▣ ENDPOINT 01 / 02
POST
Book spine and cover size calculator
https://api.eu.apyhub.com/freedailypro/calculate-book-print-cost-cover/spine-width

QUICKSTART

GUIDE

Quickstart

Calculate the spine width for a print book by sending the required trim size, page count, and paper thickness.

curl -X POST "https://api.eu.apyhub.com/freedailypro/calculate-book-print-cost-cover/spine-width" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"trimWidthIn": 6, "trimHeightIn": 9, "pages": 200, "thicknessIn": 0.002252, "platform": "kdp"}'

What you'll get back

Returns a JSON object. The output schema does not declare any top-level fields, so the response shape is minimal and not specified here.

{
  "result": {
    "spineIn": 0.4504,
    "coverWidthIn": 12.7004,
    "coverHeightIn": 9.25,
    "pixels": {
      "width": 3811,
      "height": 2775,
      "dpi": 300
    },
    "panels": {
      "back": {
        "x": 0.125,
        "y": 0.125,
        "w": 6,
        "h": 9
      },
      "spine": {
        "x": 6.125,
        "y": 0.125,
        "w": 0.4504,
        "h": 9
      },
      "front": {
        "x": 6.5754,
        "y": 0.125,
        "w": 6,
        "h": 9
      }
    },
    "warnings": [],
    "platform": "kdp",
    "platformNote": "The spine and cover formula is the same for every platform. platform only changes the label in summary and, for kdp, the page-limit warning. Confirm bleed and thickness with your printer's own cover template.",
    "summary": "Cover size estimate for Amazon KDP. Confirm with the platform's own cover template.\nTrim: 6 x 9 in, 200 pages, 0.002252 in per page, bleed 0.125 in\nSpine width: 0.450 in (11.4 mm)\nFull cover width: 12.700 in (322.6 mm)\nFull cover height: 9.250 in (234.9 mm)\nAt 300 dpi: 3811 x 2775 px"
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Paper thickness in inches per page, for example 0.002252 for KDP white paper

About this endpoint

What it does

Calculates book spine and cover size values from the provided book dimensions and paper thickness. The request body includes trim size, page count, and thickness inputs; the success response schema is currently an object with no defined properties.

Request Body

ParameterTypeMandatoryDescription
trimWidthInNumberYesTrim width in inches.
trimHeightInNumberYesTrim height in inches.
pagesIntegerYesNumber of pages. Minimum: -9007199254740991, maximum: 9007199254740991.
thicknessInNumberYesPaper thickness in inches per page. Example given in schema: 0.002252 for KDP white paper.
dpiNumberNoDots per inch.
bleedInNumberNoBleed in inches.
platformENUMNoAllowed values: kdp, ingramspark, lulu.
spineAllowanceInNumberNoSpine allowance in inches.

Response

Returns a JSON object with a single result object holding the spine width, the full wrap-cover size in inches and pixels, the position of each cover panel, and a plain-text summary.

FieldTypeDescription
result.spineInnumberSpine width in inches: pages × thicknessIn plus spineAllowanceIn.
result.coverWidthInnumberFull cover width in inches: back cover, spine and front cover, plus bleed on both sides.
result.coverHeightInnumberFull cover height in inches, including bleed top and bottom.
result.pixels.widthnumberFull cover width in pixels at the chosen dpi.
result.pixels.heightnumberFull cover height in pixels at the chosen dpi.
result.pixels.dpinumberThe resolution used. Defaults to 300.
result.panels.backobjectThe back cover panel.
result.panels.spineobjectThe spine panel.
result.panels.frontobjectThe front cover panel.
result.panels.<panel>.xnumberDistance in inches from the left edge of the full cover, including bleed, to the panel's left edge.
result.panels.<panel>.ynumberDistance in inches from the top edge of the full cover, including bleed, to the panel's top edge.
result.panels.<panel>.wnumberPanel width in inches.
result.panels.<panel>.hnumberPanel height in inches.
result.warnings[]array of stringsMessages about the book, such as a page count outside the platform's limits or a very narrow spine. Empty when nothing looks wrong.
result.platformstringThe platform used for the label and page-limit check: kdp, ingramspark or lulu.
result.platformNotestringA reminder that the formula is the same for every platform and that you should confirm bleed and thickness with your printer's own cover template.
result.summarystringA multi-line plain-text summary with the trim, spine width, cover size in inches and millimetres, and pixel size.
▣ ENDPOINT 02 / 02
POST
Print cost and royalty calculator
https://api.eu.apyhub.com/freedailypro/calculate-book-print-cost-cover/print-royalty

QUICKSTART

GUIDE

Quickstart

Calculate the print royalty for a book using the required pricing fields.

curl -X POST "https://api.eu.apyhub.com/freedailypro/calculate-book-print-cost-cover/print-royalty" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pages":200,"fixedCharge":1,"perPageCharge":0.012,"method":"rate","percent":60,"listPrice":10}'

What you'll get back

Returns a JSON object.

{
  "result": {
    "printCostPerCopy": 3.4,
    "royaltyPerCopy": 2.6,
    "priceForTargetRoyalty": null,
    "copiesToRecoverUpfront": null,
    "priceTable": [
      { "price": 6, "royalty": 0.2, "margin": 3.3 },
      { "price": 7, "royalty": 0.8, "margin": 11.4 },
      { "price": 8, "royalty": 1.4, "margin": 17.5 },
      { "price": 9, "royalty": 2, "margin": 22.2 },
      { "price": 10, "royalty": 2.6, "margin": 26 },
      { "price": 11, "royalty": 3.2, "margin": 29.1 },
      { "price": 12, "royalty": 3.8, "margin": 31.7 },
      { "price": 13, "royalty": 4.4, "margin": 33.8 },
      { "price": 14, "royalty": 5, "margin": 35.7 }
    ],
    "warnings": []
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Calculates print cost and royalty inputs for a book from the values you provide in the request body. The endpoint accepts the book’s page count, pricing, charge, and royalty method fields, but the response schema is currently not defined beyond a generic object.

Request Body

ParameterTypeMandatoryDescription
pagesIntegerYesNumber of pages in the book. Minimum 1, maximum 2000.
methodENUMYesRoyalty calculation method. Allowed values: rate (royalty percent of list price), wholesale (discount given to retailers).
percentNumberYesPercentage value used by the calculator. Minimum 0, maximum 100.
listPriceNumberYesList price of the book. Minimum 0.
fixedChargeNumberYesFixed printing charge per copy. Minimum 0.
upfrontCostNumberNoUpfront cost. Minimum 0.
perPageChargeNumberYesCharge per page. Minimum 0.
targetRoyaltyNumberNoTarget royalty value.

Response

Returns a JSON object with a single result object holding the print cost, the royalty per copy, and a table of royalties at nearby prices.

FieldTypeDescription
result.printCostPerCopynumberPrint cost for one copy: fixedCharge plus pages × perPageCharge.
result.royaltyPerCopynumberRoyalty you earn on one copy at listPrice, after the print cost.
result.priceForTargetRoyaltynumber or nullThe list price needed to earn targetRoyalty per copy. null unless you send targetRoyalty.
result.copiesToRecoverUpfrontnumber or nullCopies you must sell to earn back upfrontCost. null unless you send upfrontCost.
result.priceTable[]arrayNine rows: your listPrice and four prices on each side, one unit apart.
result.priceTable[].pricenumberThe list price for this row.
result.priceTable[].royaltynumberRoyalty per copy at this price. Negative means a loss.
result.priceTable[].marginnumberRoyalty as a percentage of the price.
result.warnings[]array of stringsMessages when the numbers don't make sense together. Empty when nothing looks wrong.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.