Get product information for a particular item
https://api.upcdatabase.org/product/{id}
curl --location --request GET 'https://api.upcdatabase.org/product/0111222333446' \ --header 'Authorization: Basic TXlUZXN0QXBwOjA5OGY2YmNkNDYyMWQzNzNjYWRlNGU4MzI2MjdiNGY2'
<?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: Basic TXlUZXN0QXBwOjA5OGY2YmNkNDYyMWQzNzNjYWRlNGU4MzI2MjdiNGY2" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
{ "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." } }