Get Codes By Product Name - חיפוש קוד מוצר לפי שם מוצר

This operation let you get a list of item codes regardless of specific supermarket chain and/or store, according to search text. The operation uses a free text search algorithem and return a result set order by match rate (serp field). Using this operaion is more efficient whan all you need is list (or one more matched) item code based on user entry, than using product-fts. 

Request parameters: 

"text" is required parameter

Sample code: 
<php

$params = array(
    "api_key" => "API_KEY", // or "access_token" => "some-token"
    "text" => "שוקו יוטבתה" // some text
);
$url = "http://api.priceli.co.il/v1/priceli/codes-by-name";
$response = curlGET($url, $params);
$data = json_decode($response);
echoResponse($response);

if ($data->status == 1) {
    //do something with product data
} elseif ($data->status == 2) {
    echo "No 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": 61,
  "total": 61,
  "pageLimit": -1,
  "pageNum": 1,
  "data": [
    {
      "item_code": "7290000042855",
      "item_name": "שוקו יוטבתה",
      "serp": "10.341507911682129"
    },
    {
      "item_code": "7290003029037",
      "item_name": "שוקו יוטבתה בקרטון",
      "serp": "10.341507911682129"
    },
    {
      "item_code": "7290003029181",
      "item_name": "שוקו יוטבתה בקבוק",
      "serp": "10.341507911682129"
    },
    ....
   ]
}