API reference

OpenAPI 3.1 · curl, JavaScript, Python

Every route of the construction calculator API, ready to send

Generated from the engine’s OpenAPI description when the site is built: what each route takes, a worked request, the same request in three languages, and a form that sends it to the engine from this page.

  • 65Operations
  • 14Groups
  • 3.1OpenAPI
  • NoneKey or account

Before the first request

Base address
https://api.craftquantities.com/v1
Sign-in
None: no key, no account, no cookie. Requests are rate-limited per address for fair use.
Refusals
application/problem+json: a title, the status and each problem by input, with the values it accepts.
Answers
JSON, or the engine’s Markdown report with format=md. Quantities in metric and US customary, never a price.
Version
Engine 1.9.0. The changelog

OpenAPI descriptionPostman collection (Insomnia and Bruno import it too)

The parameters every route takes

ParameterDescription
detailsummary: the result lines, the citation and the page only (fewer tokens); full, the default: the whole answer. A POST body may carry detail instead.One of: full, summaryDefault: full
formatmd: the engine's Markdown report as text/markdown (or send Accept: text/markdown); json, the default.One of: json, md
Code samples in

Open: the engine’s answers (its JSON API, MCP server and npm package), the data files under /api/v1/ and the formula library (/formulas/) are published under CC BY 4.0: reuse them, commercially too, crediting “Craft Quantities” with a link. Reserved: the page text, the design and the software, the engine’s code included. The terms of use

Discovery

Find a calculator, takeoff or worked example by what the job is.

Calculators

One calculator: what it asks, its answer in both systems, its sources and a link to its page.

GET/v1/calculate/{slug}

Run a calculator (inputs in the query)

Every other query parameter is an input id, its value written with its unit where it measures something: slabLength=3%20m, slabThickness=4%20in.

ParameterInTypeDescription
slugrequiredpathstringThe calculator's slug, such as concrete-calculator.
systemquerystringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.One of: metric, imperialDefault: metric
marketquerystringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.One of: US, CA, UK, AU, INTL
inputUnitsquerystringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.One of: base
explainquerybooleantrue adds the working: the inputs as the calculator received them, every intermediate figure its own compute reports with its unit, the range check and the unit restatement, ending on the same figures. The answer's figures are identical either way.Default: false
drawingquerybooleantrue adds the page's drawing as SVG, for the calculators that draw one: the tile set-out (tile-layout-calculator), the deck plan with joists, butt joints and fixings (deck-board-calculator), the wall elevation course by course with its cuts, openings and lintels (brick-calculator, cmu-block-grout-calculator), the drywall hanging layout (drywall-calculator), the stud and plate layout (framing-stud-calculator), the siding face with its trim runs (siding-calculator), the gutter runs with joints and downspouts (gutter-calculator) and the fence elevation with posts, rails, gates and post concrete (fence-calculator). Worded in the system asked for; a setting-out aid, nothing sized. Other calculators refuse it.Default: false
langquerystringes or es-US: the answer in US Spanish (labels, units, result lines, the honest machine-translation label; /es/ links once the site publishes them). en, the default.One of: en, es, es-US, fr, fr-CA, pt, pt-BRDefault: en

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/calculate/concrete-calculator?slabLength=10%20ft&slabWidth=10%20ft&slabThickness=4%20in&system=imperial"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/calculate/concrete-calculator?slabLength=10%20ft&slabWidth=10%20ft&slabThickness=4%20in&system=imperial");
const answer = await response.json();
Python
import requests

response = requests.get(
    "https://api.craftquantities.com/v1/calculate/concrete-calculator",
    params={
        "slabLength": "10 ft",
        "slabWidth": "10 ft",
        "slabThickness": "4 in",
        "system": "imperial",
    },
)
answer = response.json()

POST/v1/calculate/{slug}

Run a calculator

ParameterInTypeDescription
slugrequiredpathstringThe calculator's slug, such as concrete-calculator.

Also takes detail, format: the parameters every route takes.

Request body (JSON)

FieldTypeDescription
inputsobjectThe calculator's input values, by input id (an unknown id is refused with the accepted ids). A length, area, volume or other measured input takes "12 ft", "3.5 m", "8' 3 1/2\"" or {"value": 12, "unit": "ft"}; a count or percentage takes a number; a select takes one of its option values. Inputs left out take the value the calculator's page opens on.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
explainbooleantrue adds the working: the inputs as the calculator received them, every intermediate figure its own compute reports with its unit, the range check and the unit restatement, ending on the same figures. The answer's figures are identical either way.
drawingbooleantrue adds the page's drawing as SVG, for the calculators that draw one: the tile set-out (tile-layout-calculator), the deck plan with joists, butt joints and fixings (deck-board-calculator), the wall elevation course by course with its cuts, openings and lintels (brick-calculator, cmu-block-grout-calculator), the drywall hanging layout (drywall-calculator), the stud and plate layout (framing-stud-calculator), the siding face with its trim runs (siding-calculator), the gutter runs with joints and downspouts (gutter-calculator) and the fence elevation with posts, rails, gates and post concrete (fence-calculator). Worded in the system asked for; a setting-out aid, nothing sized. Other calculators refuse it.
langstringThe answer's language. en (the default): as ever. es or es-US: US Spanish — labels, units, result lines and the honest machine-translation label from the site's Spanish pages, Spanish words read in a question or a trade term, and links to the /es/ pages once the site publishes them (until then the links stay English). fr or fr-CA (Canadian French, /fr/) and pt or pt-BR (Brazilian Portuguese, /pt/): the same from the site's French and Portuguese pages, figures with a decimal comma; each link names the translated page only once that page is published, otherwise the English page.
curl
curl -s -X POST "https://api.craftquantities.com/v1/calculate/concrete-calculator" \
  -H "Content-Type: application/json" \
  -d '{"inputs":{"slabLength":"10 ft","slabWidth":"10 ft","slabThickness":"4 in"},"system":"imperial"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/calculate/concrete-calculator", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "inputs": {
      "slabLength": "10 ft",
      "slabWidth": "10 ft",
      "slabThickness": "4 in"
    },
    "system": "imperial"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/calculate/concrete-calculator",
    json={
        "inputs": {
            "slabLength": "10 ft",
            "slabWidth": "10 ft",
            "slabThickness": "4 in",
        },
        "system": "imperial",
    },
)
answer = response.json()

GET/v1/describe/{slug}

A calculator's inputs, units, opening values, sources and version

ParameterInTypeDescription
slugrequiredpathstringThe calculator's slug, such as concrete-calculator.

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/describe/paint-calculator"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/describe/paint-calculator");
const answer = await response.json();
Python
import requests

response = requests.get("https://api.craftquantities.com/v1/describe/paint-calculator")
answer = response.json()

GET/v1/sources/{slug}

A calculator's sources and a citation

ParameterInTypeDescription
slugrequiredpathstringThe calculator's slug, such as concrete-calculator.

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/sources/concrete-calculator"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/sources/concrete-calculator");
const answer = await response.json();
Python
import requests

response = requests.get("https://api.craftquantities.com/v1/sources/concrete-calculator")
answer = response.json()

POST/v1/optimise-cuts

Optimise a cut list: pieces from stock lengths, or rectangles nested on sheets

Stateless: the cut list arrives and the plan goes back. The site's own optimiser, as its cut-list tool and the Construction Canvas run it.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
kindrequiredanylinear: lengths cut from stock lengths (studs, plates, joists, rafters, bars, trim, boards). sheet: rectangles nested on sheets (plasterboard or drywall, plywood, OSB, tiles).
materialanyWhat is cut, for the market's stock lengths or sheet sizes, saw kerf and grain when they are left out: timber (the default for linear), rebar or casing; plasterboard (the default for sheet), plywood, OSB or tile.
piecesrequiredarray of objectThe cut list: up to 200 lines and 3000 pieces (1500 for sheets) in all.
stockarray of number | string | objectlinear: the stock lengths on offer, each in any number, with units ("4.8 m", "16 ft"). Left out, the market's usual lengths for the material in the system asked for.
sheetsarray of objectsheet: the sheet sizes on offer (the plan takes the one that buys the least area). Left out, the market's usual size for the material.
kerfnumber | string | objectThe saw's kerf, charged on every piece (both ways on a sheet). Left out, the material's: 3 mm or 1/8 in for a saw, none for a bar shear or a board knife.
minOffcutnumber | string | objectlinear: the shortest offcut worth keeping; shorter ones count as waste. sheet: the smallest offcut (either way round) listed for reuse; left out, 300 mm (12 in) square.
trimnumber | string | objectsheet: cut off every sheet edge before nesting (a factory edge that is not clean). Left out, none.
modeanysheet: guillotine (the default), every cut edge to edge for a panel or track saw, with the cuts in order; free, also layouts needing plunge cuts (CNC).
bandAllowancenumber | string | objectsheet: tape added to every banded edge for trimming flush. Left out, none.
rotatebooleansheet: whether pieces may turn a quarter (no grain or strength axis to keep). Left out: yes for plasterboard and tiles, no for plywood and OSB.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/optimise-cuts" \
  -H "Content-Type: application/json" \
  -d '{"kind":"linear","material":"timber","pieces":[{"length":"2.326 m","count":24,"label":"stud"},{"length":"1.225 m","count":3,"label":"sill"},{"length":"8.9 m","count":3,"label":"plate","join":true}],"stock":["2.4 m","3 m","3.6 m","4.8 m"],"kerf":"3 mm","system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/optimise-cuts", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "kind": "linear",
    "material": "timber",
    "pieces": [
      {
        "length": "2.326 m",
        "count": 24,
        "label": "stud"
      },
      {
        "length": "1.225 m",
        "count": 3,
        "label": "sill"
      },
      {
        "length": "8.9 m",
        "count": 3,
        "label": "plate",
        "join": true
      }
    ],
    "stock": [
      "2.4 m",
      "3 m",
      "3.6 m",
      "4.8 m"
    ],
    "kerf": "3 mm",
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/optimise-cuts",
    json={
        "kind": "linear",
        "material": "timber",
        "pieces": [
            {
                "length": "2.326 m",
                "count": 24,
                "label": "stud",
            },
            {
                "length": "1.225 m",
                "count": 3,
                "label": "sill",
            },
            {
                "length": "8.9 m",
                "count": 3,
                "label": "plate",
                "join": True,
            },
        ],
        "stock": [
            "2.4 m",
            "3 m",
            "3.6 m",
            "4.8 m",
        ],
        "kerf": "3 mm",
        "system": "metric",
    },
)
answer = response.json()

POST/v1/compare-on-job

Compare two options on one job, with the crossover

Works both sides of a comparison page (LVP vs tile, paint vs wallpaper …) on one job: each side's quantity in both unit systems, allowance, weight and person-hours, the difference, and the crossover as one job figure is swept. Each calculator runs as its page runs it. No prices. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 65,536 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
comparisonrequiredstringA comparison page's slug, such as lvp-vs-tile or paint-vs-wallpaper.
jobobjectThe job's figures by field id, each length or area with its unit ("14 ft", {"value": 4.2, "unit": "m"}), a count or pitch as a number, a choice as its option value. Fields left out open at the page's own figure.
sweepstringThe job field the crossover chart sweeps; the page's own when left out.
pointsintegerSample points across the swept field's range.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/compare-on-job" \
  -H "Content-Type: application/json" \
  -d '{"comparison":"paint-vs-wallpaper","job":{"roomLength":"4 m","roomWidth":"3.5 m","wallHeight":"2.4 m"},"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/compare-on-job", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "comparison": "paint-vs-wallpaper",
    "job": {
      "roomLength": "4 m",
      "roomWidth": "3.5 m",
      "wallHeight": "2.4 m"
    },
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/compare-on-job",
    json={
        "comparison": "paint-vs-wallpaper",
        "job": {
            "roomLength": "4 m",
            "roomWidth": "3.5 m",
            "wallHeight": "2.4 m",
        },
        "system": "metric",
    },
)
answer = response.json()

POST/v1/guide-chain

Run a guide's "Try the calculation" with your figures

Runs a how-to guide's "Try the calculation" block on the figures given: each step's calculator in the guide's order, what to buy with waste and order quantities, both unit systems, person-hours, and the guide's link opening the block on these figures. No prices; nothing sized. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 65,536 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
guiderequiredstringA guide's slug whose page has a "Try the calculation" block, such as how-to-board-a-loft-over-insulation.
measurementsobjectMeasurement id → value, each length, area or volume with its unit; counts as numbers. Any left out opens at the guide's own figure.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/guide-chain" \
  -H "Content-Type: application/json" \
  -d '{"guide":"how-to-board-a-loft-over-insulation","measurements":{"length":"5 m","width":"2.4 m","centres":"600 mm"},"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/guide-chain", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "guide": "how-to-board-a-loft-over-insulation",
    "measurements": {
      "length": "5 m",
      "width": "2.4 m",
      "centres": "600 mm"
    },
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/guide-chain",
    json={
        "guide": "how-to-board-a-loft-over-insulation",
        "measurements": {
            "length": "5 m",
            "width": "2.4 m",
            "centres": "600 mm",
        },
        "system": "metric",
    },
)
answer = response.json()

POST/v1/stair

Stair layout: straight, turned, concrete or steel

