Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get more than 20 results ie. 60 using google place API with PHP?
    primarykey
    data
    text
    <p>I am developing an google places API application where my target to get all available details of a specific query. But as I know google places API only returns 20 results at a time.But I need all available place details.</p> <p>If I search with a search keyword more than once its always gives the same results. So I want to know that is there any way to get different results each time I search with the same keyword.</p> <pre><code> &lt;?php $placeSearchURL = 'https://maps.googleapis.com/maps/api/place/textsearch/json?query=' . $query . '&amp;sensor=true' . '&amp;key=' . API_KEY; $placeSearchJSON = file_get_contents($placeSearchURL); $dataArray = json_decode($placeSearchJSON); $references = array(); $detailsOfPlaces = array(); if (isset($dataArray-&gt;status)) { switch ($dataArray-&gt;status) { case 'OK' : foreach( $dataArray-&gt;results as $details) { $references[] = $details-&gt;reference; } break; default: echo "Something wrong"; } } foreach ($references as $reference) { $placeDetailsURL = 'https://maps.googleapis.com/maps/api/place/details/json?reference=' . $reference . '&amp;sensor=true&amp;key=' . API_KEY; $placeDetails =file_get_contents($placeDetailsURL); $placeDetailsAsArray = json_decode($placeDetails); switch ($dataArray-&gt;status) { case 'OK' : $detailsOfPlace['business_name'] = isset($placeDetailsAsArray-&gt;result-&gt;name) ? $placeDetailsAsArray-&gt;result-&gt;name : ''; $detailsOfPlace['address'] = isset($placeDetailsAsArray-&gt;result-&gt;formatted_address) ? $placeDetailsAsArray-&gt;result-&gt;formatted_address : ''; $detailsOfPlaces[] = $detailsOfPlace; break; default: echo "Something went wrong"; } } </code></pre> <p>This is my code. It returns 20 results for each query. Can anyone please tell me what adjustment I should made to get 60 results for each query.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload