I want to pull business data from google places ip. I can do that by using place_id with the code below;
$name = urlencode('Business name');
$place_id = 'XXXXXXXXXXXXXXXX';
$url = 'https://maps.googleapis.com/maps/api/place/details/json?placeid='.$place_id.'&key=XXXXXXXXXXXXXXXXX';
$json = file_get_contents($url);
$jsonContent = json_decode($json, TRUE);
$jsonContent['result']['name'];
$jsonContent['result']['formatted_phone_number'];
$jsonContent['result']['formatted_address'];
$jsonContent['result']['website'];
$jsonContent['result']['place_id'];
What I want to be able to do is the get business data using business name or get place_id by using business name so i can use the code above to pull the data. Obtaining the the place id with business name is possible on the following link;
Can anyone help with how i can obtain either business data using business name or obtain place id using business name?