Skip to content
NestSolver Docs
Browse the docs

Start

Quickstart

Make a key, send a linear cut list, and read the plan that comes back. Five minutes, one request.

The API speaks JSON over HTTPS at https://api.nestsolver.com/v1. Linear and sheet cut lists solve in one call. Nests and loads start as jobs you check until they are done. This guide takes the shortest path: one linear cut list, solved at once.

Make a key

Keys are made on the portal's API keys page with any account, the Free plan included. A key is shown once, acts in the workspace you made it in, and stops working when you revoke it or leave that workspace.

Keep it on the server side, in an environment variable or a secrets store. The examples below read it from NESTSOLVER_KEY.

Solve a cut list

Send the cut list as the request body. Lengths are strings in the unit you name, typed the way you would type them on the web form. An empty qty on a stock row means "as many as needed".

curl https://api.nestsolver.com/v1/linear/solves \
  -H "Authorization: Bearer $NESTSOLVER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "unit": "mm", "kerf": "3", "target": "waste", "strict": false,
    "stocks": [{ "length": "6000", "qty": "", "minimum_drop": "300", "zones": [] }],
    "parts": [
      { "length": "1250", "quantity": "4", "label": "Rail" },
      { "length": "840", "quantity": "6", "label": "Stile" }
    ]
  }'

Read the plan

A 200 answer is the plan: each bar of stock with its cuts in order, the leftovers worth keeping and the scrap, the figures for the whole job, and anything that did not fit.

{
  "unit": "mm",
  "bars": [
    {
      "stock_row": 0,
      "length": 6000,
      "material": "",
      "cuts": [
        { "at": 0, "length": 1250, "label": "Rail", "rush": false },
        { "at": 1253, "length": 1250, "label": "Rail", "rush": false }
      ],
      "blocked": [],
      "leftovers": [{ "start": 5012, "end": 6000, "kind": "drop" }],
      "drop": 988,
      "scrap": 0
    }
  ],
  "metrics": {
    "bars": 2,
    "stock_length": 12000,
    "parts_length": 10040,
    "drop": 1930,
    "blocked": 0,
    "scrap": 0,
    "utilization_percent": 83.7
  },
  "unplaced": [],
  "unpriced_stock_rows": [],
  "cost": null,
  "explanation": "…"
}

The sample is abridged. Every field is in the API reference under LinearReport.

A request that breaks a rule comes back as 422 with each problem naming its field, in the words the web form uses. Send the same body to POST /v1/linear/validate first to check it for free, without solving. Errors has the shapes.

Where next