Developers & AI agents

Flooring Calculator API

Read the real, pack-rounded result of an autolay flooring layout over a public JSON endpoint — the same area, waste, tile-count and box totals the app shows and the PDF export prints. Send a room outline, or the token of a plan you already made; every response links back to the result page on autolay.com.

What it returns — and what it doesn't

The numbers come from autolay's real layout engine — the boxes, cuts and waste of an actual tile layout, rounded up to whole purchasable packs. It is never a length × width × waste estimate.

waste_percent is measured against the floor the tiles actually cover — the room minus the expansion gap along the walls — not againstnet_area_m2, so the sample's 1.7 % is the same figure the planner screen, the PDF quote and the calculator explainer show for this room.

The response carries aggregate quantities only: area, waste, tile and cut counts, packs, cost. Per-tile positions, tile ids, laying order, cut geometry and the layout image are not served by this API — they live in the planner and the PDF export, which is where result_url takes the user.

POST /api/calculate

Public, rate-limited (60 requests/minute). Three request shapes:

FieldTypeDescription
tokenstringShare token of a layout you already generated (see “Get a token” below). Returns the totals right away.
room.boundaryarrayRoom outline: 3–500 ordered {x, y} corners in metres. Any shape — L-shaped rooms, bays, angled walls.
room.length_m, room.width_mnumberRectangle shorthand for the four corners those two imply (0.1–100 m each).
tile.material_idstringCatalog tile to lay, from the public catalog GET /api/materials/catalog. Required with room.
patternstringLaying pattern; optional, default straight.
pricingobjectOptional mode (simple/advanced), pack_size, price_per_pack, price_per_sqm, per-m² rates, currency. pack_size falls back to the tile's catalog pack size.

Read a plan you already generated

curl -X POST https://www.autolay.com/api/calculate \
  -H 'Content-Type: application/json' \
  -d '{"token": "sTBv1nQm3kP0aX9wZ7yYbQ"}'

Response

{
  "engine": "autolay-layout-generator",
  "source": "generated-layout",
  "project_name": "Living Room",
  "material_name": "Small Oak Parquet",
  "totals": {
    "net_area_m2": 20.0,
    "covered_area_m2": 19.82,
    "required_material_area_m2": 20.16,
    "waste_percent": 1.7,
    "full_tiles": 497,
    "cut_tiles": 79,
    "physical_tiles": 576,
    "pack_size": 36,
    "packs": 16,
    "surplus_pieces": 0,
    "total_cost": 1088.0,
    "currency": "EUR"
  },
  "result_url": "https://www.autolay.com/share/sTBv1nQm3kP0aX9wZ7yYbQ"
}

result_url is a public autolay.com page with this result's figures and a way into the planner — hand it to the user.

Calculate from a room, no plan needed

Post the room geometry and a catalog tile: the request enqueues a real layout run and answers 202 with a poll token. Poll GET /api/calculate/result/{token} until status is "done" — the body then has the same totals shape as above.

Rectangle

curl -X POST https://www.autolay.com/api/calculate \
  -H 'Content-Type: application/json' \
  -d '{"room": {"length_m": 5.0, "width_m": 4.0},
       "tile": {"material_id": "oak_parquet"},
       "pattern": "straight",
       "pricing": {"mode": "simple", "pack_size": 4, "price_per_pack": 68.0}}'

Any room shape (polygon)

curl -X POST https://www.autolay.com/api/calculate \
  -H 'Content-Type: application/json' \
  -d '{"room": {"boundary": [{"x": 0,   "y": 0},
                             {"x": 6,   "y": 0},
                             {"x": 6,   "y": 2.5},
                             {"x": 3.5, "y": 2.5},
                             {"x": 3.5, "y": 4},
                             {"x": 0,   "y": 4}]},
       "tile": {"material_id": "oak_parquet"}}'

Response (202)

{
  "status": "pending",
  "token": "b7Kq2rTf9ZmA1sXd",
  "poll_url": "https://www.autolay.com/api/calculate/result/b7Kq2rTf9ZmA1sXd",
  "result_url": "https://www.autolay.com/share/b7Kq2rTf9ZmA1sXd"
}

A from-scratch result is kept for 24 hours, then the token returns 404 — read the totals, or hand the user result_url, before then. If nothing picks the job up within 15 minutes the poll ends in 504 rather than staying pending. Plans you generate while signed in are not affected.

