documents

Barcode and QR Code Tool API

Decode, generate or validate barcodes and QR codes. Decode reads up to 32 codes from a public HTTPS image (QR, Data Matrix, Aztec, PDF417, EAN, UPC, Code 128 and more); generate answers a temporary HTTPS URL to a PNG or SVG, kept one hour; validate checks a payload and its check digit. POST /v1/barcode with operation. Pay per request in USDC; no account, no API key.

post/v1/barcode-tools

Request

  • Base URL: https://agent.pocket.network
  • URL: https://agent.pocket.network/v1/barcode-tools
  • Auth: none required

Request body

operation'decode' | 'generate' | 'validate' | 'formats' required

decode reads an image; generate draws a code; validate checks a payload against a format; formats lists what can be read and written.

image_urlstring

For decode, the public HTTPS image to read.

paramsobject

For decode, optional {formats, try_harder, max_results (1 to 32)}. For generate and validate, {format, text (up to 4096 characters)}, and for generate also width and height (1 to 4096, default 1024), margin, error_correction (L, M, Q, H) and output_format (png or svg).

Response

The upstream response, served after payment settles.

object required

A JSON object with ok and operation. decode adds results (format, text, bytes_base64, position, orientation, is_valid) and count; generate adds output with barcode_format, image_format, width, height, bytes, url and expires_in_seconds; validate adds valid and format; formats adds read_formats, write_formats and a formats table. A refused request answers ok false with a code, e.g. invalid_check_digit.

Changes

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