Lays out a flight as built: risers, goings, pitch, 2R+G, the floor opening for a headroom, the stringer as cut, timber and fixings (straight, landing or winders), or concrete and bars, or steel mass; both systems, limits read against a named code, a canvas link. Not sized. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 65,536 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
kindrequiredanystraight: one timber flight; turned: an L or U on a landing or winders; concrete: a cast flight; steel: steel stringers with treads.
inputsobjectThe stair page's inputs by id (totalRise, targetRiser, going, buildingCode …), each length with its unit; any left out opens at the page's own figure.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/stair" \
  -H "Content-Type: application/json" \
  -d '{"kind":"straight","inputs":{"totalRise":"2.8 m","buildingCode":"uk"},"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/stair", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "kind": "straight",
    "inputs": {
      "totalRise": "2.8 m",
      "buildingCode": "uk"
    },
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/stair",
    json={
        "kind": "straight",
        "inputs": {
            "totalRise": "2.8 m",
            "buildingCode": "uk",
        },
        "system": "metric",
    },
)
answer = response.json()

Units

Conversions by the exact factors the calculators use.

GET/v1/convert

Convert a value between units with the site's exact factors

ParameterInTypeDescription
valuerequiredquerynumber
fromrequiredquerystring
torequiredquerystring
dimensionquerystring

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/convert?value=10&from=ft&to=m"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/convert?value=10&from=ft&to=m");
const answer = await response.json();
Python
import requests

response = requests.get(
    "https://api.craftquantities.com/v1/convert",
    params={
        "value": "10",
        "from": "ft",
        "to": "m",
    },
)
answer = response.json()

Takeoffs

A whole job worked row by row, as its takeoff page works it.

GET/v1/takeoff/{id}

A whole-job takeoff's measurements, build-up choices and calculators

ParameterInTypeDescription
idrequiredpathstring

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/takeoff/concrete-slab"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/takeoff/concrete-slab");
const answer = await response.json();
Python
import requests

response = requests.get("https://api.craftquantities.com/v1/takeoff/concrete-slab")
answer = response.json()

GET/v1/takeoff/{id}/run

Work a takeoff (measurements in the query, build-up choices as v.{choice})

The same query the takeoff page's own link carries: each measurement under its id, written with its unit; each build-up choice as v.{choice}={option}.

ParameterInTypeDescription
idrequiredpathstring
systemquerystringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.One of: metric, imperialDefault: metric
marketquerystringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.One of: US, CA, UK, AU, INTL
inputUnitsquerystringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.One of: base

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/takeoff/concrete-slab/run?length=6%20m&width=4%20m&thickness=100%20mm&system=metric"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/takeoff/concrete-slab/run?length=6%20m&width=4%20m&thickness=100%20mm&system=metric");
const answer = await response.json();
Python
import requests

response = requests.get(
    "https://api.craftquantities.com/v1/takeoff/concrete-slab/run",
    params={
        "length": "6 m",
        "width": "4 m",
        "thickness": "100 mm",
        "system": "metric",
    },
)
answer = response.json()

POST/v1/takeoff/{id}/run

Work a takeoff

ParameterInTypeDescription
idrequiredpathstring

Also takes detail, format: the parameters every route takes.

Request body (JSON)

FieldTypeDescription
measurementsobjectMeasurement id → value, each length, area or volume with its unit ("12 ft", {"value": 3.6, "unit": "m"}); counts as numbers. Ids are those of the takeoff; any left out opens at the page's own figure.
selectionobjectBuild-up choice id → option id, the takeoff's own (a stud size, an insulation, a cladding). Choices left out take the page's own for the system.
allowancesobjectRow → an allowance the reader sets: a percentage (cutting waste, overlap), or the option an allowance follows (a lay pattern). Row names are the takeoff's steps (the calculator slug, or the step key where one runs twice).
leaveOutarray of stringRows the reader leaves out of the job: still worked and shown, not put in the project or counted in labour.
addOnsarray of stringOptional add-on rows to turn on (gutters on a roof job). Add-ons are off unless named here; an add-on's own followers (downspouts with the gutters) come in with it.
supplyOwnFixingsbooleanTrue leaves every accessory row (fixings, sealants, trims, tapes, primers…) out of the job: still worked and shown, not put in the project or counted in labour.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/takeoff/concrete-slab/run" \
  -H "Content-Type: application/json" \
  -d '{"measurements":{"length":"6 m","width":"4 m","thickness":"100 mm"},"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/takeoff/concrete-slab/run", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "measurements": {
      "length": "6 m",
      "width": "4 m",
      "thickness": "100 mm"
    },
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/takeoff/concrete-slab/run",
    json={
        "measurements": {
            "length": "6 m",
            "width": "4 m",
            "thickness": "100 mm",
        },
        "system": "metric",
    },
)
answer = response.json()

POST/v1/job-sheet

One-page job sheet for the van

The one-page job sheet a takeoff page prints for the van: the job's picture as SVG, key dimensions in metric and imperial, the build-up, each line going in with what to buy, labour hours by trade, and the link reopening the page on these figures. Words and figures for the PDF; no prices. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 65,536 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
takeoffrequiredstringThe takeoff's id, such as concrete-slab or stud-wall.
measurementsobjectMeasurement id → value, each length, area or volume with its unit ("12 ft", {"value": 3.6, "unit": "m"}); counts as numbers. Ids are those of the takeoff; any left out opens at the page's own figure.
selectionobjectBuild-up choice id → option id, the takeoff's own (a stud size, an insulation, a cladding). Choices left out take the page's own for the system.
leaveOutarray of stringRows the reader leaves out of the job: still worked and shown, not put in the project or counted in labour.
addOnsarray of stringOptional add-on rows to turn on (gutters on a roof job). Add-ons are off unless named here; an add-on's own followers (downspouts with the gutters) come in with it.
supplyOwnFixingsbooleanTrue leaves every accessory row (fixings, sealants, trims, tapes, primers…) out of the job: still worked and shown, not put in the project or counted in labour.
paperanyThe sheet's paper; the market's when left out.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/job-sheet" \
  -H "Content-Type: application/json" \
  -d '{"takeoff":"concrete-slab","measurements":{"length":"6 m","width":"4 m","thickness":"100 mm"},"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/job-sheet", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "takeoff": "concrete-slab",
    "measurements": {
      "length": "6 m",
      "width": "4 m",
      "thickness": "100 mm"
    },
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/job-sheet",
    json={
        "takeoff": "concrete-slab",
        "measurements": {
            "length": "6 m",
            "width": "4 m",
            "thickness": "100 mm",
        },
        "system": "metric",
    },
)
answer = response.json()

POST/v1/plan-set-takeoff

Take off plan sheets: counts, lengths, areas per layer

Totals a set of drawing sheets as the plan takeoff does: each sheet with its own scale (from a known line, or pixels per mm), counts, lengths and areas read off them in the sheet's pixels, layers adding up across the sheets; returns each layer's total and each sheet's share in metric and US units, unscaled marks left out and named. Points in, no picture; not sized. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
namestringThe set's name (default Plan set).
sheetsrequiredarray of objectThe sheets, each with its scale and its marks. At most 500 marks and 20,000 points in all.
systemstringThe system lengths are read in (both are returned).
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/plan-set-takeoff" \
  -H "Content-Type: application/json" \
  -d '{"name":"House A","sheets":[{"name":"Ground floor","scale":{"line":[[100,100],[1100,100]],"length":"5 m"},"marks":[{"layer":"Outlets","kind":"count","countType":"outlet","points":[[200,300],[400,300],[600,300],[800,500]]},{"layer":"Partition walls","kind":"length","points":[[100,600],[1100,600],[1100,1000]]}]},{"name":"First floor","scale":{"pixelsPerMm":0.1},"marks":[{"layer":"Outlets","kind":"count","countType":"outlet","points":[[150,150],[450,150],[750,150]]},{"layer":"Partition walls","kind":"length","points":[[0,0],[400,0]]}]}],"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/plan-set-takeoff", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "House A",
    "sheets": [
      {
        "name": "Ground floor",
        "scale": {
          "line": [
            [
              100,
              100
            ],
            [
              1100,
              100
            ]
          ],
          "length": "5 m"
        },
        "marks": [
          {
            "layer": "Outlets",
            "kind": "count",
            "countType": "outlet",
            "points": [
              [
                200,
                300
              ],
              [
                400,
                300
              ],
              [
                600,
                300
              ],
              [
                800,
                500
              ]
            ]
          },
          {
            "layer": "Partition walls",
            "kind": "length",
            "points": [
              [
                100,
                600
              ],
              [
                1100,
                600
              ],
              [
                1100,
                1000
              ]
            ]
          }
        ]
      },
      {
        "name": "First floor",
        "scale": {
          "pixelsPerMm": 0.1
        },
        "marks": [
          {
            "layer": "Outlets",
            "kind": "count",
            "countType": "outlet",
            "points": [
              [
                150,
                150
              ],
              [
                450,
                150
              ],
              [
                750,
                150
              ]
            ]
          },
          {
            "layer": "Partition walls",
            "kind": "length",
            "points": [
              [
                0,
                0
              ],
              [
                400,
                0
              ]
            ]
          }
        ]
      }
    ],
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/plan-set-takeoff",
    json={
        "name": "House A",
        "sheets": [
            {
                "name": "Ground floor",
                "scale": {
                    "line": [
                        [
                            100,
                            100,
                        ],
                        [
                            1100,
                            100,
                        ],
                    ],
                    "length": "5 m",
                },
                "marks": [
                    {
                        "layer": "Outlets",
                        "kind": "count",
                        "countType": "outlet",
                        "points": [
                            [
                                200,
                                300,
                            ],
                            [
                                400,
                                300,
                            ],
                            [
                                600,
                                300,
                            ],
                            [
                                800,
                                500,
                            ],
                        ],
                    },
                    {
                        "layer": "Partition walls",
                        "kind": "length",
                        "points": [
                            [
                                100,
                                600,
                            ],
                            [
                                1100,
                                600,
                            ],
                            [
                                1100,
                                1000,
                            ],
                        ],
                    },
                ],
            },
            {
                "name": "First floor",
                "scale": {
                    "pixelsPerMm": 0.1,
                },
                "marks": [
                    {
                        "layer": "Outlets",
                        "kind": "count",
                        "countType": "outlet",
                        "points": [
                            [
                                150,
                                150,
                            ],
                            [
                                450,
                                150,
                            ],
                            [
                                750,
                                150,
                            ],
                        ],
                    },
                    {
                        "layer": "Partition walls",
                        "kind": "length",
                        "points": [
                            [
                                0,
                                0,
                            ],
                            [
                                400,
                                0,
                            ],
                        ],
                    },
                ],
            },
        ],
        "system": "metric",
    },
)
answer = response.json()

Worked examples

The site's published examples, re-run now against their pinned figures.

GET/v1/example/{slug}

A worked example as published

ParameterInTypeDescription
slugrequiredpathstringThe calculator's slug, such as concrete-calculator.

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/example/bathroom-gutted-and-retiled"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/example/bathroom-gutted-and-retiled");
const answer = await response.json();
Python
import requests

response = requests.get("https://api.craftquantities.com/v1/example/bathroom-gutted-and-retiled")
answer = response.json()

GET/v1/example/{slug}/run

Re-run a worked example's pinned steps

ParameterInTypeDescription
slugrequiredpathstringThe calculator's slug, such as concrete-calculator.

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/example/bathroom-gutted-and-retiled/run"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/example/bathroom-gutted-and-retiled/run");
const answer = await response.json();
Python
import requests

response = requests.get("https://api.craftquantities.com/v1/example/bathroom-gutted-and-retiled/run")
answer = response.json()

POST/v1/example-live

Re-run a worked example with changed figures

Re-runs a worked example with the job's figures changed: each change follows down every step that reads it, each step beside its published figure with the difference, both unit systems, the project lines with offered hours, and a link reopening it. A modelled job; no prices. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 65,536 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
examplerequiredstringA worked example's slug, such as attached-deck-built.
figuresobjectThe job's own figures by id (a deck's length, a room's height), each length or area with its unit; a count as a number. They follow down every step that reads them.
inputsobjectOne step's own input, keyed "<step index>.<input id>" ("3.wastePercent"), each with its unit where it has one.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/example-live" \
  -H "Content-Type: application/json" \
  -d '{"example":"bathroom-gutted-and-retiled","figures":{"length":"4.5 m","width":"3 m"}}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/example-live", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "example": "bathroom-gutted-and-retiled",
    "figures": {
      "length": "4.5 m",
      "width": "3 m"
    }
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/example-live",
    json={
        "example": "bathroom-gutted-and-retiled",
        "figures": {
            "length": "4.5 m",
            "width": "3 m",
        },
    },
)
answer = response.json()

Planner

The room-by-room planner: one space, or several and a roof.

GET/v1/planner/{kind}

The planner's ids for one kind of space

ParameterInTypeDescription
kindrequiredpathstringThe kind of space: a room or a bathroom (from its size, doors and windows), or a slab, deck, driveway, fence, loft, retaining wall, exterior wall, stair, patio, lawn, raised bed (garden-bed), pergola, garden wall, shed, gutter run, partition wall, basement wall, kitchen run, pitched roof, garage floor, closet, strip footing, pond or swimming pool (pool).One of: room, bathroom, slab, deck, driveway, fence, loft, retaining-wall, exterior-wall, stair, patio, lawn, garden-bed, pergola, garden-wall, shed, gutter, partition-wall, basement-wall, kitchen, pitched-roof, garage-floor, closet, strip-footing, pond, pool

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/planner/deck"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/planner/deck");
const answer = await response.json();
Python
import requests

response = requests.get("https://api.craftquantities.com/v1/planner/deck")
answer = response.json()

POST/v1/plan

