The Barcode Lookup API documentation describes how to use our RESTful API service. All API responses are returned in JSON format. If you have additional questions, please email support.
Every user account is assigned one unique API key upon account creation. Authenticate each API call by including your API Key in every request.
https://api.barcodelookup.com/v3/products?key=your_api_key
Parameter | Data Type | Example Value | Description |
---|---|---|---|
barcode | string | 865694301167 | barcode value must be 7, 8, 10, 11, 12, 13 or 14 digits long |
mpn | string | LXCF9407 | MPN parameter is the manufacturer part number |
asin | string | B079L4WR4T | ASIN parameter is the Amazon Standard Identification Number |
title | string | Red Running Shoes | search by product name (title) for any item |
category | string | Home & Garden > Decor | search by category - based on Google's product taxonomy |
manufacturer | string | Samsung | search by manufacturer - use double quotes ("") around value for an exact match |
brand | string | Calvin Klein | search by brand - use double quotes ("") around value for an exact match |
search | string | Air Jordan Red Shoes Size 40 | query all the search fields including title, category, brand and MPN |
metadata | string | y | retrieve the number of pages, products and cursor positions for any search query |
cursor | string | AoEpMTAwMDMxMDEw | current and next position in a returned set of data |
page | integer | 956 | pagination for API results (1,000 maximum) |
geo | string | us, gb, ca, eu (only possible values) | filter online store results by geographical location |
formatted | string | y (only possible value) | beautify JSON output - recommended only for web browser use |
key | string | isDzhm4Kav42OD93NEO | unique API key (required) |
Note: Use multiple API parameters (mpn, title, category and/or geo) to filter your search results. The 'search' parameter is used for a more general search-everything response. |
curl --include --header 'Accept: application/json' 'https://api.barcodelookup.com/v3/products?barcode=3614272049529&key=your_api_key'
https://api.barcodelookup.com/v3/products?barcode=3614272049529&formatted=y&key=your_api_key
200
{ "products": [ { "barcode_number": "886736874135", "barcode_formats": "UPC-A 886736874135, EAN-13 0886736874135", "mpn": "CE-XLR3200", "model": "XLR", "asin": "B01KUHG2G8", "title": "Nike Red Running Shoes - Size 10", "category": "Media > Books > Print Books", "manufacturer": "Xerox", "brand": "Xerox", "contributors": [ { "role": "author", "name": "Blake, Quentin" }, { "role": "publisher", "name": "Greenwillow Books" } ], "age_group": "adult", "ingredients": "Organic Tapioca Syrup, Organic Dried Cane Syrup, Natural Flavor.", "nutrition_facts": "Protein 0 G, Total lipid (fat) 0 G, Energy 300 KCAL, Sugars, total including NLEA 40 G.", "energy_efficiency_class": "A+ (A+++ to D)", "color": "blue", "gender": "female", "material": "cloth", "pattern": "checkered", "format": "DVD", "multipack": "8", "size": "7 US", "length": "45 in", "width": "30 in", "height": "22 in", "weight": "7 lb", "release_date": "2003-07-28", "description": "One of a kind, Nike Red Running Shoes that are great for walking, running and sports.", "features": [ "Rugged construction", "Convenient carrying case", "5 year warranty" ], "images": [ "https://images.barcodelookup.com/5219/52194594-1.jpg", "https://images.barcodelookup.com/5219/52194594-2.jpg", "https://images.barcodelookup.com/5219/52194594-3.jpg" ], "last_update": "2022-03-03 20:28:19", "stores": [ { "name": "Newegg.com", "country": "US", "currency": "USD", "currency_symbol": "$", "price": "41.38", "sale_price": "35.99", "tax": [ { "country": "US", "region": "US", "rate": "5.00", "tax_ship": "no" } ], "link": "https://www.newegg.com/product-link", "item_group_id": "AB-4312", "availability": "in stock", "condition": "new", "shipping": [ { "country": "US", "region": "US", "service": "Standard", "price": "8.49 USD" } ], "last_update": "2021-05-19 09:07:42" }, ....., ..... ], "reviews": [ { "name": "Josh Keller", "rating": "5", "title": "Love these shoes!", "review": "A stylish and great fitting shoe for walking and running.", "date": "2015-03-19 21:48:03" }, ....., ..... ] } ] }
Product Attribute | Data Type | Example Value |
---|---|---|
barcode_number | integer | 7433144698629 |
barcode_formats | string | UPC-A 811158031873, EAN-13 0811158031873 |
mpn | string | CE-XL3200 |
model | string | 4910 |
asin | string | B00Q6IU52S |
title | string | Lord Of The Rings |
category | string | Home & Garden > Decor |
manufacturer | string | LEGO Systems, Inc. |
brand | string | Ralph Lauren |
contributors | array | author: J. K. Rowling |
age_group | string | newborn |
ingredients | string | Tomatoes, Onions, Celery |
nutrition_facts | string | Calories 85, Protein 7g |
energy_efficiency_class | string | A+ (A+++ to D) |
color | string | Purple |
gender | string | Male |
material | string | Leather |
pattern | string | Dotted |
format | string | Paperback |
multipack | string | 6 |
size | string | Large |
length | string | 3.7 in |
width | string | 4.8 in |
height | string | 2.5 in |
weight | string | 0.64 lb |
release_date | string | 2012-04-15 |
description | string | Detailed product description... |
features | array | •Long battery life •Batteries included |
images | array | https://images.barcodelookup.com/id |
last_update | string | 2021-05-19 09:07:42 |
Store Attribute | Data Type | Example Value |
---|---|---|
name | string | ABC Widgets Ltd. |
country | string | US |
currency | string | USD |
currency_symbol | string | $ |
price | string | 12.99 |
sale_price | string | 7.49 |
tax | array | country: US, region: US, rate: 7.00, tax_ship: no |
link | string | https://www.storename.com/product-link |
item_group_id | string | A1BXC-GD2 |
availability | string | in stock |
condition | string | new |
shipping | array | country: US, region: US, service: Ground, price: 7.29 USD |
last_update | string | 2022-04-17 12:09:18 |
Review Attribute | Data Type | Example Value |
---|---|---|
name | string | Gary Jones |
rating | string | 4.5 |
title | string | Quick Charge |
review | string | Very fast charger that's always reliable! |
date | string | 2021-06-22 07:31:18 |
Parameter | Data Type | Description |
---|---|---|
formatted | string | beautify JSON output |
key | string | your unique API key (required) |
curl --include --header 'Accept: application/json' 'https://api.barcodelookup.com/v3/rate-limits?key=your_api_key'
https://api.barcodelookup.com/v3/rate-limits?formatted=y&key=your_api_key
200
{ "allowed_calls_per_month": "500000", "remaining_calls_per_month": "408498", "allowed_calls_per_minute": "100", "remaining_calls_per_minute": "97" }
Below are a few sample scripts to help you get started. The code examples demonstrate how to make an API call and print output in several popular programming languages.
<?php $api_key = 'ENTER_YOUR_API_KEY_HERE'; $url = 'https://api.barcodelookup.com/v3/products?barcode=077341125112&formatted=y&key=' . $api_key; $ch = curl_init(); $data = get_data($url, $ch); $response = array(); $response = json_decode($data); echo '<strong>Barcode Number:</strong> ' . $response->products[0]->barcode_number . '<br><br>'; echo '<strong>Title:</strong> ' . $response->products[0]->title . '<br><br>'; echo '<strong>Entire Response:</strong><pre>'; print_r($response); echo '</pre>'; function get_data($url, $ch) { curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $data = curl_exec($ch); curl_close($ch); return $data; }
const http = require('http'); const apiKey = 'ENTER_YOUR_API_KEY_HERE'; const barcode = '077341125112'; // Example barcode number - update accordingly const apiUrl = `https://api.barcodelookup.com/v3/products?barcode=${barcode}&key=${apiKey}`; http.createServer(async (req, res) => { if (req.url === '/') { const response = await fetch(apiUrl); if (response.status === 200) { const data = await response.json(); res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify(data, null, 2)); // Pretty-printed JSON } else if (response.status === 403) { res.writeHead(403, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ error: 'Invalid API key' })); } else if (response.status === 404) { res.writeHead(404, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ error: 'No data returned' })); } else if (response.status === 429) { res.writeHead(429, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ error: 'Exceeded API call limits' })); } } }).listen(3000);
import urllib.request import json import pprint api_key = "ENTER_YOUR_API_KEY_HERE" url = "https://api.barcodelookup.com/v3/products?barcode=077341125112&formatted=y&key=" + api_key with urllib.request.urlopen(url) as url: data = json.loads(url.read().decode()) barcode = data["products"][0]["barcode_number"] print ("Barcode Number: ", barcode, "\n") name = data["products"][0]["title"] print ("Title: ", name, "\n") print ("Entire Response:") pprint.pprint(data)
require 'net/http' require 'json' api_key = 'ENTER_YOUR_API_KEY_HERE' url = 'https://api.barcodelookup.com/v3/products?barcode=077341125112&formatted=y&key=' + api_key uri = URI(url) response = Net::HTTP.get(uri) data = JSON.parse(response) barcode = data['products'][0]['barcode_number'] puts "Barcode Number: #{barcode} \n\n" name = data['products'][0]['title'] + "\n\n" puts "Title: #{name}" puts 'Entire Response:' puts JSON.pretty_generate(data)
import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import com.google.gson.Gson; import com.google.gson.GsonBuilder; public class Sample { public class Store { public String name; public String price; public String link; public String currency; public String currency_symbol; } public class Review { public String name; public String rating; public String title; public String review; public String date; } public class Product { public String barcode_number; public String barcode_formats; public String mpn; public String model; public String asin; public String title; public String category; public String manufacturer; public String brand; public Object[] contributors; public String age_group; public String ingredients; public String nutrition_facts; public String color; public String format; public String multipack; public String size; public String length; public String width; public String height; public String weight; public String release_date; public String description; public String[] features; public String[] images; public Store[] stores; public Review[] reviews; } public class RootObject { public Product[] products; } public static void main(String[] args) { try { URL url = new URL("https://api.barcodelookup.com/v3/products?barcode=077341125112&formatted=y&key=ENTER_YOUR_API_KEY_HERE"); BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream())); String str = ""; String data = ""; while (null != (str= br.readLine())) { data+=str; } Gson g = new Gson(); RootObject value = g.fromJson(data, RootObject.class); String barcode = value.products[0].barcode_number; System.out.print("Barcode Number: "); System.out.println(barcode); String name = value.products[0].title; System.out.print("Title: "); System.out.println(name); System.out.println("Entire Response:"); System.out.println(data); } catch (Exception ex) { ex.printStackTrace(); } } }
use LWP::Simple; use JSON; use Data::Dumper; my $api_key = "ENTER_YOUR_API_KEY_HERE"; my $url = "https://api.barcodelookup.com/v3/products?barcode=077341125112&formatted=y&key=".$api_key; my $json = get( $url ); die "Could not get $url!" unless defined $json; my $data = decode_json( $json ); my $barcode = $data->{products}->[0]->{barcode_number}; print "Barcode Number: ".$barcode."\n"; my $name = $data->{products}->[0]->{title}; print "Title: ".$name."\n"; print "Entire Response: \n"; print Dumper $data;
using System; using System.Net; using Newtonsoft.Json; using System.Collections.Generic; public class Store { public String name { get; set; } public String price { get; set; } public String link { get; set; } public String currency { get; set; } public String currency_symbol { get; set; } } public class Review { public String name { get; set; } public String rating { get; set; } public String title { get; set; } public String review { get; set; } public String date { get; set; } } public class Product { public String barcode_number { get; set; } public String barcode_formats { get; set; } public String mpn { get; set; } public String model { get; set; } public String asin { get; set; } public String title { get; set; } public String category { get; set; } public String manufacturer { get; set; } public String brand { get; set; } public IList<object> contributors { get; set; } public String age_group { get; set; } public String ingredients { get; set; } public String nutrition_facts { get; set; } public String color { get; set; } public String format { get; set; } public String multipack { get; set; } public String size { get; set; } public String length { get; set; } public String width { get; set; } public String height { get; set; } public String weight { get; set; } public String release_date { get; set; } public String description { get; set; } public IList<string> features { get; set; } public IList<string> images { get; set; } public IList<Store> stores { get; set; } public IList<Review> reviews { get; set; } } public class RootObject { public IList<Product> products { get; set; } } public class Program { public static void Main(string[] args) { using (WebClient webClient = new System.Net.WebClient()) { WebClient n = new WebClient(); string api_key = "ENTER_YOUR_API_KEY_HERE"; string url = "https://api.barcodelookup.com/v3/products?barcode=077341125112&formatted=y&key=" + api_key; var data = n.DownloadString(url); var name = JsonConvert.DeserializeObject<RootObject>(data).products[0].title; System.Console.Write("Title: "); System.Console.WriteLine(name); var barcode = JsonConvert.DeserializeObject<RootObject>(data).products[0].barcode_number; System.Console.Write("Barcode Number: "); System.Console.WriteLine(barcode); System.Console.WriteLine("Entire Response: "); System.Console.WriteLine(data); } } }
When you make a call with a UPC, EAN, ISBN or GTIN, the barcode parameter is used. A barcode query always returns one product, if data for that item is available.
https://api.barcodelookup.com/v3/products?barcode=815144010392&formatted=y&key=your_api_key
Query a partial barcode number by combining the first 6 or more digits, followed by an asterisk (*). This is particularly useful when you know the company's GS1 Company Prefix.
https://api.barcodelookup.com/v3/products?barcode=091207*&formatted=y&key=your_api_key
Query up to 10 barcode numbers simultaneously by combining each one with a comma (,).
https://api.barcodelookup.com/v3/products?barcode=814323021563,193574113730,614409280514&formatted=y&key=your_api_key
Make a query using the mpn, asin, title, category, manufacturer or brand parameters, individually or by combining these fields using the & (ampersand) operator. The more parameters you use, the more your output is filtered since you can target multiple fields at once with different values.
When you use a search parameter or when you combine parameters, you may retrieve more than 1 result and up to 10 results per page. Similar to how a search engine works: the first result is typically the most relevant, and the rest of the results become less relevant as you move down the list.
https://api.barcodelookup.com/v3/products?category=Apparel%20%26%20Accessories%20%3E%20Shoes&title=Running%20Shoes&formatted=y&key=your_api_key
Use double quotes on manufacturer and brand values to get an exact match. Without quotes, the results may include values with additional words or variations - a fuzzy match result.
https://api.barcodelookup.com/v3/products?brand=%22Calvin%20Klein%22&key=&formatted=y&key=your_api_key
Use the search parameter to query all the parameters with a single search string.
https://api.barcodelookup.com/v3/products?search=olive%20oil%20from%20italy&formatted=y&key=your_api_key
Set the metadata parameter to 'y' to retrieve the number of pages and products for any search query. You'll also retrieve the 'next_cursor' value, which is useful for looping through the results.
https://api.barcodelookup.com/v3/products?manufacturer=samsung&metadata=y&cursor=y&formatted=y&key=your_api_key
Use the cursor parameter in conjunction with the metadata parameter to loop through all the API results. Your first query should be 'cursor=y'. Take the 'next_cursor' value from the metadata response and set the value accordingly for 'cursor' on each consecutive query. Utilize the 'metadata' and 'cursor' parameter for any API query that returns multiple results, including all 'search' parameters and partial 'barcode' queries.
https://api.barcodelookup.com/v3/products?manufacturer=samsung&metadata=y&cursor=AoEpMTAwMjgyOTY4&formatted=y&key=your_api_key
You can also use the page parameter to loop through results. The 'page' parameter simplifies looping since you don't need to keep track of the cursor value. The drawback of the 'page' parameter is that you can only use it for up to 1,000 pages. So, if you're always going to loop through 10,000 results or less (10 results per page X 1,000 pages), then the 'page' parameter might be a slightly simpler solution then the above metadata and cursor looping method.
https://api.barcodelookup.com/v3/products?brand=apple&page=91&formatted=y&key=your_api_key
In the above examples, the formatted parameter is used. Setting this parameter equal to 'y' is convenient for beautifying the JSON output in your browser, but not necessary for making API queries.
Every API query must be properly encoded.
Apparel & Accessories > Shoes
is represented as Apparel%20%26%20Accessories%20%3E%20Shoes
in an API query.
Your monthly API call limit is determined by your API plan subscription.
The monthly API quota is only deducted when data is returned from a request, which will have a HTTP 200 status response code.
A maximum of 100 requests per minute are allowed. This rate limit can be increased for Enterprise accounts.
HTTP status codes returned from API:
You can update your API customer profile and billing information by logging in to your API account.