zpl.tools
API ReferenceRendering

Render one label via GET (ZPL in the URL)

This GET variant carries URL-encoded ZPL as the final path segment

GET /compatibility/labelary/v1/printers/{dpmm}/labels/{dimensions}/{index}/{zpl} This GET variant carries URL-encoded ZPL as the final path segment. It suits a quick link, but the URL limit is about 16 KB. Use a POST endpoint for a longer label. Requires an API key in the X-API-Key header.

Parameters

Path parameters

NameTypeRequiredDescription
dpmm6dpmm | 8dpmm | 12dpmm | 24dpmmYesPrinter resolution in dots-per-millimeter. 8dpmm = 203 DPI, 12dpmm = 300 DPI, 24dpmm = 600 DPI, 6dpmm = 152 DPI.
dimensionsstringYesLabel size in inches as {width}x{height}. Each dimension must be between 0.1 and 15 inches.
indexintegerYesZero-based index of the label in the document. PNG output requires it.
zplstringYesURL-encoded ZPL source.

Headers

NameTypeRequiredDescription
Acceptimage/png | application/pdfNoOutput format. image/png (the default) or application/pdf. Any other value defaults to PNG.
X-Rotation0 | 90 | 180 | 270NoClockwise rotation of the rendered output. Any other value returns 400. The renderer applies it to PNG output only; PDF rotation is not implemented yet.
X-QualityBitonalNoSet to Bitonal (case-insensitive) to post-process PNG output to 1-bit black and white. Any other value keeps the default grayscale/color rendering. PNG only.
X-LinterOnNoSet to On (case-insensitive) to request renderer diagnostics. The response then carries an X-Warnings header with up to 20 warnings. See the Diagnostics Reference.
X-Page-Sizeletter | a4 | legal | a3NoOptional target page size for PDF output. The API validates the value, but applies the page layout only in part. Omit for label-sized pages.
X-Page-Orientationportrait | landscapeNoOptional page orientation for X-Page-Size.
X-Page-LayoutstringNoOptional grid layout as {cols}x{rows}. With X-Page-Size, the API validates that the labels fit vertically on the page.
X-Page-Alignleft | right | center | justifyNoHorizontal alignment of labels on the page, for X-Page-Size. Any other value returns 400. The renderer does not apply page composition yet.
X-Page-Vertical-Aligntop | bottom | center | justifyNoVertical alignment of labels on the page, for X-Page-Size. The API only validates it.
X-Label-Borderdashed | solid | noneNoBorder around each label on a composed page. The API only validates it.

Responses

200

Rendered label. Content type follows the Accept header.

Headers:

  • X-Total-Count — Total number of labels the ZPL document renders.
  • X-Warnings — Present only when the request carries X-Linter: On and the render reports diagnostics. Pipe-delimited entries of {byteIndex}\|{byteSize}\|{commandName}\|{paramNumber}\|{message}, limited to 20 warnings.
  • Content-Disposition — Suggested filename for the rendered output, e.g. inline; filename="label.png".

Content-Type: image/png

Content-Type: application/pdf

400

Invalid request parameters or ZPL. Body is plain text prefixed with ERROR: .

Content-Type: text/plain

ERROR: Unknown print density 10; valid values: 6, 8, 12, 24

401

Missing, invalid, or expired API key.

Content-Type: application/json

FieldTypeRequiredDescription
errorstringYes
{
  "error": "Missing or invalid Authorization header"
}

404

Label index out of range, missing ZPL, or an unrecognized path. Body is plain text prefixed with ERROR: .

Content-Type: text/plain

ERROR: Requested 2nd label but ZPL only generated 1 label

500

ZPL failed to parse/render on the server.

Content-Type: text/plain

ZPL parse error: unexpected end of input

503

The API-key store is not ready. Retry shortly.

Content-Type: application/json

FieldTypeRequiredDescription
errorstringYes
{
  "error": "API key store initialization failed"
}

Example request

curl -X GET "https://api.zpl.tools/compatibility/labelary/v1/printers/8dpmm/labels/4x6/0/%5EXA%5EFO50%2C50%5EFDHello%5EFS%5EXZ" \
  -H "X-API-Key: your_api_key_here" \
  -H "Accept: image/png"