Code - חיפוש מחיר לפי קוד מוצר

Get list of products with specific item code across supermarket chains. Since some of the chains does not report the full code but only a short version of it, this operation performs internally an OR operation to bring items where either item_code OR item_code_short matches the provided argument.  

Request parameters: 
  • item_code  - represent a code of product 
  • prepare_chain_names - Optional. Sending this parameter with value "true" will add "chain_name" field to returned items
  • prepare_stores_names - Optional. Sending this parameter with value "true" will add "store_name", "address", "city" fields to returned items
Sample code: 

<?php

$params = array(
    "api_key" => "YOUR_API_KEY", // or "access_token" => "some-token"
    "item_code" => "7290000104201",
);
$url = "http://api.priceli.co.il/v1/priceli/code";
$response = curlGET($url, $params);
$data = json_decode($response);
echoResponse($response);

if ($data->status == 1) {
    //do something with product data

} else {
    echo "Error occur: " . $data->message;
}


function echoResponse($response){
    echo '<html><head><meta charset="UTF-8"></head><body>';
    echo $response;
    echo '</body></html>';
}

function curlGET($url, $data, &$errorBuf = null) {
    if ($data == null) {
        $data = array();
    }
    $url = $url . "?" . http_build_query($data);

    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_RETURNTRANSFER => 1,
        CURLOPT_URL => $url,
    ));
    $response = curl_exec($curl);
    if (!$response) {
        $response = false;
        if ($errorBuf != null) {
            $errorBuf = curl_error($curl);
        }
    }
    curl_close($curl);
    return $response;
}
?>

Sample Response : 
{
  "status": 1,
  "count": 31,
  "total": 31,
  "pageLimit": -1,
  "pageNum": 1,
  "data": [
    {
      "id": "120",
      "chain_id": "7290492000005",
      "sub_chain_id": "1",
      "store_id": "501",
      "bikoret_no": "9",
      "item_id": null,
      "item_code": "7290000104201",
      "item_code_short": "104201",
      "item_type": "1",
      "item_name": "××¤×•× ×” ×¢×“×™× ×” 600 גר .",
      "price_update_date": "1970-01-01 02:00:00",
      "price_update_date_sec": "0",
      "manufacturer_name": null,
      "manufacturer_country": null,
      "manufacturer_item_description": null,
      "unit_qty": "גרמים",
      "quantity": "600.00",
      "unit_of_measure": null,
      "bis_weighted": null,
      "qty_in_package": "1",
      "item_price": "17.90",
      "unit_of_measure_price": "2.98",
      "allow_discount": "\u0001",
      "item_status": "1",
      "text_tokens": "17.90 7290000104201 1 1",
      "sys_updated_date": "2015-06-14 07:04:24",
      "sys_updated_date_sec": "1434265464"
    },
    {
      "id": "7826",
      "chain_id": "7290492000005",
      "sub_chain_id": "1",
      "store_id": "503",
      "bikoret_no": "3",
      "item_id": null,
      "item_code": "7290000104201",
      "item_code_short": "104201",
      "item_type": "1",
      "item_name": "××¤×•× ×” ×¢×“×™× ×” 600 גר .",
      "price_update_date": "1970-01-01 02:00:00",
      "price_update_date_sec": "0",
      "manufacturer_name": null,
      "manufacturer_country": null,
      "manufacturer_item_description": null,
      "unit_qty": "גרמים",
      "quantity": "600.00",
      "unit_of_measure": null,
      "bis_weighted": null,
      "qty_in_package": "1",
      "item_price": "17.90",
      "unit_of_measure_price": "2.98",
      "allow_discount": "\u0001",
      "item_status": "1",
      "text_tokens": "17.90 7290000104201 1 1",
      "sys_updated_date": "2015-06-14 07:05:10",
      "sys_updated_date_sec": "1434265510"
    }
     ......
  ],
  "Time_taken": null
}
Required Creadential: 
API Key
OR Access Token