Get product information for a particular item
https://api.upcdatabase.org/product/{id}
{id} is the UPC or EAN number
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.upcdatabase.org/product/0111222333446', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Authorization: Bearer THISISALIVEDEMOAPIKEY19651D54X47' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
var settings = { "url": "https://api.upcdatabase.org/product/0111222333446", "method": "GET", "timeout": 0, "headers": { "Authorization": "Bearer THISISALIVEDEMOAPIKEY19651D54X47" }, }; $.ajax(settings).done(function (response) { console.log(response); });
curl --location --request GET 'https://api.upcdatabase.org/product/0111222333446' \ --header 'Authorization: Bearer THISISALIVEDEMOAPIKEY19651D54X47'
{ "success": "true", "barcode": "0123456789510", "title": "General Item Name", "alias": "ShortName", "description": "A sentence or two describing the item. It should cover the basics.", "brand": "GoodBrand", "manufacturer": "Manufacturer", "mpn": "Manu Part Number", "msrp": "9.99", "ASIN": "AmazonID", "category": "Plumbing", "metadata": { "size": "", "color": "", "gender": "", "age": "", "length": "", "unit": "", "width": "", "height": "", "weight": "", "quantity": "", "publisher": "", "genre": "", "author": "", "relasedate": "" }, "stores": [ { "store": "Mom & Pop Shop", "price": "14.99", "https:\/\/www.momandpop.com\/product.html", }, { "store": "Big Brand Store", "price": "10.99", "https:\/\/www.bigstore.com\/product\/dfds4f\/09234237492", } ], "images": [ "https:\/\/images.upcdatabae.org\/fajfasf4.jpg", "https:\/\/images.upcdatabae.org\/x84jffue.jpg" ], "reviews": { "thumbsup": 67, "thumbsdown": 5 } }
{ "success": false, "error": { "code": 403, "message": "Bad Request. The code you are trying to enter does not contain all digits." } }
{ "success": false, "error": { "message": "Your API Key is invalid. Please check the format.", "endpoint": "product", "query": "0111222333488", "apikey": "DEE9313946318266A46F5666D2F8590s" }, "time": 1585068599 }
{ "success": false, "error": { "code": 404, "message": "Not Found. No product could be found with that code." } }