How to Implement an EAN Barcode Look Up API in PHP

1 min readMar 14


Scanning 2D EAN barcodes isn’t the only way to find information about a product. You can process the EAN number with a Barcode Look Up API to accomplish the same goal — and thankfully, you can implement one for free using the PHP code examples provided below.

First, run the following command to install the SDK:

composer require cloudmersive/cloudmersive_barcode_api_client

After that, use the below code to structure your API call. Before you do that, you’ll first need to grab a free-tier API key by registering a free account on our website (this allows a limit of 800 API calls per month):

require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');

$apiInstance = new Swagger\Client\Api\BarcodeLookupApi(

new GuzzleHttp\Client(),
$value = "value_example"; // string | Barcode value

try {
$result = $apiInstance->barcodeLookupEanLookup($value);
} catch (Exception $e) {
echo 'Exception when calling BarcodeLookupApi->barcodeLookupEanLookup: ', $e->getMessage(), PHP_EOL;

Each request will return details about the product matching the input EAN value. Simple as that!




There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.