I am using Google Places API in my react native app and I want to filter or restrict search results.
I want to restrict the search results to the Mumbai region or a particular state (only Kerala). How can I do it?
code I used in my project.
const url = 'https://maps.googleapis.com/maps/api/place/textsearch/json?query='
+ Address +'&key=' + YOUR_API_KEY +'&types=(point_of_interest,establishment)&language=en&country=IN'
fetch(url)
.then(res => {
return res.json()
})
.then(res => {
if(res.results.length > 0){
setLocationResults(res.results)
}else{
setLocationResults([])
}
})
.catch(error => {
console.log("ERR :",error);
});