Plan a room or another space

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
kindrequiredstringThe kind of space: a room or a bathroom (from its size, doors and windows), or a slab, deck, driveway, fence, loft, retaining wall, exterior wall, stair, patio, lawn, raised bed (garden-bed), pergola, garden wall, shed, gutter run, partition wall, basement wall, kitchen run, pitched roof, garage floor, closet, strip footing, pond or swimming pool (pool).
figuresrequiredobjectThe space's figures, by the planner's ids, each a length with its unit (a room: length, width, height, wallThickness; a fence: length, height; a stair: totalRise, width …).
doorsobject
windowsobject
finishesobjectSurface role → finish id, by the planner's ids.
scopeobjectScope question name → answer value, by the planner's ids.
intentstringA trade, or everything.
leaveOutarray of stringBranch ids to leave out.
inputsobjectBranch id → { calculator input id: value in its base unit }.
namestring
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/plan" \
  -H "Content-Type: application/json" \
  -d '{"kind":"room","figures":{"length":"4 m","width":"3 m","height":"2.4 m"},"doors":{"count":1},"windows":{"count":2},"name":"Bedroom"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/plan", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "kind": "room",
    "figures": {
      "length": "4 m",
      "width": "3 m",
      "height": "2.4 m"
    },
    "doors": {
      "count": 1
    },
    "windows": {
      "count": 2
    },
    "name": "Bedroom"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/plan",
    json={
        "kind": "room",
        "figures": {
            "length": "4 m",
            "width": "3 m",
            "height": "2.4 m",
        },
        "doors": {
            "count": 1,
        },
        "windows": {
            "count": 2,
        },
        "name": "Bedroom",
    },
)
answer = response.json()

POST/v1/plan-project

Plan several spaces and a roof together

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
spacesrequiredarray of objectThe spaces, in order, each one planned space.
roofobject
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/plan-project" \
  -H "Content-Type: application/json" \
  -d '{"spaces":[{"kind":"room","name":"Bedroom","figures":{"length":"4 m","width":"3 m","height":"2.4 m"},"doors":{"count":1},"windows":{"count":2}},{"kind":"bathroom","figures":{"length":"2.5 m","width":"2 m","height":"2.4 m"},"doors":{"count":1}}],"roof":{"pitch":6}}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/plan-project", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "spaces": [
      {
        "kind": "room",
        "name": "Bedroom",
        "figures": {
          "length": "4 m",
          "width": "3 m",
          "height": "2.4 m"
        },
        "doors": {
          "count": 1
        },
        "windows": {
          "count": 2
        }
      },
      {
        "kind": "bathroom",
        "figures": {
          "length": "2.5 m",
          "width": "2 m",
          "height": "2.4 m"
        },
        "doors": {
          "count": 1
        }
      }
    ],
    "roof": {
      "pitch": 6
    }
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/plan-project",
    json={
        "spaces": [
            {
                "kind": "room",
                "name": "Bedroom",
                "figures": {
                    "length": "4 m",
                    "width": "3 m",
                    "height": "2.4 m",
                },
                "doors": {
                    "count": 1,
                },
                "windows": {
                    "count": 2,
                },
            },
            {
                "kind": "bathroom",
                "figures": {
                    "length": "2.5 m",
                    "width": "2 m",
                    "height": "2.4 m",
                },
                "doors": {
                    "count": 1,
                },
            },
        ],
        "roof": {
            "pitch": 6,
        },
    },
)
answer = response.json()

POST/v1/sketch-room

Measure a sketched room from its corners, and its materials

Measures a room drawn as a polygon of corners (any shape: L, U, angled walls) with its doors, windows and ceiling height, as the Sketch-to-Takeoff page does: floor and ceiling area, perimeter, each wall's length, gross and net wall area, in metric and imperial; a link that opens it drawn on the site; and, for four to eight square corners, the room planner's material lines (paint, flooring, skirting, plasterboard). Quantities only: no prices. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
cornersrequiredarray of objectThe room's corners in order round the room, in `unit` (walls run corner to corner and back to the first). Example, a 4 × 3 m room: [{x:0,y:0},{x:4,y:0},{x:4,y:3},{x:0,y:3}].
unitanyThe unit of every coordinate, the height and the openings: m for metric and ft for imperial when left out.
yAxisanydown (the default): y grows down the page, as a screen draws it; up: as a drawing's grid. Only the drawing's mirror changes, not a figure.
heightnumberThe ceiling height in `unit` (2.5 m or 8 ft when left out).
openingsarray of objectDoors and windows, each on one wall.
finishobjectWhat the room planner works out for the room, as the sketch page's own finish choices.
materialsbooleanAlso run the room planner on the room (four to eight square corners) for every material line. false: the measurements only.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
curl
curl -s -X POST "https://api.craftquantities.com/v1/sketch-room" \
  -H "Content-Type: application/json" \
  -d '{"corners":[{"x":0,"y":0},{"x":5,"y":0},{"x":5,"y":2},{"x":3,"y":2},{"x":3,"y":4},{"x":0,"y":4}],"unit":"m","height":2.5,"openings":[{"kind":"door","wall":5},{"kind":"window","wall":0}],"finish":{"walls":"paint","ceiling":"paint","floor":"click","board":"none"},"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/sketch-room", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "corners": [
      {
        "x": 0,
        "y": 0
      },
      {
        "x": 5,
        "y": 0
      },
      {
        "x": 5,
        "y": 2
      },
      {
        "x": 3,
        "y": 2
      },
      {
        "x": 3,
        "y": 4
      },
      {
        "x": 0,
        "y": 4
      }
    ],
    "unit": "m",
    "height": 2.5,
    "openings": [
      {
        "kind": "door",
        "wall": 5
      },
      {
        "kind": "window",
        "wall": 0
      }
    ],
    "finish": {
      "walls": "paint",
      "ceiling": "paint",
      "floor": "click",
      "board": "none"
    },
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/sketch-room",
    json={
        "corners": [
            {
                "x": 0,
                "y": 0,
            },
            {
                "x": 5,
                "y": 0,
            },
            {
                "x": 5,
                "y": 2,
            },
            {
                "x": 3,
                "y": 2,
            },
            {
                "x": 3,
                "y": 4,
            },
            {
                "x": 0,
                "y": 4,
            },
        ],
        "unit": "m",
        "height": 2.5,
        "openings": [
            {
                "kind": "door",
                "wall": 5,
            },
            {
                "kind": "window",
                "wall": 0,
            },
        ],
        "finish": {
            "walls": "paint",
            "ceiling": "paint",
            "floor": "click",
            "board": "none",
        },
        "system": "metric",
    },
)
answer = response.json()

House and canvas

The House Estimator and the Construction Canvas: a drawn house and everything it is built from, a sketch measured from its points, a drawing as DXF and SVG, and a reinforcement layout.

GET/v1/house

Estimate a house (example, system and figures in the query)

Every parameter other than example, system, storeys, family, pitch, roofFamily and inputUnits is a figure of the form, written with its unit.

ParameterInTypeDescription
examplequerystring
systemquerystringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.One of: metric, imperialDefault: metric
storeysqueryintegerOne of: 1, 2
familyquerystringOne of: wall.framed-exterior, wall.masonry, wall.sip
pitchquerystringRoof pitch, rise in 12.One of: 4, 6, 8, 10, 12
roofFamilyquerystringOne of: roof.asphalt-shingle, roof.tile-slate

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/house?length=12%20m&width=8%20m&windows=6&outsideDoors=2&storeys=1&system=metric"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/house?length=12%20m&width=8%20m&windows=6&outsideDoors=2&storeys=1&system=metric");
const answer = await response.json();
Python
import requests

response = requests.get(
    "https://api.craftquantities.com/v1/house",
    params={
        "length": "12 m",
        "width": "8 m",
        "windows": "6",
        "outsideDoors": "2",
        "storeys": "1",
        "system": "metric",
    },
)
answer = response.json()

POST/v1/house

Estimate a house

Also takes detail, format: the parameters every route takes.

Request body (JSON)

FieldTypeDescription
examplestringStart from one of the site's example houses (its slug) in place of the estimator's opening house.
valuesobjectThe form's figures, each length with its unit: length, width, storeyHeight, eaveOverhang, rakeOverhang, slabThickness, footingWidth, footingDepth, trenchDepth, windowWidth, windowHeight, doorWidth, doorHeight ("12 m", "40 ft"); and the counts partitions, windows, outsideDoors, interiorDoors, iceDamEaves. Any left out opens where the page opens it.
storeysinteger
familystring
selectionobjectThe exterior wall's build-up choices.
pitchstringRoof pitch, rise in 12.
roofFamilystring
roofSelectionobject
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/house" \
  -H "Content-Type: application/json" \
  -d '{"storeys":1,"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/house", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "storeys": 1,
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/house",
    json={
        "storeys": 1,
        "system": "metric",
    },
)
answer = response.json()

POST/v1/drawing

Draw a house on the Construction Canvas

Exactly one of house, commands or document. Returns the canvas document, everything the canvas lists for it, and a My Project file carrying the drawing.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
houseobjectThe House Estimator's form: the house drawn as the estimator draws it.
commandsarray of objectDrawing commands, in order, on the canvas's blank drawing (one storey; the wall, partition, window and door types). The whole request is at most 64 KiB.
documentobjectA Construction Canvas document (schema 1 to the canvas's current), opened and checked by the canvas's own opener.
shapesarray of objectSimple shapes the assistant has read from the reader's words — a room, a deck, a patio, a bed, a path, a fence of legs and turns — compiled into the canvas's own commands. Every length with its unit.
layoutobjectRooms by name, size and which room each stands against, laid out on a grid: shared walls drawn once as partitions, every snap or move reported, and each room checked to close.
templatestringA Construction Canvas template's slug (the template index lists them: single-room, deck, two-car-garage …): the drawing its page shows, in the reader's system, with a link that opens it.
variantstringWith template: one of its two "what changes if" variants, by id; a wrong one is refused with the template's own list.
namestringThe project's name in the file.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/drawing" \
  -H "Content-Type: application/json" \
  -d '{"commands":[{"op":"wall","ref":"south","from":{"x":"0 m","y":"0 m"},"to":{"x":"6 m","y":"0 m"}},{"op":"wall","from":{"x":"6 m","y":"0 m"},"to":{"x":"6 m","y":"4 m"}},{"op":"wall","from":{"x":"6 m","y":"4 m"},"to":{"x":"0 m","y":"4 m"}},{"op":"wall","from":{"x":"0 m","y":"4 m"},"to":{"x":"0 m","y":"0 m"}},{"op":"opening","kind":"door","wall":"south","offset":"1.5 m","p":{"exterior":true}},{"op":"opening","kind":"window","wall":"south","offset":"4 m"},{"op":"room","name":"Studio","at":{"x":"3 m","y":"2 m"}}],"name":"Studio","system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/drawing", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "commands": [
      {
        "op": "wall",
        "ref": "south",
        "from": {
          "x": "0 m",
          "y": "0 m"
        },
        "to": {
          "x": "6 m",
          "y": "0 m"
        }
      },
      {
        "op": "wall",
        "from": {
          "x": "6 m",
          "y": "0 m"
        },
        "to": {
          "x": "6 m",
          "y": "4 m"
        }
      },
      {
        "op": "wall",
        "from": {
          "x": "6 m",
          "y": "4 m"
        },
        "to": {
          "x": "0 m",
          "y": "4 m"
        }
      },
      {
        "op": "wall",
        "from": {
          "x": "0 m",
          "y": "4 m"
        },
        "to": {
          "x": "0 m",
          "y": "0 m"
        }
      },
      {
        "op": "opening",
        "kind": "door",
        "wall": "south",
        "offset": "1.5 m",
        "p": {
          "exterior": true
        }
      },
      {
        "op": "opening",
        "kind": "window",
        "wall": "south",
        "offset": "4 m"
      },
      {
        "op": "room",
        "name": "Studio",
        "at": {
          "x": "3 m",
          "y": "2 m"
        }
      }
    ],
    "name": "Studio",
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/drawing",
    json={
        "commands": [
            {
                "op": "wall",
                "ref": "south",
                "from": {
                    "x": "0 m",
                    "y": "0 m",
                },
                "to": {
                    "x": "6 m",
                    "y": "0 m",
                },
            },
            {
                "op": "wall",
                "from": {
                    "x": "6 m",
                    "y": "0 m",
                },
                "to": {
                    "x": "6 m",
                    "y": "4 m",
                },
            },
            {
                "op": "wall",
                "from": {
                    "x": "6 m",
                    "y": "4 m",
                },
                "to": {
                    "x": "0 m",
                    "y": "4 m",
                },
            },
            {
                "op": "wall",
                "from": {
                    "x": "0 m",
                    "y": "4 m",
                },
                "to": {
                    "x": "0 m",
                    "y": "0 m",
                },
            },
            {
                "op": "opening",
                "kind": "door",
                "wall": "south",
                "offset": "1.5 m",
                "p": {
                    "exterior": True,
                },
            },
            {
                "op": "opening",
                "kind": "window",
                "wall": "south",
                "offset": "4 m",
            },
            {
                "op": "room",
                "name": "Studio",
                "at": {
                    "x": "3 m",
                    "y": "2 m",
                },
            },
        ],
        "name": "Studio",
        "system": "metric",
    },
)
answer = response.json()

POST/v1/sketch

Areas, perimeters and lengths from points read off a plan, sketch or photo, scaled by one known reference

Points in the image's pixels and one reference; no image is sent. Returns the figures in both systems with an uncertainty band, closure and crossing checks, and a link that opens the scaled shapes on the canvas.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
shapesrequiredarray of objectThe outlines and lines read off the image, in its pixels.
referencerequiredobjectONE known size in the same image: a figured dimension, or an object of known size by its four corners.
pixelErrornumberHow far any point may be off, in pixels: it sets the band.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/sketch" \
  -H "Content-Type: application/json" \
  -d '{"reference":{"dimension":{"from":{"x":100,"y":80},"to":{"x":700,"y":80},"length":"6 m"}},"shapes":[{"name":"Living room","kind":"area","points":[{"x":100,"y":100},{"x":700,"y":100},{"x":700,"y":500},{"x":400,"y":500},{"x":400,"y":350},{"x":100,"y":350}],"calculator":{"slug":"self-leveling-underlayment-calculator","input":"floorArea"}},{"name":"Garden fence","kind":"length","as":"fence","points":[{"x":100,"y":600},{"x":700,"y":600},{"x":700,"y":800}]}],"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/sketch", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "reference": {
      "dimension": {
        "from": {
          "x": 100,
          "y": 80
        },
        "to": {
          "x": 700,
          "y": 80
        },
        "length": "6 m"
      }
    },
    "shapes": [
      {
        "name": "Living room",
        "kind": "area",
        "points": [
          {
            "x": 100,
            "y": 100
          },
          {
            "x": 700,
            "y": 100
          },
          {
            "x": 700,
            "y": 500
          },
          {
            "x": 400,
            "y": 500
          },
          {
            "x": 400,
            "y": 350
          },
          {
            "x": 100,
            "y": 350
          }
        ],
        "calculator": {
          "slug": "self-leveling-underlayment-calculator",
          "input": "floorArea"
        }
      },
      {
        "name": "Garden fence",
        "kind": "length",
        "as": "fence",
        "points": [
          {
            "x": 100,
            "y": 600
          },
          {
            "x": 700,
            "y": 600
          },
          {
            "x": 700,
            "y": 800
          }
        ]
      }
    ],
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/sketch",
    json={
        "reference": {
            "dimension": {
                "from": {
                    "x": 100,
                    "y": 80,
                },
                "to": {
                    "x": 700,
                    "y": 80,
                },
                "length": "6 m",
            },
        },
        "shapes": [
            {
                "name": "Living room",
                "kind": "area",
                "points": [
                    {
                        "x": 100,
                        "y": 100,
                    },
                    {
                        "x": 700,
                        "y": 100,
                    },
                    {
                        "x": 700,
                        "y": 500,
                    },
                    {
                        "x": 400,
                        "y": 500,
                    },
                    {
                        "x": 400,
                        "y": 350,
                    },
                    {
                        "x": 100,
                        "y": 350,
                    },
                ],
                "calculator": {
                    "slug": "self-leveling-underlayment-calculator",
                    "input": "floorArea",
                },
            },
            {
                "name": "Garden fence",
                "kind": "length",
                "as": "fence",
                "points": [
                    {
                        "x": 100,
                        "y": 600,
                    },
                    {
                        "x": 700,
                        "y": 600,
                    },
                    {
                        "x": 700,
                        "y": 800,
                    },
                ],
            },
        ],
        "system": "metric",
    },
)
answer = response.json()

