API
Free during beta. The same generator this site runs, callable from your own code. 479 templates, of which 311 have been checked against the published standard drawings — and the API tells you which.
Getting a key. Keys are issued by hand during the beta. Email [email protected], say briefly what you are building, and we will send you one. There is no form and no sales call — but we do read the replies, and what people are building is the main thing we are trying to learn from the beta.
Start here
Once you have a key, this works from any terminal:
curl -H "Authorization: Bearer YOUR_KEY" -o box.dxf \
"https://boxblanks.com/api/v1/dieline?code=0201&L=400&W=300&D=200&format=dxf"
That is a 400 × 300 × 200 mm regular slotted case as a DXF, ready for a cutting table. Change
format to pdf, svg or json and everything else
stays the same.
Every format returns the flat blank — the dieline itself, with cut, crease and
perforation on separate layers. There is no folded 3D view in the API: the one on this site is
built in the browser from the same geometry, and if you want that in your own interface you would
render it yourself from format=json. The SVG is a drawing of the blank and can be
dropped straight into a page.
The key can go in an Authorization: Bearer header, an X-API-Key header,
or as ?key= on the query string — whichever your system can manage. Plenty of the
things that would call this are report writers and spreadsheet macros that cannot set a header.
What "free during beta" means
It means free, now, with no card and no commitment — and that we are not promising it is free forever. Saying so plainly at the start seems better than saying "free" and revisiting it later, which is the sort of thing that makes people feel caught out.
If it does become paid, it will be because enough people are running it inside real products for that to make sense, and we would come to those people directly rather than switching something off. Anything built during the beta will get fair notice.
Endpoints
Base URL https://boxblanks.com/api/v1. Everything returns JSON except a generated
drawing, which returns the file itself with its own content type. Responses carry
Access-Control-Allow-Origin: *, so browser code can call this directly.
GET /dieline
Generate a dieline. The only required parameter is code; every dimension falls back
to that template's own sensible default, so ?code=0201 alone returns a real box.
| Parameter | Meaning |
|---|---|
code | Which template — 0201, 0427, RTE. Required. |
L, W, D | Length, width and depth in millimetres, 1–5000. |
mode | inside (default), crease or outside — which face of the board your dimensions describe. |
format | svg (default), dxf, pdf or json. |
grade | Board grade id. Sets caliper, which drives the fold allowances. |
thickness | Board caliper in mm, if you would rather state it than name a grade. |
params | Per-template settings — glue lap width, flap depth and so on. POST only, as an object. Ask /templates/{code} what a template accepts. |
Set mode deliberately. It decides whether your dimensions describe
the inside of the finished box, the crease lines, or the outside, and it changes how much board
the blank uses. A 0201 at 400 × 300 × 200 comes out at 0.7322 m² on inside and
0.7030 m² on outside — about 4% of the board, on every quote, if you price by area.
It defaults to inside, which is what most customers mean when they say a box needs
to fit something, but it is worth being explicit rather than inheriting a default.
format=json returns no drawing at all — just the blank's size, area and piece count.
That is the cheap call for a quoting system that needs to price board and never renders anything:
curl -H "Authorization: Bearer YOUR_KEY" \
"https://boxblanks.com/api/v1/dieline?code=0201&L=400&W=300&D=200&format=json"
{
"code": "0201",
"name": "Regular Slotted Container (RSC)",
"verified": "plate",
"blank": { "widthMm": 1447, "heightMm": 506, "areaM2": 0.732182, "pieces": 1 },
"counts": { "panels": 13, "creases": 12, "outline": 1 },
"warnings": []
}
POST /dieline
Identical, but takes JSON — which is how you set a template's own parameters, since those are an object rather than a flat query string:
curl -X POST https://boxblanks.com/api/v1/dieline \
-H "Authorization: Bearer YOUR_KEY" \
-H "content-type: application/json" \
-d '{"code":"0201","L":400,"W":300,"D":200,"format":"dxf","params":{"glueLap":40}}' \
-o box.dxf
GET /templates
The whole catalogue. Filter with ?family=FEFCO, ?verified=plate, or
?q= for a free-text search across codes, names, descriptions and tags.
curl -H "Authorization: Bearer YOUR_KEY" \
"https://boxblanks.com/api/v1/templates?verified=plate" | jq '.count'
GET /templates/{code}
One template in full, including every parameter with its range and default. Call this before generating if you are building a form — it tells you exactly what that template accepts, so you never have to hard-code a list that goes stale.
Each parameter carries a kind (number, bool or
enum), a label, a default, and whatever else applies:
min, max, step and unit for a number,
options for an enum, and a line of help text. It is enough to render a
control from, rather than describe one.
It also carries advanced, which is the flag this site uses to decide what sits
behind a "show advanced" toggle. Most styles mark at least one — a 0216 marks
slot and taper but not glueLap. Honouring it is the
difference between offering a customer three fields and seven.
GET /usage
What your own key has spent, and what is left. Returns both allowances with the time until each refills, plus your recorded totals and a breakdown by endpoint — so "are we near the limit" has an answer that does not involve emailing us.
curl -H "Authorization: Bearer YOUR_KEY" https://boxblanks.com/api/v1/usage
{
"plan": "trial",
"trial": { "endsAt": "2026-10-03T09:12:44.000Z", "over": false },
"allowance": {
"quota": { "limit": 30000, "remaining": 29847, "resetSeconds": 6612, "per": "month" },
"minute": { "limit": 60, "remaining": 236, "resetSeconds": 1 }
},
"recorded": { "calls": 153, "units": 594, "throttled": 0, "errors": 1 }
}
It reports the asking key and nothing else — there is no view here of anyone else's traffic. The counts exclude the request asking for them, which is recorded once it has been answered.
POST /report
The one route that needs no key — it is the form on every template page, used by people who
have no reason to have one. Tell us a template is wrong. Send code, a category, and
actual describing what you got; expected, evidence and a
state object are all worth including because they are what makes a report
fixable. Give an email and set notify to be told when it is fixed.
The field no other generator returns
Every template carries verified. "plate" means that blank has been
compared by machine against the drawing published in the FEFCO Code and matched it.
"approx" means the construction is right and it folds, but it has not been matched
against a plate in that detail.
This matters if you are putting our output in front of your own customers. You can filter to only the checked ones, or show the distinction rather than implying a confidence nobody measured. How the check works explains what it does, and — just as importantly — the four things it cannot do.
Coverage is not uniform, and the average flatters it. Corrugated is the better-covered half:
| Standard | Checked against a plate |
|---|---|
| FEFCO (corrugated) | 194 of 256 |
| ECMA (folding carton) | 117 of 202 |
An unchecked template is usually not one that failed. Most are trade and display styles that appear in neither published standard, so there has never been a plate to compare them against — which is a different thing from a blank we measured and found wanting, and the API says which you are looking at.
Rate limits
Two limits, and they both depend on your plan. During the beta a key gets 30,000 calls a month, which is far more than a real integration uses.
The second is a per-minute ceiling, and it is the one worth understanding. It is measured in units rather than calls: generating a drawing counts as 4, since it is the only call that does real work, and reading the catalogue counts as 1. Batch work feels this limit; a configurator responding to a person never will.
Ask rather than assume.
GET /api/v1/usage reports your own key's two allowances and what is left of each.
Read that instead of hard-coding a number — the per-minute allowance is larger on the
paid plans, so a figure copied from this page today would understate what you have
later.
Both refill continuously rather than resetting. The monthly allowance is a bucket, not a counter that clears on the 1st — spend a month's worth in an afternoon and it comes back steadily rather than locking you out for three weeks, and a quiet month is not lost.
The monthly figure is set well above what a real integration needs, and is not there to meter you. What it actually prevents is a loop in somebody's code quietly running all night.
Every response reports both buckets. RateLimit-Limit,
RateLimit-Remaining and RateLimit-Reset describe the per-minute bucket;
RateLimit-Quota-Limit, RateLimit-Quota-Remaining and
RateLimit-Quota-Reset describe the monthly one, and
RateLimit-Policy states both windows. A refusal is a 429 with
Retry-After in seconds.
The older RateLimit-Day-* headers are still sent, reporting the same
bucket, so nothing already reading them breaks. They are deprecated: the allowance is monthly
now, and RateLimit-Quota-* is the pair to read.
Watch the monthly figure rather than the per-minute one. The minute bucket refills in seconds and
nobody plans around it; the monthly allowance is the one that can stop a working afternoon, and it
is the sensible thing to alert on. GET /usage returns the same numbers on demand if
you would rather ask than read headers.
Cache, and you will probably never see either limit. Generation is deterministic: the same code at the same dimensions in the same format returns byte-identical output every time, so a cache keyed on those is safe to keep indefinitely. Most callers ask for the same few hundred boxes over and over. A template's parameters change about never, so those are worth holding too.
If you are generating a live preview as somebody types, debounce it — regenerating on every keystroke in a dimension field will reach the per-minute ceiling almost immediately. Generate on blur, or after a pause.
If your job genuinely needs more, email us and say what it is doing; that is exactly the sort of thing we want to hear.
Errors
Standard status codes, and a JSON body with an error that says what to change.
Bad input is rejected rather than quietly corrected: ask for a 20-metre box and you get a
400, not a silently clamped 5-metre one, because the first is a bug you want to
hear about and the second is one you find at the cutting table.
| Status | Meaning |
|---|---|
400 | Something in the request is wrong — an unknown parameter, a dimension out of range, a value outside a template's own limits. |
401 | No key was sent. Email [email protected] for one. |
403 | The key was not recognised. Check it was copied whole. |
404 | No template with that code, or no such endpoint. |
429 | Rate limited. Wait Retry-After seconds. |
500 | The generator failed on a request that looked legal. That is our bug — please report it, either through the form on any template page or by email. |
Terms, briefly
Free during beta, including inside a product you charge for, and you will get 30 days’ notice by email before any charge applies to you.
Every file carries a small Box Blanks line — metadata and a margin note in SVG, a header field in DXF, the document properties in PDF. Please keep it on files you pass to a customer. Removing it for production is fine and expected: it is its own layer so a die maker can drop it before cutting. If you need it off what you publish as well, get in touch and we will sort something out.
There is no uptime guarantee and no support contract, so do not put it on a critical path without caching. And as everywhere else on this site: a dieline is a drawing, not a guarantee — always cut and fold a sample before committing to a die.
The full API terms are short and worth two minutes if you are shipping this in a product.
Building something with this? Tell us. Knowing what people actually call is how the limits, the formats and the eventual pricing get set sensibly — and during a beta it is most of the point.