Read barcodes (EAN, UPC, Code 128, Code 39, ITF…) from an image

Reads every barcode and QR code in an image and returns its type, value and position.

Request

POSThttps://barcode-generator.p.apihiver.com/v1/decode

Upload the image in the file field (max 25 MB). Instead of a file you can send JSON: {"url": "https://…"} for a public image URL, or {"base64": "…"}.

*
No file chosen
File. The image file (JPG, PNG, WebP, GIF, BMP or TIFF).

Parameters and body structure are inherited from this endpoint's definition. Changes here only apply to this test run.

Language
Client
1curl --request POST \
2  --url https://barcode-generator.p.apihiver.com/v1/decode \
3  --header 'Accept: application/json' \
4  --header 'X-API-Key: YOUR_API_KEY' \
5  --header 'content-type: multipart/form-data' \
6  --form file=@file.bin

Read barcodes (EAN, UPC, Code 128, Code 39, ITF…) from an image: Barcode Generator & Reader API reference

Reads every barcode and QR code in an image and returns its type, value and position. This endpoint is part of the Barcode Generator & Reader API: Generate EAN-13, UPC, Code 128, ISBN and other barcodes as PNG or SVG, read barcodes from images, and validate check digits.

Example response (200, application/json)

Success.

1{
2  "codes": [
3    {
4      "data": "9780141036144",
5      "type": "EAN13",
6      "position": {
7        "x": 47,
8        "y": 11,
9        "width": 370,
10        "height": 177
11      }
12    }
13  ],
14  "count": 1
15}

Errors

  • 400 — A required parameter is missing or a value has the wrong format.
    1{
    2  "error": {
    3    "code": "INVALID_INPUT",
    4    "message": "Provide a file upload, 'url', or 'base64'."
    5  }
    6}

Gateway errors (missing key, no subscription, rate limits) are listed in Error codes.