POST/v1/drawing-export

A Construction Canvas drawing as DXF (CQ-* layers) and SVG plan files

The drawing as create_drawing takes it; one file per drawn level, by the canvas's own plan painters. A file too large to return inline is rebuilt from the drawing's link.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
houseobjectThe House Estimator's form: the house drawn as the estimator draws it.
commandsarray of objectDrawing commands, in order, on the canvas's blank drawing (one storey; the wall, partition, window and door types). The whole request is at most 64 KiB.
documentobjectA Construction Canvas document (schema 1 to the canvas's current), opened and checked by the canvas's own opener.
shapesarray of objectSimple shapes the assistant has read from the reader's words — a room, a deck, a patio, a bed, a path, a fence of legs and turns — compiled into the canvas's own commands. Every length with its unit.
layoutobjectRooms by name, size and which room each stands against, laid out on a grid: shared walls drawn once as partitions, every snap or move reported, and each room checked to close.
templatestringA Construction Canvas template's slug (the template index lists them: single-room, deck, two-car-garage …): the drawing its page shows, in the reader's system, with a link that opens it.
variantstringWith template: one of its two "what changes if" variants, by id; a wrong one is refused with the template's own list.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
formatsarray of anydxf, svg, ifc (openBIM IFC4: one file for the whole drawing, every level, with quantity sets), or several; left out, dxf and svg.
levelstringOne level by its id or name; left out, every level with something on its plan.
curl
curl -s -X POST "https://api.craftquantities.com/v1/drawing-export" \
  -H "Content-Type: application/json" \
  -d '{"template":"single-room","system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/drawing-export", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "template": "single-room",
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/drawing-export",
    json={
        "template": "single-room",
        "system": "metric",
    },
)
answer = response.json()

POST/v1/rebar-layout

A bar layout drawing and counts for a rectangular slab or footing, from the bar size, spacing and cover given

A quantity layout, not a design: the engineer chooses bar size, spacing and cover. Counts by the site's Rebar Calculator's method inside the cover; weight by its Rebar Weight Calculator where it carries the size.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
elementanyA slab, or a pad or strip footing, as a rectangle on plan.
lengthrequirednumber | string | objectAlong x, with its unit.
widthrequirednumber | string | objectAlong y, with its unit.
coverrequirednumber | string | objectThe cover to the bars on plan, as the engineer gives it.
barSizerequiredstringAs the engineer gives it: #4, 15M, N12, H12, T12 or 12 mm.
spacingnumber | string | objectThe spacing both ways, as the engineer gives it.
lengthwiseobjectThe bars running along the length (spaced across the width): a spacing of their own, or a count.
widthwiseobjectThe bars running along the width (spaced along the length): a spacing of their own, or a count.
matsanyOne mat, or two (top and bottom) laid out alike.
lapPercentnumberThe lap-splice allowance on the total; left out, the Rebar Calculator's own default.
lapLengthnumber | string | objectThe lap length at each splice, as the engineer gives it, for the bar schedule's laps bar by bar (a bar longer than the stock length is joined). Left out, the schedule counts the laps but adds no length for them.
chairsobjectCount the bar supports too, from the supplier's support spacing.
formatsarray of anyThe drawing's files: svg, dxf or both (the default).
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/rebar-layout" \
  -H "Content-Type: application/json" \
  -d '{"element":"slab","length":"20 ft","width":"12 ft","cover":"2 in","barSize":"#4","spacing":"12 in","system":"imperial"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/rebar-layout", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "element": "slab",
    "length": "20 ft",
    "width": "12 ft",
    "cover": "2 in",
    "barSize": "#4",
    "spacing": "12 in",
    "system": "imperial"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/rebar-layout",
    json={
        "element": "slab",
        "length": "20 ft",
        "width": "12 ft",
        "cover": "2 in",
        "barSize": "#4",
        "spacing": "12 in",
        "system": "imperial",
    },
)
answer = response.json()

POST/v1/drawing-edit

Edit a canvas drawing: move walls, add doors and windows

Changes a Construction Canvas drawing (its link, its document or any form a new drawing takes) by simple edits through the canvas's own commands: move a wall (joined walls follow), set a length, add a door or window, set properties or type, remove, add, set a level; returns the drawing, its revision, the link, the diff and the quantities that changed. baseRev refuses a stale drawing. Not sized. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
linkstringA Construction Canvas drawing link (https://craftquantities.com/construction-canvas/#d=…, as the engine and the canvas's Share give it), or its code.
documentobjectA Construction Canvas document (schema 1 to the canvas's current), opened by the canvas's own opener. Its JSON Schema: https://craftquantities.com/schemas/canvas-drawing-5.json.
drawingobjectA drawing in any form the engine draws from: house, commands, document, shapes, layout or template.
operationsrequiredarray of objectThe edits, in order, each through the canvas's own commands. One that the canvas refuses refuses the whole request, with every problem: nothing is half-applied.
systemstringThe system lengths are read in and the quantities listed in (both are listed); default the drawing's own.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
baseRevstringThe revision the edits are meant for (a rev or baseRev an earlier answer gave). When the drawing sent is not that revision (somebody changed it since), the request is refused with 409 and nothing is applied, as an If-Match.
curl
curl -s -X POST "https://api.craftquantities.com/v1/drawing-edit" \
  -H "Content-Type: application/json" \
  -d '{"drawing":{"template":"single-room"},"operations":[{"op":"move","target":{"side":"east"},"direction":"east","distance":"300 mm"},{"op":"add_opening","target":{"side":"north"},"kind":"window"}],"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/drawing-edit", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "drawing": {
      "template": "single-room"
    },
    "operations": [
      {
        "op": "move",
        "target": {
          "side": "east"
        },
        "direction": "east",
        "distance": "300 mm"
      },
      {
        "op": "add_opening",
        "target": {
          "side": "north"
        },
        "kind": "window"
      }
    ],
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/drawing-edit",
    json={
        "drawing": {
            "template": "single-room",
        },
        "operations": [
            {
                "op": "move",
                "target": {
                    "side": "east",
                },
                "direction": "east",
                "distance": "300 mm",
            },
            {
                "op": "add_opening",
                "target": {
                    "side": "north",
                },
                "kind": "window",
            },
        ],
        "system": "metric",
    },
)
answer = response.json()

Quotes

A contractor's quote read against the job; the reader's own quote turned into a project.

POST/v1/check/{slug}

Read a quote against the reader's job

Money in the quote is taken out before reading and never judged. A difference from a range is a question to ask, not a verdict. Nothing is kept.

ParameterInTypeDescription
slugrequiredpathstringbathroom-quote, plastering-quote, or {takeoff id}-quote

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
quoterequiredstring
measurementsobjectMeasurement id → value, each length, area or volume with its unit ("12 ft", {"value": 3.6, "unit": "m"}); counts as numbers. Ids are those of the takeoff; any left out opens at the page's own figure.
selectionobjectBuild-up choice id → option id, the takeoff's own (a stud size, an insulation, a cladding). Choices left out take the page's own for the system.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/check/bathroom-quote" \
  -H "Content-Type: application/json" \
  -d '{"quote":"Wall and floor tiles 12 m2\nTile adhesive 6 bags\nGrout 3 bags"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/check/bathroom-quote", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "quote": "Wall and floor tiles 12 m2\nTile adhesive 6 bags\nGrout 3 bags"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/check/bathroom-quote",
    json={
        "quote": "Wall and floor tiles 12 m2\nTile adhesive 6 bags\nGrout 3 bags",
    },
)
answer = response.json()

POST/v1/quote-import

The reader's own quote, prices and all, as a My Project file

The prices are the reader's own figures from the quote they supply, never the site's. Nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
quoterequiredstring
supplierstring
currencystring
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
namestring
curl
curl -s -X POST "https://api.craftquantities.com/v1/quote-import" \
  -H "Content-Type: application/json" \
  -d '{"quote":"Plasterboard 12.5 mm 30 sheets @ 9.50\nJointing compound 4 bags @ 12.00","currency":"£","supplier":"Builders'\'' merchant"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/quote-import", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "quote": "Plasterboard 12.5 mm 30 sheets @ 9.50\nJointing compound 4 bags @ 12.00",
    "currency": "£",
    "supplier": "Builders' merchant"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/quote-import",
    json={
        "quote": "Plasterboard 12.5 mm 30 sheets @ 9.50\nJointing compound 4 bags @ 12.00",
        "currency": "£",
        "supplier": "Builders' merchant",
    },
)
answer = response.json()

POST/v1/supplier-quote-request

A request for quote to merchants from a bill of materials, with no price

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
itemsrequiredarray of object
projectstringThe project's name, as the merchants will see it.
currencystringThe currency prices are asked in; left out, the market's.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
notestringA note to the merchants: delivery address area, dates, access.
curl
curl -s -X POST "https://api.craftquantities.com/v1/supplier-quote-request" \
  -H "Content-Type: application/json" \
  -d '{"project":"Garage slab","market":"UK","items":[{"description":"Ready-mix concrete, C25/30","quantity":2.64,"unit":"m³","notes":"Pump access from the drive"},{"description":"Rebar, 12 mm, 12 m lengths","quantity":11,"unit":"sticks"},{"description":"Formwork boards, 2.4 m","quantity":10,"unit":"boards"}]}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/supplier-quote-request", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "project": "Garage slab",
    "market": "UK",
    "items": [
      {
        "description": "Ready-mix concrete, C25/30",
        "quantity": 2.64,
        "unit": "m³",
        "notes": "Pump access from the drive"
      },
      {
        "description": "Rebar, 12 mm, 12 m lengths",
        "quantity": 11,
        "unit": "sticks"
      },
      {
        "description": "Formwork boards, 2.4 m",
        "quantity": 10,
        "unit": "boards"
      }
    ]
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/supplier-quote-request",
    json={
        "project": "Garage slab",
        "market": "UK",
        "items": [
            {
                "description": "Ready-mix concrete, C25/30",
                "quantity": 2.64,
                "unit": "m³",
                "notes": "Pump access from the drive",
            },
            {
                "description": "Rebar, 12 mm, 12 m lengths",
                "quantity": 11,
                "unit": "sticks",
            },
            {
                "description": "Formwork boards, 2.4 m",
                "quantity": 10,
                "unit": "boards",
            },
        ],
    },
)
answer = response.json()

POST/v1/level-quotes

Level two to six quotes for one job, line by line