Room boundary format

  • Units: metres, always.
  • Coordinates: the plan's own 2D space — origin anywhere, x right, y up. Nothing is georeferenced; only the shape matters, not where it sits.
  • Order: corners follow the wall line; clockwise or counter-clockwise both work.
  • Closing point: optional — repeating the first corner at the end is accepted and ignored.
  • Limits: 3–500 points, each coordinate −1000…1000 m, enclosed area 0.05–10000 m².
  • Not supported: holes or cut-outs (pillars, stairwells — send the outer ring), several rooms in one request (one request per room, add the totals up), z coordinates, wall thickness, door openings.

Floor-plan files

This endpoint takes geometry, not files: no PDF, DXF, IFC/BIM, PNG/JPG floor plan, SVG or robot map is parsed here. Two ways from a plan file to totals:

  1. Trace it in the planner at autolay.com/en/material-calculator — upload the plan, set the scale, draw or auto-detect the room, generate, share — then use the token mode. Same engine, same numbers.
  2. Extract the room outline in any CAD or GIS tool and post its corners as room.boundary.

Get a token

  1. Generate a layout in the planner at autolay.com/en/material-calculator (or POST /api/generate-layout with a room boundary).
  2. Share it — the planner's share button, or POST /api/project/share with the session_id — which returns a share token.
  3. Call POST /api/calculate with that token.

Embed the calculator on your own site

One script tag puts the material calculator on your page. It frames /embed on autolay.com — your visitor enters the room, picks a floor covering and gets the same real, pack-rounded totals this API returns, without leaving your site. Free to use; no key, no sign-up.

<script src="https://www.autolay.com/embed.js" data-locale="de" async></script>

The widget is inserted right after the script tag. Give it a home of your own with data-target, and add a <noscript> link for visitors (and crawlers) without JavaScript:

<div id="floor-calculator"></div>
<script src="https://www.autolay.com/embed.js"
        data-locale="de"
        data-target="floor-calculator"
        data-material="template_ceramic_60x60"
        data-theme="light"
        data-currency="EUR"
        data-height="640"
        data-width="100%"
        async></script>
<noscript>
  <a href="https://www.autolay.com/de/verlegeplaner">Verlegeplaner von autolay</a>
</noscript>

Options

AttributeDefaultDescription
data-localeenWidget language: en, de, fr, es, pt, nl, it.
data-targetid of the element to render into. Without it the widget goes directly after the script tag.
data-materialfirst in catalogPre-selected tile id from GET /api/materials/catalog.
data-patternstraightLaying pattern used for the calculation.
data-currencyEURThree-letter currency code for the price fields and the total.
data-themelightlight or dark.
data-height620Initial height in pixels (200–4000). The widget then reports its real height and the frame follows it.
data-width100%CSS width: a percentage or a px/rem/em/vw length.
data-originscript originWhere to load the widget from. Only needed if you self-host the script.

Content-Security-Policy: if your page sends one, allow script-src https://www.autolay.com and frame-src https://www.autolay.com. The script adds no stylesheet and no inline <style> — a strict style-src needs no exception. Nothing is stored on the visitor's device by the widget: no cookie, no local storage, no tracking script, so it needs no consent banner of its own.

The widget writes a visible link to autolay.com next to the calculator — that link is the deal: the calculator is free, the credit link stays. If the frame cannot load (offline, blocked), the link is all that remains, so the page never shows an empty box.

Prefer to build your own interface? Call POST /api/calculate straight from the browser: the calculator endpoints answer any origin (Access-Control-Allow-Origin: *), without credentials and without a key.

Machine-readable schema

GET /api/calculate/schema describes every input and output field with its unit. The OpenAPI description of these endpoints is at /api/openapi.json.

Note: /api/ is disallowed in robots.txt — agents call the JSON directly; this page is the crawler-facing documentation.

Missing something?

If this API does not give you what you need — a field it never returns, a material or laying pattern that is not in the catalogue, a room these inputs cannot describe, or a higher rate limit — write to info@autolay.com or use the support page. Tell us what you are building and what is missing; we extend the contract on request. Please ask rather than scraping the site or reverse-engineering an internal endpoint — those change without notice, this API does not.