Tools API Blog
Sign in Create account

Barcode

Barcode is an API that generates a PNG image of a barcode (not QR: see QR code for that) from a text or number: for product labels, inventory, tickets, or anything you scan with a reader.

How it works

You send the data (data) and the barcode type (type), and get back a ready PNG. Defaults to Code128, the most flexible one (letters, numbers and symbols).

Available types

TypeTypical use
code128The most flexible: letters, numbers and symbols. Default.
code39Classic, uppercase letters and numbers.
ean13 / ean8Retail products (the barcode you see at a supermarket).
upca / upceLike EAN, the usual US standard.
itf14Boxes and logistics packaging.
datamatrixSmall, dense 2D code (parts, electronic components).
pdf417High-capacity 2D code (ID cards, boarding passes).
aztec2D code widely used on train tickets.

Each type requires the data to fit its format (e.g. EAN-13 needs 12 or 13 digits): if it doesn't fit, the API replies with a clear error about what's wrong, not a generic 500.

All you need

  • Your API key. Create it in your dashboard with "+ Create key". It's shown only once, so copy and save it.
  • In your automation platform, an "HTTP Request" step (n8n, Make, Zapier, Pipedream… all have one).

How to use it in n8n (step by step)

In the HTTP Request node:

  • Method: POST
  • URL: https://api.cofferdock.com/barcode
  • Send Headers: on → add two: x-api-key = your key, and Content-Type = application/json
  • Send Body: on → Body Content Type: JSON → { "data": "5901234123457", "type": "ean13" }
  • In Options → Response → Response Format: choose File

In Make: same method and URL, same JSON in the Body, treat the response as a binary file.

Options (inside the JSON)

OptionDefaultWhat it does
data-Required. The text or number to encode.
typecode128One from the table above.
scale31 to 10: how large the image comes out.
include_texttrueShow the readable number/text below the barcode.

What you get back

By default (JSON): image as base64. Add output=image for the raw binary, or output=url for a temporary link (valid 15 minutes).