Levels two to six contractors' quotes for one job against the job's own lines: per line, whether each includes it (its quantity against the job's range, both systems), leaves it out, excludes it or offers an alternative; what each adds; questions to ask. Money is taken out: no total, no ranking. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 69,632 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
jobrequiredstringThe job the quotes are for: a quote check (bathroom-quote, plastering-quote, concrete-slab-quote …) or a takeoff id that has one.
measurementsobjectMeasurement id → value, each length, area or volume with its unit ("12 ft", {"value": 3.6, "unit": "m"}); counts as numbers. Ids are those of the takeoff; any left out opens at the page's own figure.
selectionobjectBuild-up choice id → option id, the takeoff's own (a stud size, an insulation, a cladding). Choices left out take the page's own for the system.
quotesrequiredarray of objectTwo to six quotes for the same job. Money in them is taken out before reading.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/level-quotes" \
  -H "Content-Type: application/json" \
  -d '{"job":"bathroom-quote","quotes":[{"name":"Quote A","text":"Wall and floor tiles 12 m2\nTile adhesive 6 bags\nGrout 3 bags\nTanking membrane 8 m2"},{"name":"Quote B","text":"Tiles 11 m2\nAdhesive 5 bags\nExclusions: grout, skip hire"}]}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/level-quotes", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "job": "bathroom-quote",
    "quotes": [
      {
        "name": "Quote A",
        "text": "Wall and floor tiles 12 m2\nTile adhesive 6 bags\nGrout 3 bags\nTanking membrane 8 m2"
      },
      {
        "name": "Quote B",
        "text": "Tiles 11 m2\nAdhesive 5 bags\nExclusions: grout, skip hire"
      }
    ]
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/level-quotes",
    json={
        "job": "bathroom-quote",
        "quotes": [
            {
                "name": "Quote A",
                "text": "Wall and floor tiles 12 m2\nTile adhesive 6 bags\nGrout 3 bags\nTanking membrane 8 m2",
            },
            {
                "name": "Quote B",
                "text": "Tiles 11 m2\nAdhesive 5 bags\nExclusions: grout, skip hire",
            },
        ],
    },
)
answer = response.json()

Project files

A My Project file the reader restores on the site. Nothing is stored.

POST/v1/my-project-file

A My Project file from calculators and takeoffs

Returns the file in `file.content`; with ?download=1, the file itself as an attachment. The reader imports it in My Project with Restore from a backup.

ParameterInTypeDescription
downloadquerystringOne of: 1

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
namestring
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
calculatorsarray of object
takeoffsarray of object
housesarray of object
planobjectOne planned space as plan_room takes it, or a whole project (spaces, roof) as plan_project takes it.
drawingobjectA drawing as create_drawing takes it; the file carries the drawing itself, which the canvas reopens.
curl
curl -s -X POST "https://api.craftquantities.com/v1/my-project-file" \
  -H "Content-Type: application/json" \
  -d '{"name":"Garage slab","system":"metric","calculators":[{"slug":"concrete-calculator","inputs":{"slabLength":"6 m","slabWidth":"4 m","slabThickness":"100 mm"}}]}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/my-project-file", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Garage slab",
    "system": "metric",
    "calculators": [
      {
        "slug": "concrete-calculator",
        "inputs": {
          "slabLength": "6 m",
          "slabWidth": "4 m",
          "slabThickness": "100 mm"
        }
      }
    ]
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/my-project-file",
    json={
        "name": "Garage slab",
        "system": "metric",
        "calculators": [
            {
                "slug": "concrete-calculator",
                "inputs": {
                    "slabLength": "6 m",
                    "slabWidth": "4 m",
                    "slabThickness": "100 mm",
                },
            },
        ],
    },
)
answer = response.json()

POST/v1/programme

A build programme from a project's labour hours: tasks by trade, stage and level, working days, CSV and calendar

Stateless: the project comes as a state token, a My Project file, takeoffs or a drawing. Durations are the labour hours over the crew and working day given; no dates without a start date; hours and days only.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
tokenstringA project state token (cqp1.…) from a project-file answer or an update: the project whose lines are put in order.
fileobjectA My Project file (the backup a project-file answer returns, or one the reader exported): its active project's lines and any hours typed on them.
takeoffsarray of objectWhole-job takeoffs, each an id and its measurements, as a project file takes them.
drawingobjectA Construction Canvas drawing (a template, a house form, shapes, drawing commands or a canvas document), as a project file takes it; its levels set the level-by-level order.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
crewintegerPeople in each trade's crew, unless named in crews.
crewsobjectPeople in a trade's crew, by trade id (carpentry, drywall, electrical, roofing …).
hoursPerDaynumberWorking hours in a crew's day.
startDatestringOptional first day (YYYY-MM-DD): the working days are then given dates and a calendar file is returned. No date is assumed without it.
workDaysarray of integerThe days of the week worked, 1 Monday to 7 Sunday.
daysOffarray of stringDates not worked (holidays, a shutdown), YYYY-MM-DD.
namestringThe project's name, for the files.
curl
curl -s -X POST "https://api.craftquantities.com/v1/programme" \
  -H "Content-Type: application/json" \
  -d '{"drawing":{"template":"two-storey-house"},"crew":2,"hoursPerDay":8,"startDate":"2026-11-02"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/programme", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "drawing": {
      "template": "two-storey-house"
    },
    "crew": 2,
    "hoursPerDay": 8,
    "startDate": "2026-11-02"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/programme",
    json={
        "drawing": {
            "template": "two-storey-house",
        },
        "crew": 2,
        "hoursPerDay": 8,
        "startDate": "2026-11-02",
    },
)
answer = response.json()

POST/v1/hours

Estimated labour hours per line of a project

Estimated person-hours on each line of a project, as My Project shows them: hours typed on the line, else a production rate's band for its quantity, else the reason for none; with the project's crew-days. From a token, a file, calculators, takeoffs or a drawing. Hours only: no prices. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 65,536 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
tokenstringA project state token (cqp1.…) from a project-file answer or an update.
fileobjectA My Project file (the backup a project-file answer returns, or one the reader exported): its active project's lines, with any hours and rates typed on them.
calculatorsarray of objectCalculator lines, each a slug and its inputs, as a project file takes them.
takeoffsarray of objectWhole-job takeoffs, each an id and its measurements, as a project file takes them.
drawingobjectA Construction Canvas drawing (a template, a house form, shapes, drawing commands or a canvas document), as a project file takes it.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
crewintegerPeople on site, for the crew-days.
hoursPerDaynumberWorking hours in a day, for the crew-days.
namestringThe project's name.
curl
curl -s -X POST "https://api.craftquantities.com/v1/hours" \
  -H "Content-Type: application/json" \
  -d '{"name":"Garage","system":"metric","crew":2,"takeoffs":[{"takeoff":"concrete-slab","measurements":{"length":"6 m","width":"4 m","thickness":"100 mm"}},{"takeoff":"stud-wall","measurements":{"length":"6 m","height":"2.4 m"}}]}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/hours", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Garage",
    "system": "metric",
    "crew": 2,
    "takeoffs": [
      {
        "takeoff": "concrete-slab",
        "measurements": {
          "length": "6 m",
          "width": "4 m",
          "thickness": "100 mm"
        }
      },
      {
        "takeoff": "stud-wall",
        "measurements": {
          "length": "6 m",
          "height": "2.4 m"
        }
      }
    ]
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/hours",
    json={
        "name": "Garage",
        "system": "metric",
        "crew": 2,
        "takeoffs": [
            {
                "takeoff": "concrete-slab",
                "measurements": {
                    "length": "6 m",
                    "width": "4 m",
                    "thickness": "100 mm",
                },
            },
            {
                "takeoff": "stud-wall",
                "measurements": {
                    "length": "6 m",
                    "height": "2.4 m",
                },
            },
        ],
    },
)
answer = response.json()

POST/v1/variation

Variation (change order) between two versions of a project

Writes the variation (change order) between an agreed and a proposed version of a project: each line added, removed or changed, its quantity in metric and imperial, the labour hours, and the signed document as My Project prints it. Money only from the reader's own rates; with none, unpriced. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 69,632 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
beforerequiredobjectThe agreed version: one of token, file, calculators, takeoffs or drawing.
afterrequiredobjectThe proposed version, given the same ways.
ratesobjectThe reader's own unit rates (the site holds no price), by line id or calculator slug: a number, or { low, high }. A line's own rate in a file stays unless its id is named here.
currencystringThe label the reader's rates are in ("$", "£", "lei"); the market's when left out. A label only: no currency is converted.
namestringThe project's name on the document.
reasonstringWhy the job changed, in the reader's words.
numberstringThe variation's number (V-0003).
preparedBystring
clientstring
paymentTermsstring
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
curl
curl -s -X POST "https://api.craftquantities.com/v1/variation" \
  -H "Content-Type: application/json" \
  -d '{"name":"Garage slab","system":"metric","market":"UK","before":{"calculators":[{"slug":"concrete-calculator","inputs":{"slabLength":"6 m","slabWidth":"4 m","slabThickness":"100 mm"}}]},"after":{"calculators":[{"slug":"concrete-calculator","inputs":{"slabLength":"7 m","slabWidth":"4 m","slabThickness":"100 mm"}}]},"rates":{"concrete-calculator":120},"reason":"Slab extended by 1 m for a workbench bay."}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/variation", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Garage slab",
    "system": "metric",
    "market": "UK",
    "before": {
      "calculators": [
        {
          "slug": "concrete-calculator",
          "inputs": {
            "slabLength": "6 m",
            "slabWidth": "4 m",
            "slabThickness": "100 mm"
          }
        }
      ]
    },
    "after": {
      "calculators": [
        {
          "slug": "concrete-calculator",
          "inputs": {
            "slabLength": "7 m",
            "slabWidth": "4 m",
            "slabThickness": "100 mm"
          }
        }
      ]
    },
    "rates": {
      "concrete-calculator": 120
    },
    "reason": "Slab extended by 1 m for a workbench bay."
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/variation",
    json={
        "name": "Garage slab",
        "system": "metric",
        "market": "UK",
        "before": {
            "calculators": [
                {
                    "slug": "concrete-calculator",
                    "inputs": {
                        "slabLength": "6 m",
                        "slabWidth": "4 m",
                        "slabThickness": "100 mm",
                    },
                },
            ],
        },
        "after": {
            "calculators": [
                {
                    "slug": "concrete-calculator",
                    "inputs": {
                        "slabLength": "7 m",
                        "slabWidth": "4 m",
                        "slabThickness": "100 mm",
                    },
                },
            ],
        },
        "rates": {
            "concrete-calculator": 120,
        },
        "reason": "Slab extended by 1 m for a workbench bay.",
    },
)
answer = response.json()

POST/v1/proposal

Client proposal from a project, unpriced unless rates given

Writes the client proposal My Project prints: scope by line or trade division, quantities in metric and imperial, assumptions, exclusions, terms, payment stages and the signature block. From a token, a file, calculators, takeoffs or a drawing. "Not priced" unless the reader's own rates are given. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 69,632 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
tokenstringA project state token (cqp1.…) from a project-file answer or an update.
fileobjectA My Project file (the backup a project-file answer returns, or one the reader exported): its active project's lines, with any hours and rates typed on them.
calculatorsarray of objectCalculator lines, each a slug and its inputs, as a project file takes them.
takeoffsarray of objectWhole-job takeoffs, each an id and its measurements, as a project file takes them.
drawingobjectA Construction Canvas drawing (a template, a house form, shapes, drawing commands or a canvas document), as a project file takes it.
ratesobjectThe reader's own unit rates (the site holds no price), by line id or calculator slug: a number, or { low, high }. A line's own rate in a file stays unless its id is named here.
currencystringThe label the reader's rates are in ("$", "£", "lei"); the market's when left out. A label only: no currency is converted.
namestringThe project's name on the document.
referencestring
companyNamestringThe contractor's name for the letterhead; blank prints none.
preparedBystring
clientstring
introstringA covering note in the contractor's words.
termsstring
exclusionsstring
validUntilstringThe date the proposal is valid until, as it is to print.
paymentSchedulearray of objectStages of payment as the reader sets them; none is suggested.
groupByDivisionbooleanGroup the scope by MasterFormat division.
includeNotesboolean
showQuantitiesboolean
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
curl
curl -s -X POST "https://api.craftquantities.com/v1/proposal" \
  -H "Content-Type: application/json" \
  -d '{"name":"Garage","system":"metric","takeoffs":[{"takeoff":"concrete-slab","measurements":{"length":"6 m","width":"4 m","thickness":"100 mm"}},{"takeoff":"stud-wall","measurements":{"length":"6 m","height":"2.4 m"}}],"companyName":"Example Builders","reference":"Q-0001"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/proposal", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Garage",
    "system": "metric",
    "takeoffs": [
      {
        "takeoff": "concrete-slab",
        "measurements": {
          "length": "6 m",
          "width": "4 m",
          "thickness": "100 mm"
        }
      },
      {
        "takeoff": "stud-wall",
        "measurements": {
          "length": "6 m",
          "height": "2.4 m"
        }
      }
    ],
    "companyName": "Example Builders",
    "reference": "Q-0001"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/proposal",
    json={
        "name": "Garage",
        "system": "metric",
        "takeoffs": [
            {
                "takeoff": "concrete-slab",
                "measurements": {
                    "length": "6 m",
                    "width": "4 m",
                    "thickness": "100 mm",
                },
            },
            {
                "takeoff": "stud-wall",
                "measurements": {
                    "length": "6 m",
                    "height": "2.4 m",
                },
            },
        ],
        "companyName": "Example Builders",
        "reference": "Q-0001",
    },
)
answer = response.json()

POST/v1/scope-of-work

Scope of work from a project (three-part template)

