Sto raccogliendo informazioni sulla posizione dei negozi. La ricerca è:API Google Places: errore next_page_token
<?php
...
$url='https://maps.googleapis.com/maps/api/place/search/json?key=[my_key]&location=40.420989,-3.706812&radius=1000030&=&sensor=false';
$body=file_get_contents($url);
...
?>
torno un JSON senza problemi, e indica che v'è un'altra pagina dei risultati. Torno ad effettuare un'altra chiamata come segue
<?php
...
$url2='https://maps.googleapis.com/maps/api/place/search/json?key=[my_key]&pagetoken=ClREAAAAQXKNHPVGCkTC_MdjSqi2T0KBDMWjEu4KF1Ylw1761Po-67AnNSp4zw0wXD4oocGpx4olSl4k2LyklJBl3mBF4VPmxp3IoOCHDRlXVmivaDsSEBuG_V1GvCH1gS5s0LCuy3EaFNXxUzzHhZ5ZRYNfeGHuqewR6Zk7&sensor=false';
$body=file_get_contents($url2);
...
?>
Se l'eseguo con la seconda chiamata ottengo un errore
'status'-> invalid_request
Ma quando ho incolla il il browser ulr2 nel risultato è corretto.
Come posso risolvere il problema?
Grazie
l'hai capito problema hte mi restituisce anche richiesta errore negato –