Lookup EAN Barcode Value & Return Product Data with Java: Barcode Lookup API

Barcodes make it easy to get key details about a product, but you still need a way to search the barcode. Our EAN Lookup API will return key details about a product based on an EAN barcode number input — just that simple. Easily implement this into your project using code provided in Java below, or head to our API console page to find code available in 12 additional programming languages.

Start by installing the Java SDK with Maven. Add a reference to the repository in pom.xml:

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

After that, add one to the dependency in pom.xml:

<dependencies>
<dependency>
<groupId>com.github.Cloudmersive</groupId>
<artifactId>Cloudmersive.APIClient.Java</artifactId>
<version>v4.25</version>
</dependency>
</dependencies>

Now finish up by adding the import classes and calling the function:

// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.BarcodeLookupApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey");
Apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Apikey.setApiKeyPrefix("Token");
BarcodeLookupApi apiInstance = new BarcodeLookupApi();
String value = "value_example"; // String | Barcode value
try {
BarcodeLookupResponse result = apiInstance.barcodeLookupEanLookup(value);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BarcodeLookupApi#barcodeLookupEanLookup");
e.printStackTrace();
}

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

AnySwap Integrates with Coin98 Wallet!

Tree Traversal Using Tail Recursion

TIL 2020.1106

My first task as an intern with HNG.

An 18-Year-Old’s Frontend Development Journey

How to Convert a PDF File to PDF/A in C/C++

k8s-multinode-cluster

Why the Raspberry PI Zero W is the best fit for me

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

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

More from Medium

Integrate AWS Secrets Manager With Spring Boot Application

Convert a Photo of a Document into Text using Java

CRUD ElasticSearch — Java API Client

Amazon EC2 + SSL from Let’s encrypt in Spring Boot application