Writes My Project's scope of work: Part 1 General (scope, work not included, submittals, the documents the lines' calculators cite in the market, site), Part 2 Products by trade with quantities, Part 3 Execution in the takeoffs' order with notices and inspections. A template for the parties; no prices. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 69,632 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
tokenstringA project state token (cqp1.…) from a project-file answer or an update.
fileobjectA My Project file (the backup a project-file answer returns, or one the reader exported): its active project's lines, with any hours and rates typed on them.
calculatorsarray of objectCalculator lines, each a slug and its inputs, as a project file takes them.
takeoffsarray of objectWhole-job takeoffs, each an id and its measurements, as a project file takes them.
drawingobjectA Construction Canvas drawing (a template, a house form, shapes, drawing commands or a canvas document), as a project file takes it.
namestringThe project's name on the document.
takeoffstringOne takeoff of the project (its name or id): the scope of that job alone. Left out: the whole project.
styleanyThe headings: csi (North American three-part section format) or nbs (UK and Australian practice). The market's when left out.
referencestring
siteAddressstring
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
curl
curl -s -X POST "https://api.craftquantities.com/v1/scope-of-work" \
  -H "Content-Type: application/json" \
  -d '{"name":"Garage","system":"metric","market":"UK","takeoffs":[{"takeoff":"concrete-slab","measurements":{"length":"6 m","width":"4 m","thickness":"100 mm"}},{"takeoff":"stud-wall","measurements":{"length":"6 m","height":"2.4 m"}}]}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/scope-of-work", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "Garage",
    "system": "metric",
    "market": "UK",
    "takeoffs": [
      {
        "takeoff": "concrete-slab",
        "measurements": {
          "length": "6 m",
          "width": "4 m",
          "thickness": "100 mm"
        }
      },
      {
        "takeoff": "stud-wall",
        "measurements": {
          "length": "6 m",
          "height": "2.4 m"
        }
      }
    ]
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/scope-of-work",
    json={
        "name": "Garage",
        "system": "metric",
        "market": "UK",
        "takeoffs": [
            {
                "takeoff": "concrete-slab",
                "measurements": {
                    "length": "6 m",
                    "width": "4 m",
                    "thickness": "100 mm",
                },
            },
            {
                "takeoff": "stud-wall",
                "measurements": {
                    "length": "6 m",
                    "height": "2.4 m",
                },
            },
        ],
    },
)
answer = response.json()

Solve backwards

What the material the reader already has will cover, as the site's Solve Backwards pages work it.

GET/v1/solve/{page}

What an amount of material covers, on one Solve Backwards page

Every other query parameter is a calculator setting, with its unit.

ParameterInTypeDescription
pagerequiredpathstringA Solve Backwards page's slug, such as wall-paint, drywall-sheets, bricks, concrete-bags, ready-mix-concrete.
haverequiredquerystringHow much: 20, or 24%20gal.
systemquerystringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.One of: metric, imperialDefault: metric

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/solve/wall-paint?have=24%20gal"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/solve/wall-paint?have=24%20gal");
const answer = await response.json();
Python
import requests

response = requests.get(
    "https://api.craftquantities.com/v1/solve/wall-paint",
    params={
        "have": "24 gal",
    },
)
answer = response.json()

POST/v1/solve

What an amount of material covers

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
pagestringA Solve Backwards page's slug, such as wall-paint, drywall-sheets, bricks, concrete-bags, ready-mix-concrete.
querystringOr what the reader has, in words ("sheets of drywall", "bags of concrete"), when the slug is not known.
haverequirednumber | string | objectHow much the reader has: a count for counted things (20, "20 sheets"); a measure with its unit for paint, concrete, soil ("24 gal", "2 m3", {"value": 90, "unit": "L"}).
systemstringThe page's system; it sets the market's product (a 4 × 8 ft sheet in imperial). Left out: the unit's system, else metric.
settingsobjectOptional: another calculator input, with its unit (a slab's thickness "4 in", coats 3). The inputs the page grows cannot be set.
curl
curl -s -X POST "https://api.craftquantities.com/v1/solve" \
  -H "Content-Type: application/json" \
  -d '{}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/solve", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({}),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/solve",
    json={},
)
answer = response.json()

Diagnoses and documents

Faults by symptom, the documents each market uses, and trade words across markets.

GET/v1/diagnose

Diagnosis pages that match a symptom, with candidate causes and how to tell them apart

ParameterInTypeDescription
symptomrequiredquerystringWhat the reader sees, hears or smells, in their own words: "my breaker keeps tripping when the kettle is on".
marketquerystringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.One of: US, CA, UK, AU, INTL
limitqueryintegerHow many diagnoses at most. Left out: one when the match is clear, up to three when it is not.

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/diagnose?symptom=breaker%20keeps%20tripping"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/diagnose?symptom=breaker%20keeps%20tripping");
const answer = await response.json();
Python
import requests

response = requests.get(
    "https://api.craftquantities.com/v1/diagnose",
    params={
        "symptom": "breaker keeps tripping",
    },
)
answer = response.json()

POST/v1/diagnose

Diagnosis pages that match a symptom

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
symptomrequiredstringWhat the reader sees, hears or smells, in their own words: "my breaker keeps tripping when the kettle is on".
marketstringOptional. A market whose own opening choice some inputs take (a UK reader's code, an IEC motor), and whose currency symbol prints the caller's own money figures.
limitintegerHow many diagnoses at most. Left out: one when the match is clear, up to three when it is not.
curl
curl -s -X POST "https://api.craftquantities.com/v1/diagnose" \
  -H "Content-Type: application/json" \
  -d '{"symptom":"breaker keeps tripping"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/diagnose", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "symptom": "breaker keeps tripping"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/diagnose",
    json={
        "symptom": "breaker keeps tripping",
    },
)
answer = response.json()

GET/v1/documents

The document family that governs a subject in a market, and who publishes it

Never an edition or a date: adoption is local, and the answer names who decides.

ParameterInTypeDescription
marketrequiredquerystringUS, CA, UK, AU or INTL — or a country's name ("England", "Canada"); a country the site has no market for answers as INTL.
subjectquerystringThe work, in words: "kitchen wiring", "stair handrails", "gas boiler flue".
calculatorquerystringOr a calculator's slug: the subjects its own sources name.

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/documents?market=England&subject=kitchen%20wiring"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/documents?market=England&subject=kitchen%20wiring");
const answer = await response.json();
Python
import requests

response = requests.get(
    "https://api.craftquantities.com/v1/documents",
    params={
        "market": "England",
        "subject": "kitchen wiring",
    },
)
answer = response.json()

GET/v1/term

A trade word in each market's usage, with the false-friend warning

ParameterInTypeDescription
termrequiredquerystringA trade word or phrase as one market says it, a brand name said for the product, or a misspelling: "plasterboard", "gyprock", "casing", "skirting", "eavestrough", "a yard of concrete".
fromquerystringThe market whose word it is, where known.One of: US, CA, UK, AU
toquerystringThe market to say it in.One of: US, CA, UK, AU

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/term?term=casing&from=US&to=UK"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/term?term=casing&from=US&to=UK");
const answer = await response.json();
Python
import requests

response = requests.get(
    "https://api.craftquantities.com/v1/term",
    params={
        "term": "casing",
        "from": "US",
        "to": "UK",
    },
)
answer = response.json()

Benchmark

The Construction Quantities Benchmark: the calculators' test vectors as questions in both unit systems, with their answers, CC BY 4.0.

GET/v1/benchmark

A page of the Construction Quantities Benchmark, or one calculator's items

ParameterInTypeDescription
pagequeryintegerWhich page of the benchmark, from 1: each page holds the items of a few calculators, in slug order. 1 when left out.
calculatorquerystringOne calculator's items only, by its slug, such as concrete-calculator.

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/benchmark?calculator=concrete-calculator"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/benchmark?calculator=concrete-calculator");
const answer = await response.json();
Python
import requests

response = requests.get(
    "https://api.craftquantities.com/v1/benchmark",
    params={
        "calculator": "concrete-calculator",
    },
)
answer = response.json()

Agent tools

Many calculations in one request, a project changed through its state token, a list grouped by MasterFormat division, and permanent ids.

POST/v1/calculate-batch

Several calculator runs in one request, each answered or refused on its own

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
itemsrequiredarray of objectThe runs, 1 to 25, each one calculator and its inputs; answered in the same order.
systemstringThe unit system for every run that does not name its own.
marketstringThe market for every run that does not name its own.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/calculate-batch" \
  -H "Content-Type: application/json" \
  -d '{"system":"metric","items":[{"ref":"Slab","slug":"concrete-calculator","inputs":{"slabLength":"6 m","slabWidth":"4 m","slabThickness":"100 mm"}},{"ref":"Walls","slug":"drywall-calculator"},{"ref":"Paint","slug":"cq-c0656"}]}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/calculate-batch", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "system": "metric",
    "items": [
      {
        "ref": "Slab",
        "slug": "concrete-calculator",
        "inputs": {
          "slabLength": "6 m",
          "slabWidth": "4 m",
          "slabThickness": "100 mm"
        }
      },
      {
        "ref": "Walls",
        "slug": "drywall-calculator"
      },
      {
        "ref": "Paint",
        "slug": "cq-c0656"
      }
    ]
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/calculate-batch",
    json={
        "system": "metric",
        "items": [
            {
                "ref": "Slab",
                "slug": "concrete-calculator",
                "inputs": {
                    "slabLength": "6 m",
                    "slabWidth": "4 m",
                    "slabThickness": "100 mm",
                },
            },
            {
                "ref": "Walls",
                "slug": "drywall-calculator",
            },
            {
                "ref": "Paint",
                "slug": "cq-c0656",
            },
        ],
    },
)
answer = response.json()

POST/v1/project-update

Change a project held in a state token: spaces, dimensions, takeoffs, calculator lines, roof pitch

Stateless: the token carries the project's inputs (compressed, not encrypted), and the answer carries the new token. Every line is rebuilt.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
tokenrequiredstringA project state token from a project-file answer or an earlier update.
operationsarray of objectThe changes, applied in order (0 to 20); none returns the project as the token holds it.
filebooleantrue: the updated My Project file as well.
curl
curl -s -X POST "https://api.craftquantities.com/v1/project-update" \
  -H "Content-Type: application/json" \
  -d '{"token":"cqp1.zZYtBDsIgEEWvYv6amFRdzdKb1M4IxMIYoDZNw90NRBfG5fv_vR0v0GDw8JFBeM5jhEEcg4BwFU6qAQZ5y0UCCEFK8hMMbsobaP-GH-8vvHu7JMnNnCXa4kC4HNqzeu507uTEW1dAOB3bXQ1YNfVu0iUW0FBbE1nX37XWNw.a6887bd2","operations":[{"op":"set_dimension","target":"space","index":0,"field":"length","value":"4.5 m"},{"op":"add_space","space":{"kind":"bathroom","name":"Bathroom","figures":{"length":"2.5 m","width":"2 m","height":"2.4 m"},"doors":{"count":1}}},{"op":"set_roof_pitch","pitch":6}]}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/project-update", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "token": "cqp1.zZYtBDsIgEEWvYv6amFRdzdKb1M4IxMIYoDZNw90NRBfG5fv_vR0v0GDw8JFBeM5jhEEcg4BwFU6qAQZ5y0UCCEFK8hMMbsobaP-GH-8vvHu7JMnNnCXa4kC4HNqzeu507uTEW1dAOB3bXQ1YNfVu0iUW0FBbE1nX37XWNw.a6887bd2",
    "operations": [
      {
        "op": "set_dimension",
        "target": "space",
        "index": 0,
        "field": "length",
        "value": "4.5 m"
      },
      {
        "op": "add_space",
        "space": {
          "kind": "bathroom",
          "name": "Bathroom",
          "figures": {
            "length": "2.5 m",
            "width": "2 m",
            "height": "2.4 m"
          },
          "doors": {
            "count": 1
          }
        }
      },
      {
        "op": "set_roof_pitch",
        "pitch": 6
      }
    ]
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/project-update",
    json={
        "token": "cqp1.zZYtBDsIgEEWvYv6amFRdzdKb1M4IxMIYoDZNw90NRBfG5fv_vR0v0GDw8JFBeM5jhEEcg4BwFU6qAQZ5y0UCCEFK8hMMbsobaP-GH-8vvHu7JMnNnCXa4kC4HNqzeu507uTEW1dAOB3bXQ1YNfVu0iUW0FBbE1nX37XWNw.a6887bd2",
        "operations": [
            {
                "op": "set_dimension",
                "target": "space",
                "index": 0,
                "field": "length",
                "value": "4.5 m",
            },
            {
                "op": "add_space",
                "space": {
                    "kind": "bathroom",
                    "name": "Bathroom",
                    "figures": {
                        "length": "2.5 m",
                        "width": "2 m",
                        "height": "2.4 m",
                    },
                    "doors": {
                        "count": 1,
                    },
                },
            },
            {
                "op": "set_roof_pitch",
                "pitch": 6,
            },
        ],
    },
)
answer = response.json()

POST/v1/classify

