Google Geocoding API: number of results - rest

Is there a way to increase the number of results returned by Google Geocoding API. Right now the default seems to be 10, however it does not seem to include the intended result.
Thanks

Getting more results from the Geocoding API is not necessarily a solution. And no, can't get more.
Instead, you may want to use the Places Autocomplete API, or the Places library in the Maps JavaScript API. Specially when bound to a map, it makes it much easier for users to find places.

Related

Building a City/Country Search box. Can Bing API support this?

I'm currently building a search box for a mobile app that can search for a Country/ State/ Country. I'm currently looking for APIs that can support this... An option for me would be the Google Places API but as much as possible I don't want to use Google for my project.
So before I import the Bing SDK into my project, I'm curious if anyone knows if this is possible with Bing API.
With Bing Maps you can use the location query API: https://learn.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-query however, it will also find addresses if you pass them in. Generally though, if you type just a state or country, this API will return the expected result. You can add a bit of code to look through the results and filter them based on their entity type if required.
Since you tagged Azure Maps, you can use the Azure Maps address search API: https://learn.microsoft.com/en-us/rest/api/maps/search/get-search-address It has filtering parameters available that might be better suited for this scenario.

Google Geocode/Places API: search zip code - get addresses connected to it, possible?

So, another Google API question but I didn't find any threads for my needs.
I'm trying to implement a basic zip code search with Google API in plain Javascript (tested both Geocode and Places with Autocomplete).
User should be able to search on a specific zip code and get street names returned which are connected to that zip code (and simply choose the correct address).
I have no problems getting results back using either one of the APIs but I can't wrap my head around Googles documentation for it since nothing tells you if this is possible or not.
I've tested a couple of different types to send in the options setting but none actually returns an array of addresses.
Been thinking if reverse geocoding would be a solution but seems a bit hacky and also would require multiple requests..
Simply out of ideas, any help appreciated.
types: ['geocode'],
componentRestrictions: { country: 'SE' }
}
let autocomplete;
function initialize() {
autocomplete = new google.maps.places.Autocomplete(
document.getElementById('postalCode'), options);
autocomplete.setComponentRestrictions({'country': ['SE']})
autocomplete.setFields(['address_component']);
autocomplete.addListener('place_changed', fillInAddress);
}
Please note that it is currently not supported for the Geocoding or Places API to show a list of addresses by zip code.
Places Autocomplete is designed to return place predictions based on the user input and perceived relevance. While the Geocoding API is designed to convert a single string address to coordinates and vice versa.
You can use this Geocoder tool to test this.
There is also a related feature request for this functionality, it's marked as Infeasible/Intended behavior but you can still star it to receive updates:
https://issuetracker.google.com/issues/64769088
Starring the issue also provides valuable feedback on the importance of the issue to customers, and increases the issue's priority with the product engineering team.

Providing latitude/longitude to google RESTful search API

I have been trying to find a search implementation that is able to consistently provide good quality results for local searches, and after much mucking about, I've discovered it is possible to use local search via Google's RESTful API.
For instance this URL:
https://ajax.googleapis.com/ajax/services/search/local?v=1.0&q=skydiving&near=new%20york%20ny
Provides a list of skydiving centers near New York, NY.
However, finding this out has been pure experimentation, as I've yet to find any documentation on local search REST features/parameters.
Does anyone know if it is possible to provide a Latitude/Longitude, rather than a city/state?

List / database of valid addresses for geolocation / geospatial testing

I'm running some geospatial tests to demonstrate use of the MongoDB geo APIs. The problem is that I don't have a list of valid addresses with which I can test.
The idea is to query the latitude and longitude through Bing Maps as my sample application is a job search website where the locations I will be indexing to query against would be entered as listing for new job opportunities and would be entered using addresses rather than latitude and longitude coordinates.
Any help would be much appreciated!
I don't suspect Microsoft provides a list of fake locations that will register to valid lat/long coordinates on Bing (for this exact purpose or similar), but if they do...that would be equally acceptable.
FWIW, I did thoroughly check Microsoft's documentation and found nothing on this.
Alternatively, I could just query common places like Starbuck's or POI's (probably what I'll end up doing), but it would be nicer if there were a testing mode where you could use addresses that would register with Bing. Microsoft, in case you happen to subscribe to Stack Overflow tags, I would post this suggestion on the Bing community forums but there is no way to post an answer or question there, please fix this.
Decided just to use the Bing Maps API to query some popular companies although this is not ideal.

Google Maps API: Requesting any place labels given longitude and latitude?

I am working on an iPhone map application and wanted to know whether it was possible to request any labels visible on Google Maps given a longitude/latitude and radius?
For example if I gave the following location to this Google Maps API, I would get back McCullough Hall, Moore Hall, etc. The list would be any place labels visible on the map (doesn't have to be just restaurants, businesses).
If this is possible can you direct me to where I can learn more about this. If this isn't possible, can you direct me towards another API where it is possible?
Look into Googles reverse geocoding, I think that's what you're looking for.
The short answer, you cannot!.
The only way is to search for places by name and get a reference key to query the place details including lat/lng. Not the other way around.
IMHO, this is mainly a policy of Google instead of being technical limitation.