barcode

Generate QR / Aztec / Data Matrix / PDF417 codes from...

Generate QR / Aztec / Data Matrix / PDF417 codes from structured payloads (url, wifi, vcard, vevent, email, sms, tel, geo, bitcoin, json, text). QR supports rounded or dotted modules, solid colors or linear/radial gradients, transparent backgrounds, configurable error correction, and a centered logo image (URL or data URI).

post/api/barcode/generate

Request

  • Base URL: https://2s.io
  • URL: https://2s.io/api/barcode/generate
  • Auth: API key in header PAYMENT-SIGNATURE

Query parameters

trial1

Try before you buy. Set to 1 for one free real call per endpoint per hour — no wallet or payment needed — to verify the endpoint before paying. Equivalent to sending the "X-2s-Trial: 1" request header. Listed only on operations that offer a trial; the others always answer 402.

Request body

format'qr' | 'aztec' | 'datamatrix' | 'pdf417'

Format.

output'svg' | 'png' | 'dataurl'

Output.

sizeinteger

Size.

margininteger

Margin.

errorCorrection'L' | 'M' | 'Q' | 'H'

L=~7%, M=~15%, Q=~25%, H=~30% recoverable damage (QR only).

Response

OK

Changes

No recorded changes to this operation across all 1 revision of this API.