Group lines, calculators or a project by MasterFormat 2018 division (a suggestion)

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
tokenstringA project state token: its lines are grouped.
linesarray of objectLines of a takeoff, plan, house, drawing or bill: each a label, and the calculator slug where known.
calculatorsarray of stringCalculator slugs or permanent ids.
curl
curl -s -X POST "https://api.craftquantities.com/v1/classify" \
  -H "Content-Type: application/json" \
  -d '{"lines":[{"label":"Ready-mix concrete","quantity":2.64,"unit":"m³","slug":"concrete-calculator"},{"label":"Rebar, 12 mm","quantity":11,"unit":"sticks","slug":"rebar-calculator"},{"label":"Damp-proof membrane","quantity":30,"unit":"m²"},{"label":"Hardcore sub-base","quantity":2.4,"unit":"t"}]}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/classify", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "lines": [
      {
        "label": "Ready-mix concrete",
        "quantity": 2.64,
        "unit": "m³",
        "slug": "concrete-calculator"
      },
      {
        "label": "Rebar, 12 mm",
        "quantity": 11,
        "unit": "sticks",
        "slug": "rebar-calculator"
      },
      {
        "label": "Damp-proof membrane",
        "quantity": 30,
        "unit": "m²"
      },
      {
        "label": "Hardcore sub-base",
        "quantity": 2.4,
        "unit": "t"
      }
    ]
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/classify",
    json={
        "lines": [
            {
                "label": "Ready-mix concrete",
                "quantity": 2.64,
                "unit": "m³",
                "slug": "concrete-calculator",
            },
            {
                "label": "Rebar, 12 mm",
                "quantity": 11,
                "unit": "sticks",
                "slug": "rebar-calculator",
            },
            {
                "label": "Damp-proof membrane",
                "quantity": 30,
                "unit": "m²",
            },
            {
                "label": "Hardcore sub-base",
                "quantity": 2.4,
                "unit": "t",
            },
        ],
    },
)
answer = response.json()

GET/v1/id/{id}

A permanent id, an old slug or a site address to the page as it is today

ParameterInTypeDescription
idrequiredpathstringA permanent id (cq-c0412), a current or earlier slug, or a craftquantities.com address.
kindqueryanyOnly pages of this kind.One of: calculator, takeoff, guide, example, term, diagnosis

Also takes detail, format: the parameters every route takes.

curl
curl -s "https://api.craftquantities.com/v1/id/cq-c0187"
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/id/cq-c0187");
const answer = await response.json();
Python
import requests

response = requests.get("https://api.craftquantities.com/v1/id/cq-c0187")
answer = response.json()

POST/v1/illustration

Topic illustration (SVG) of a guide, comparison or page

Returns the topic illustration a page of the site carries: the SVG's address, its subject in words and its licence. One per guide, comparison, diagnosis, example, category, material and solve-backwards question; a shared plate for the glossary, methods, policies, standards and tools. Stateless: the request arrives and the answer goes back; nothing is stored. The body is at most 65,536 bytes (413 above it).

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
familyrequiredanyThe kind of page the drawing belongs to.
slugstringThe page's slug; left out, the family's own plate.
curl
curl -s -X POST "https://api.craftquantities.com/v1/illustration" \
  -H "Content-Type: application/json" \
  -d '{"family":"guides","slug":"how-to-anchor-into-concrete"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/illustration", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "family": "guides",
    "slug": "how-to-anchor-into-concrete"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/illustration",
    json={
        "family": "guides",
        "slug": "how-to-anchor-into-concrete",
    },
)
answer = response.json()

POST/v1/formula

Look up a construction formula: equation, symbols, units

Reads the open formula library (/formulas/): volume, area, coverage and spread rate, spacing and count, bulking, stairs, roof pitch and slope, unit conversions. Each formula's equation, every symbol with its meaning and unit in both systems, the calculators it is bound to and the test vectors it reproduces; find one by id, words or a calculator's slug, and work it on your own values. Arithmetic, not a design. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
idstringA formula id (cylinder-volume, riser-count …) or a family id (volume-from-geometry, stairs …). Left out with no calculator and no query: the library's families and their formulas.
calculatorstringA calculator's slug: the formulas it runs.
querystringWords to find a formula by ("volume of a cylinder", "roof pitch to degrees").
valuesobjectWith a formula id: each input variable's value, by its id, in the unit of `system` (metric column when left out), to evaluate the equation.
systemstringThe column `values` are read in, and the evaluated answer printed first; both are returned.
curl
curl -s -X POST "https://api.craftquantities.com/v1/formula" \
  -H "Content-Type: application/json" \
  -d '{"id":"cylinder-volume","values":{"d":0.3,"h":1.2}}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/formula", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "id": "cylinder-volume",
    "values": {
      "d": 0.3,
      "h": 1.2
    }
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/formula",
    json={
        "id": "cylinder-volume",
        "values": {
            "d": 0.3,
            "h": 1.2,
        },
    },
)
answer = response.json()

POST/v1/guide

Find a how-to guide and the calculators it uses

Finds the site's how-to guides (how to pour a slab, frame a wall, tile a floor, insulate a loft …) by words, slug or calculator: each guide's title, summary, trade, address, the link to its full text as Markdown, and the calculators it works its figures with. It finds and links; it computes nothing. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
slugstringA guide's slug, such as how-to-pour-a-concrete-slab.
querystringWords to find guides by, such as "pour a slab" or "insulate a loft".
calculatorstringA calculator's slug: the guides that work with it.
limitintegerAt most this many guides for a query or a calculator.
curl
curl -s -X POST "https://api.craftquantities.com/v1/guide" \
  -H "Content-Type: application/json" \
  -d '{"query":"pour a concrete slab","limit":3}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/guide", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "query": "pour a concrete slab",
    "limit": 3
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/guide",
    json={
        "query": "pour a concrete slab",
        "limit": 3,
    },
)
answer = response.json()

Cutting

Corner trim on the reader's saw, a room's trim plan, the scribe template and the other full-size templates, a panel or worktop fitted to walls that are not square, and the mitre saw chart: cutting geometry and quantities, never sized.

POST/v1/trim-corner

Corner trim on your saw: mitre, bevel, stops and the gap

Cuts one corner of skirting, casing or crown molding on a named saw: per piece the mitre and bevel as its dials read, the stop each sits on, how the piece lies, which side to keep, whether the saw can make it; cope or mitre, and the gap a 45° cut leaves. No sizing. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
trimrequiredanyskirting (baseboard), casing (architrave, a frame corner) or crown (cornice).
cornerobjectThe corner as measured. For casing, the frame corner (90 for a square opening); its kind is ignored.
throughRoomnumberIn place of corner: the angle read through the room (under 180 inside, over 180 outside), as the miter-angle calculator takes it.
methodanyHow the piece goes on the saw: skirting and casing upright (against the fence) or flat (on the table); crown nested (upside down against the fence) or flat. Left out, the trim's usual one.
sawanyThe saw from the site's library (each with its scale, its stops and its capacity); custom with customSaw. Left out, the 12-in double-bevel slider (DWS779 figures).
customSawobjectWith saw custom: the saw's own limits.
springnumberCrown only: its spring angle from the wall, degrees (38 for 38/52, 45 for 45/45). Left out, 38.
depthnumber | string | objectThe depth the joint runs across in the plane of the turn: a skirting's thickness, a casing's face width, a crown's projection. Left out: 18 mm, 70 mm or 75 mm (3/4, 2 3/4 or 3 in).
heightnumber | string | objectSkirting only: its height, for the saw's upright capacity. Left out, 120 mm (4 3/4 in).
buildUpnumber | string | objectPlaster or compound built up in the corner (it changes the angle the trim meets). Left out, none.
feathernumber | string | objectThe distance that build-up is feathered over along each wall. Left out, 150 mm (6 in).
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/trim-corner" \
  -H "Content-Type: application/json" \
  -d '{"trim":"skirting","corner":{"kind":"inside","angle":92},"saw":"double-bevel","system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/trim-corner", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "trim": "skirting",
    "corner": {
      "kind": "inside",
      "angle": 92
    },
    "saw": "double-bevel",
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/trim-corner",
    json={
        "trim": "skirting",
        "corner": {
            "kind": "inside",
            "angle": 92,
        },
        "saw": "double-bevel",
        "system": "metric",
    },
)
answer = response.json()

POST/v1/room-trim

Room trim plan: every piece, its ends and the stock

Plans trim round a room, piece by piece, from its corners, door openings and built-ins (or a drawn room): each piece in fitting order with its long and short point lengths, each end's cope, mitre, butt or scarf with its saw settings, the cut list and the trim lengths to buy. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
wallsarray of objectThe walls in order round the room, up to 40, each with its length along the wall face (corner to corner).
cornersarray of objectcorners[i] is at the end of walls[i], where it meets the next wall (one per wall; the last closes the room).
directionanycw (the default): facing each wall from the room, working left to right. ccw: the canvas's order.
drawingobjectIn place of walls and corners: a Construction Canvas drawing in any form the drawing tool takes ({ document }, { commands }, { template }, { house }, { shapes }, { layout }); the room's inside faces, corners and doors are read from it as the canvas's Trim plan reads them.
roomstringWith drawing: the room's id (R1 …). Left out, the drawing's only room.
trimanyLeft out, skirting.
methodanyHow the piece goes on the saw: skirting and casing upright (against the fence) or flat (on the table); crown nested (upside down against the fence) or flat. Left out, the trim's usual one.
sawanyThe saw profile the room plan's settings are read on (as the plan on the page): a mitre saw that tilts both ways (the default), one that tilts left only, or a mitre box with 90° at square.
springnumberCrown only: its spring angle from the wall, degrees (38 for 38/52, 45 for 45/45). Left out, 38.
depthnumber | string | objectThe trim's depth across the joint (skirting thickness, crown projection). Left out, 18 mm (3/4 in) or 75 mm (3 in) for crown.
buildUpnumber | string | objectPlaster built up in the corners. Left out, none.
casingnumber | string | objectThe door casing's width a skirting butts to beside a door. Left out, none (it butts to the opening's edge).
startintegerThe wall fitted first (index). Left out, 0.
insideJointanyInside corners coped (the default) or mitred.
stockarray of number | string | objectThe stock lengths on offer, with units. Left out, the market's usual trim lengths.
kerfnumber | string | objectThe saw's kerf. Left out, 3 mm (1/8 in).
minOffcutnumber | string | objectOffcuts at least this long are kept.
studsobject
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/room-trim" \
  -H "Content-Type: application/json" \
  -d '{"walls":[{"label":"North","length":"4 m"},{"label":"East","length":"3 m","openings":[{"kind":"door","start":"0.4 m","width":"0.8 m"}]},{"label":"South","length":"4 m"},{"label":"West","length":"3 m"}],"corners":[{"kind":"inside","angle":90},{"kind":"inside","angle":91},{"kind":"inside","angle":89},{"kind":"inside","angle":90}],"trim":"skirting","system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/room-trim", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "walls": [
      {
        "label": "North",
        "length": "4 m"
      },
      {
        "label": "East",
        "length": "3 m",
        "openings": [
          {
            "kind": "door",
            "start": "0.4 m",
            "width": "0.8 m"
          }
        ]
      },
      {
        "label": "South",
        "length": "4 m"
      },
      {
        "label": "West",
        "length": "3 m"
      }
    ],
    "corners": [
      {
        "kind": "inside",
        "angle": 90
      },
      {
        "kind": "inside",
        "angle": 91
      },
      {
        "kind": "inside",
        "angle": 89
      },
      {
        "kind": "inside",
        "angle": 90
      }
    ],
    "trim": "skirting",
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/room-trim",
    json={
        "walls": [
            {
                "label": "North",
                "length": "4 m",
            },
            {
                "label": "East",
                "length": "3 m",
                "openings": [
                    {
                        "kind": "door",
                        "start": "0.4 m",
                        "width": "0.8 m",
                    },
                ],
            },
            {
                "label": "South",
                "length": "4 m",
            },
            {
                "label": "West",
                "length": "3 m",
            },
        ],
        "corners": [
            {
                "kind": "inside",
                "angle": 90,
            },
            {
                "kind": "inside",
                "angle": 91,
            },
            {
                "kind": "inside",
                "angle": 89,
            },
            {
                "kind": "inside",
                "angle": 90,
            },
        ],
        "trim": "skirting",
        "system": "metric",
    },
)
answer = response.json()

POST/v1/scribe-template

Scribe template: the scribe line full size, SVG and DXF

Turns gaps measured off a straight line into a scribe line for an uneven surface: the widest and narrowest gap, the width to start from, the strip to cut away, the line as full-size SVG and DXF, and its print layout on A4, Letter or a roll. A pattern, not a fit. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
readingsarray of objectThe gaps measured from a straight reference line to the wall: up to 200 stations, each where it is along the line and the gap there.
shapeobject
allowancenumber | string | objectBoard left beyond the widest gap. Left out, 10 mm (3/8 in).
paperanyThe paper the full-size template is tiled on. Left out, A4 for metric and Letter for imperial.
rollWidthnumber | string | objectWith paper roll: the roll's width.
overlapnumber | string | objectBetween adjacent sheets. Left out, the tiler's own.
orientationany
formatsarray of anyThe drawings to return. Left out, both.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/scribe-template" \
  -H "Content-Type: application/json" \
  -d '{"readings":[{"at":"0 mm","gap":"4 mm"},{"at":"300 mm","gap":"11 mm"},{"at":"600 mm","gap":"15 mm"},{"at":"900 mm","gap":"9 mm"},{"at":"1200 mm","gap":"3 mm"}],"allowance":"10 mm","formats":["svg"],"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/scribe-template", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "readings": [
      {
        "at": "0 mm",
        "gap": "4 mm"
      },
      {
        "at": "300 mm",
        "gap": "11 mm"
      },
      {
        "at": "600 mm",
        "gap": "15 mm"
      },
      {
        "at": "900 mm",
        "gap": "9 mm"
      },
      {
        "at": "1200 mm",
        "gap": "3 mm"
      }
    ],
    "allowance": "10 mm",
    "formats": [
      "svg"
    ],
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/scribe-template",
    json={
        "readings": [
            {
                "at": "0 mm",
                "gap": "4 mm",
            },
            {
                "at": "300 mm",
                "gap": "11 mm",
            },
            {
                "at": "600 mm",
                "gap": "15 mm",
            },
            {
                "at": "900 mm",
                "gap": "9 mm",
            },
            {
                "at": "1200 mm",
                "gap": "3 mm",
            },
        ],
        "allowance": "10 mm",
        "formats": [
            "svg",
        ],
        "system": "metric",
    },
)
answer = response.json()

