DEV Community

GuGuData
GuGuData

Posted on

QR Code and Barcode APIs for Product Workflows

QR Code and Barcode APIs: Generation, Wi-Fi Access, and Image Decoding

QR codes and barcodes are small integration points that often sit inside larger business workflows. A product may need to generate a payment code, print a logistics label, add Wi-Fi access to onboarding material, or decode QR code images submitted by users.

GuGuData provides APIs for QR code generation, Wi-Fi QR code generation, general barcode generation, and QR code image decoding. This guide explains how these endpoints fit into practical product workflows.

API lineup

Workflow Method Endpoint Detail page
QR code generation POST /v1/qrcode Universal QR Code Generator
Wi-Fi QR code generation POST /v1/wifi-qrcode Wi-Fi QR Code Generator
Barcode generation POST /v1/barcode General Barcode Generation
QR code image decoding POST /v1/barcode/qrcode/decode Decode QR Code from Image

The public OpenAPI JSON is available at https://gugudata.io/assets/openapi/gugudata.openapi.3.1.json.

When to use these APIs

  • Generate QR codes for URLs, internal identifiers, invitation links, or operational handoff flows.
  • Create Wi-Fi QR codes for offices, hotels, events, or onboarding screens.
  • Generate barcodes for product labels, warehouse workflows, or printed forms.
  • Decode QR code images uploaded by users or extracted from documents.
  • Standardize code generation and decoding logic across multiple services.

Choosing the right endpoint

Use /v1/qrcode when the payload is general text or a URL. Use /v1/wifi-qrcode when the payload is a Wi-Fi network configuration and the code should be scannable by common mobile devices.

Use /v1/barcode when you need a one-dimensional barcode for product, inventory, or operational labels. Use /v1/barcode/qrcode/decode when the input is an image and your application needs the decoded value rather than a generated image.

Example requests

Generate a QR code:

curl -X POST "https://api.gugudata.io/v1/qrcode?appkey=YOUR_APPKEY" \
  -H "Content-Type: application/json" \
  -d '
{
  "content": "https://www.gugudata.io",
  "size": 200
}
'
Enter fullscreen mode Exit fullscreen mode

Decode a QR code image:

curl -X POST "https://api.gugudata.io/v1/barcode/qrcode/decode?appkey=YOUR_APPKEY" \
  -F "file=@./qrcode.png"
Enter fullscreen mode Exit fullscreen mode

Response handling

Generation endpoints usually return a URL to the generated image. Decoding returns the parsed payload and detection details:

{
  "dataStatus": {
    "statusCode": 200,
    "status": "SUCCESS",
    "statusDescription": "successfully",
    "responseDateTime": "2026-04-29T00:00:00Z",
    "dataTotalCount": 1,
    "requestParameter": ""
  },
  "data": {
    "raw": "https://www.gugudata.io",
    "type": "QRCODE",
    "format": "QR_CODE",
    "parsed": ["https://www.gugudata.io"],
    "points": []
  }
}
Enter fullscreen mode Exit fullscreen mode

Treat decoded values as user input. Validate URLs, identifiers, and business payloads before using them in privileged workflows.

HTTP status codes

HTTP status Meaning Recommended handling
200 Request processed successfully. Parse the documented response body for the endpoint result.
400 Invalid request parameters or request format. Check required fields, uploaded image format, size, and barcode type.
401 Missing or unknown application key. Send a valid appkey with the request.
403 The application key is recognized but access is not allowed. Check subscription, trial state, and endpoint access.
429 Request rate or trial usage limit exceeded. Reduce concurrency or retry after the limit window resets.
500 Internal service error. Retry later or contact support if the error persists.
503 Upstream service unavailable. Retry later when the dependency is available again.

Implementation notes

  • Normalize payloads before generating QR codes so duplicate business records do not produce inconsistent codes.
  • Use server-side requests when the appkey must remain private.
  • Validate decoded payloads before redirecting users or writing values into your database.
  • Keep image upload size limits explicit for decoding workflows.
  • Use demo endpoints for quick checks, then move to authenticated production endpoints.

FAQ

Can I generate Wi-Fi QR codes with the general QR code endpoint?

Use the Wi-Fi QR code endpoint when the payload represents Wi-Fi access. It keeps the request fields clearer and better aligned with Wi-Fi QR code use cases.

Should I trust decoded QR code content automatically?

No. Decoded values can contain arbitrary text or URLs. Validate the payload against your product rules before acting on it.

Which endpoint should I use for printed product labels?

Use General Barcode Generation when the label requires a standard barcode, and use Universal QR Code Generator when the label should carry a URL or flexible text payload.

For more developer APIs, visit GuGuData.

Top comments (0)