I am using google places Api. I want to have only the airports of particular country to displayed by autocomplete api. Is there any way to achieve this?
For a place search, you can apply a type filter from within a predefined list (airport included): https://developers.google.com/places/supported_types
The place search doesn't allow country filtering (it uses latlng + radius params instead), but using the country name as the query term should yield the correct results.
https://maps.googleapis.com/maps/api/place/textsearch/json?query=Australia&key=addkeyhere&type=airport
However, this doesn't apply to the autocomplete API so you'll probably want to grab the full text search result, cache them client-side and do your own matching/autocomplete.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With