POST/v1/fit-panel

Fit a worktop, shelf or panel to walls that are not square

The true shape of a worktop, shelf or panel between walls that are not square: front and back lengths, setbacks, diagonals and the blank with scribe and bow, then the blank and any other parts nested on stock: part ids, grain, cut order, offcuts and edge banding. Geometry only. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
kindanyworktop (the default): worktop lengths. shelf: shelf boards. board: full sheets of plywood or board.
spanrequirednumber | string | objectWall to wall (or to the free end), along the back wall, or along the front line with measuredAt front.
leftAnglenumberThe room's inside angle between the back wall and the left wall, degrees; 90 square. Left out, 90.
rightAnglenumber
leftEndanyopen: a free end, cut square.
rightEndany
measuredAtany
backWallbooleanIs there a wall along the back? Left out, yes.
depthnumber | string | objectThe finished depth, front edge to back wall. Left out, the kind's usual.
scribenumber | string | objectLeft on every edge that meets a wall, to scribe off in place. Left out, the kind's usual.
gapnumber | string | objectLeft clear at each wall end. Left out, the kind's usual.
bownumber | string | objectThe back wall's greatest departure from straight. Left out, none.
countintegerHow many of the fitted piece. Left out, 1.
labelstring
partsarray of objectOther parts nested on the same boards (a carcass's sides and shelves).
stockintegerAn index into the kind's stock sizes for the market (listed in the answer's stockOffered). Left out, the size that buys least.
sheetobject
kerfnumber | string | objectThe saw's kerf. Left out, 3 mm (1/8 in).
trimnumber | string | objectCut off every board edge before nesting. Left out, the kind's own (10 mm on a full sheet).
modeanyguillotine (the default): every cut edge to edge, for a panel or track saw. free: also layouts needing plunge cuts (CNC).
grainbooleanHold the grain or decor along the run (the default).
bandFrontbooleanBand the front edge of the fitted piece.
bandAllowancenumber | string | objectTape added to every banded edge for trimming flush.
minOffcutnumber | string | objectAn offcut is listed for reuse when it is at least this big either way.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/fit-panel" \
  -H "Content-Type: application/json" \
  -d '{"kind":"worktop","span":"2.4 m","leftAngle":91,"rightAngle":88.5,"bow":"6 mm","system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/fit-panel", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "kind": "worktop",
    "span": "2.4 m",
    "leftAngle": 91,
    "rightAngle": 88.5,
    "bow": "6 mm",
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/fit-panel",
    json={
        "kind": "worktop",
        "span": "2.4 m",
        "leftAngle": 91,
        "rightAngle": 88.5,
        "bow": "6 mm",
        "system": "metric",
    },
)
answer = response.json()

POST/v1/worktop-run

Worktop run round corners: pieces, joints and lengths

A worktop along several wall faces, as the Construction Canvas cuts it: each piece's true shape at the room's real angles, butt or mitre joints at corners, long straights joined, the front run and free ends, and the blanks nested on worktop lengths with the cut order and banding. Not sized. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
facesrequiredarray of objectThe wall faces the run follows, in order, each with its length along the wall.
cornersarray of objectBetween face i and face i + 1 (one fewer than the faces): inside or outside, the room's inside angle, and how the pieces meet.
startobject
finishobject
depthnumber | string | objectThe finished depth, front edge to back wall. Left out, the kind's usual.
scribenumber | string | objectLeft on every edge that meets a wall, to scribe off in place. Left out, the kind's usual.
gapnumber | string | objectLeft clear at each wall end. Left out, the kind's usual.
bownumber | string | objectThe back wall's greatest departure from straight. Left out, none.
jointAtnumber | string | objectWhere a straight longer than the stock is joined, along its back from its start. Left out, an even split.
jointsAtarray of number | string | objectA joint position per straight, in run order (faces in line make one straight): where that straight is joined, along its back from its start, if it is longer than the stock. "0 mm" splits it evenly; a straight past the end of the list takes jointAt.
stockintegerAn index into the kind's stock sizes for the market (listed in the answer's stockOffered). Left out, the size that buys least.
kerfnumber | string | objectThe saw's kerf. Left out, 3 mm (1/8 in).
grainbooleanHold the grain or decor along the run (the default).
bandFrontbooleanBand the front edge of the fitted piece.
bandAllowancenumber | string | objectTape added to every banded edge for trimming flush.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/worktop-run" \
  -H "Content-Type: application/json" \
  -d '{"faces":[{"length":"3 m","label":"Back"},{"length":"2.2 m","label":"Side"}],"corners":[{"kind":"inside","angle":90}],"start":{"end":"wall","angle":90},"finish":{"end":"open"},"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/worktop-run", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "faces": [
      {
        "length": "3 m",
        "label": "Back"
      },
      {
        "length": "2.2 m",
        "label": "Side"
      }
    ],
    "corners": [
      {
        "kind": "inside",
        "angle": 90
      }
    ],
    "start": {
      "end": "wall",
      "angle": 90
    },
    "finish": {
      "end": "open"
    },
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/worktop-run",
    json={
        "faces": [
            {
                "length": "3 m",
                "label": "Back",
            },
            {
                "length": "2.2 m",
                "label": "Side",
            },
        ],
        "corners": [
            {
                "kind": "inside",
                "angle": 90,
            },
        ],
        "start": {
            "end": "wall",
            "angle": 90,
        },
        "finish": {
            "end": "open",
        },
        "system": "metric",
    },
)
answer = response.json()

POST/v1/miter-chart

Mitre saw angle chart: corners from 80° to 150°

The mitre saw chart for trim corners: per corner angle the mitre each piece takes, the outside corner read through the room, the gap a 45° cut leaves on 18 mm and 3/4 in trim and where it opens, crown laid flat (38/52 and 45/45) mitre and bevel, and the handing table. Any corners on request. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
anglesarray of numberThe corners θ to chart, degrees. Left out, the site's chart: 80° to 100° in half degrees, then 120°, 135° and 150°.
handingbooleanInclude the handing table (which way each piece swings and tilts at a square corner). Left out, yes.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
curl
curl -s -X POST "https://api.craftquantities.com/v1/miter-chart" \
  -H "Content-Type: application/json" \
  -d '{"angles":[88,90,92,135],"handing":false,"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/miter-chart", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "angles": [
      88,
      90,
      92,
      135
    ],
    "handing": false,
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/miter-chart",
    json={
        "angles": [
            88,
            90,
            92,
            135,
        ],
        "handing": False,
        "system": "metric",
    },
)
answer = response.json()

POST/v1/print-template

Full-size print template as SVG and DXF

The full-size template a calculator page prints: a stair stringer or step gauge, rafter cuts, a cone or frustum pattern, an arch's centring or voussoirs, an anchor bolt setting jig or plate, a curved plate, a spiral stair's tread, winder blanks, a housed or ladder stringer, a split stair's stringers, a handrail gooseneck; lines as SVG and DXF, its checks and omissions, its tiling on paper. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
calculatorrequiredanyThe calculator whose page offers the template: a stair stringer and step gauge, a rafter, a cone or frustum pattern, a curved wall's plate, an anchor bolt setting board or plate, an arch's centring or voussoirs; a spiral stair's tread or landing, a turn's winder blanks, a housed string or ship's ladder stringer, a split stair's stringers, a handrail's gooseneck.
inputsobjectThe calculator's own inputs by id, with their units, as its page takes them; left out, the values its page opens on.
kindstringWhich of the family's two templates: stringer gauge or whole; rafter cuts or whole; cone whole or half; arch centring or voussoirs; bolts setting or plate; plate segment or whole; spiral tread or landing; winders each or turn; housed and ladder gauge or whole; split first, return or gauge; gooseneck turn or pieces. Left out, the first.
fieldsobjectThe template's own figures by id (a stringer's board depth and tread thickness, a cone's lap …), with units; left out, the page's defaults for the system (or the calculator's own figure where the page opens on it). The answer lists them.
paperanyLeft out, A4 for metric and Letter for imperial.
rollWidthnumber | string | objectWith paper roll: the roll's width.
overlapnumber | string | objectBetween adjacent sheets. Left out, 10 mm.
orientationany
formatsarray of anyThe drawings to return. Left out, both.
systemstringThe unit system inputs left out open in, and the one the page link opens in. The answer comes in both.
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/print-template" \
  -H "Content-Type: application/json" \
  -d '{"calculator":"stair-stringer-calculator","kind":"gauge","formats":["svg"],"system":"metric"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/print-template", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "calculator": "stair-stringer-calculator",
    "kind": "gauge",
    "formats": [
      "svg"
    ],
    "system": "metric"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/print-template",
    json={
        "calculator": "stair-stringer-calculator",
        "kind": "gauge",
        "formats": [
            "svg",
        ],
        "system": "metric",
    },
)
answer = response.json()

POST/v1/roof-framing

Roof framing: rafter lengths, cuts, birdsmouth and templates

Lays out a gable or hip roof (optionally a gable wing with valleys) from the caller's own sizes: each common, hip, valley and jack rafter's length along the line, birdsmouth and HAP, plumb and cheek cuts as saw settings, hip backing, a cut list on the caller's stock, and a member's full-size template as SVG and DXF; both systems. Geometry only: it does not size structure. Stateless: the request arrives and the answer goes back; nothing is stored.

Also takes detail, format: the parameters every route takes.

Request body (JSON), required

FieldTypeDescription
kindanygable or hip (default hip).
spannumber | string | objectBuilding width across the ridge, outside faces of the wall plates ("24 ft", "8 m").
lengthnumber | string | objectBuilding length along the ridge.
pitchnumberRise per 12 of run (6 for 6/12). Or give pitchDegrees.
pitchDegreesnumberThe pitch in degrees, as an alternative to pitch.
overhangnumber | string | objectLevel, from the wall's outer face to the tail's plumb cut.
rakenumber | string | objectGable ends (and a wing's gable end): how far the roof runs past the gable wall.
rafterDepthnumber | string | objectActual depth of the commons and jacks (a 2×8 is "7.25 in").
rafterThicknessnumber | string | objectActual thickness of the commons and jacks ("1.5 in", "45 mm").
hipDepthnumber | string | objectActual depth of the hips and valleys.
hipThicknessnumber | string | objectActual thickness of the hips and valleys.
ridgeThicknessnumber | string | objectThe ridge board's thickness.
plateWidthnumber | string | objectThe wall plate's width (the seat bears on it).
heightAbovePlatenumber | string | objectThe commons' height above the plate (HAP); left out, the seat bears on the whole plate.
hipTopanyDrop the hips and leave them square (default), or back them.
spacingnumber | string | objectRafter centres along the plate ("16 in", "600 mm").
fasciaThicknessnumber | string | objectThe fascia board's thickness.
wingobjectAn equal-pitch gable wing on the front wall: gives the valleys, valley jacks and cripples.
stockarray of number | string | objectThe stock lengths the caller can buy, each with its unit; left out, the page's list for the system.
kerfnumber | string | objectSaw kerf, charged on every cut (default 1/8 in or 3 mm).
templateobjectOne member as a full-size template (1:1, millimetres).
systemstringThe system figures are read in and printed first (both are returned).
inputUnitsstringSend "base" to pass bare numbers on dimensioned inputs in base units (m, m², L, kg …), as the published test vectors are written. Without it a length, area or volume must carry its unit.
curl
curl -s -X POST "https://api.craftquantities.com/v1/roof-framing" \
  -H "Content-Type: application/json" \
  -d '{"kind":"hip","span":"24 ft","length":"40 ft","pitch":6,"overhang":"12 in","rafterDepth":"7.25 in","rafterThickness":"1.5 in","hipDepth":"9.25 in","hipThickness":"1.5 in","ridgeThickness":"1.5 in","plateWidth":"3.5 in","spacing":"16 in","stock":["8 ft","10 ft","12 ft","14 ft","16 ft","18 ft","20 ft"],"system":"imperial"}'
JavaScript
const response = await fetch("https://api.craftquantities.com/v1/roof-framing", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "kind": "hip",
    "span": "24 ft",
    "length": "40 ft",
    "pitch": 6,
    "overhang": "12 in",
    "rafterDepth": "7.25 in",
    "rafterThickness": "1.5 in",
    "hipDepth": "9.25 in",
    "hipThickness": "1.5 in",
    "ridgeThickness": "1.5 in",
    "plateWidth": "3.5 in",
    "spacing": "16 in",
    "stock": [
      "8 ft",
      "10 ft",
      "12 ft",
      "14 ft",
      "16 ft",
      "18 ft",
      "20 ft"
    ],
    "system": "imperial"
  }),
});
const answer = await response.json();
Python
import requests

response = requests.post(
    "https://api.craftquantities.com/v1/roof-framing",
    json={
        "kind": "hip",
        "span": "24 ft",
        "length": "40 ft",
        "pitch": 6,
        "overhang": "12 in",
        "rafterDepth": "7.25 in",
        "rafterThickness": "1.5 in",
        "hipDepth": "9.25 in",
        "hipThickness": "1.5 in",
        "ridgeThickness": "1.5 in",
        "plateWidth": "3.5 in",
        "spacing": "16 in",
        "stock": [
            "8 ft",
            "10 ft",
            "12 ft",
            "14 ft",
            "16 ft",
            "18 ft",
            "20 ft",
        ],
        "system": "imperial",
    },
)
answer = response.json()