Interface: EAN barcode as an image
One image link is enough: the number is in the address, the response is the image. Use it in shops, mails and documents. The address of the old site keeps working unchanged.
Address
GET https://ean.loresoft.de/interface/ean-barcode?num=4012345678901&size=3&height=150&outputFormat=png
Parameters
| Name | Values | Default | Meaning |
|---|---|---|---|
| num | 7, 8, 12, 13 digits | - | EAN number with 8 or 13 digits; with 7 or 12 digits the check digit is added |
| size | 1 … 6 | 3 | Bar width in pixels (narrowest bar) |
| height | 100 … 300 | 150 | Image height in pixels |
| outputFormat | png · jpg · gif · svg | png | Output format (outputFormat; format works too) |
| quality | 10 … 100 | 100 | Quality, only used for jpg |
| download | true | - | true = deliver as a file to save |
Note: missing values fall back to the defaults. A number with a wrong check digit gives an image with the text "Invalid EAN", as before (status code 422).
Examples
Image in HTML
<img src="https://ean.loresoft.de/interface/ean-barcode?num=4012345678901&size=3&height=150" alt="EAN 4012345678901">
Download a file
curl -o barcode.svg "https://ean.loresoft.de/interface/ean-barcode?num=4012345678901&outputFormat=svg"
Build the address in PHP
$url = 'https://ean.loresoft.de/interface/ean-barcode?' . http_build_query([ 'num' => $ean, 'size' => 3, 'height' => 150, 'outputFormat' => 'png', ]);
Limits
Up to 600 images per hour and address. Responses can be cached by the browser for a long time.
Errors
If the number is missing, the interface answers with status 400 and a JSON object like {"err": "missing or invalid num"}; with 429 when there are too many requests.