none
Searching for locations in an area RRS feed

  • Question

  • I'm trying to search for businesses/locations within an area. For example, I'd like to find a place called "Oleana" in Cambridge, MA (there's at least one restaurant by that name). I've tried using the Locations API, but haven't found an appropriate search strategy.

    I've tried "Locations?q=Oleana&CountryRegion=US&adminDistrict=MA&locality=Cambridge", but that just gives me Cambridge; it's like it doesn't care about my search query.

    I've tried "Locations/Oleana?CountryRegion=US&adminDistrict=MA&locality=Cambridge", but that gives me Oleana in Spain, and negates my city filter.

    (Notably, the documentation here: https://msdn.microsoft.com/en-us/library/ff701711.aspx implies the above queries would have the same result, so I'm definitely also confused about that.)

    To be clear, the search result I'm looking for would be like the one described here: https://msdn.microsoft.com/en-us/library/ff701711.aspx for Tower of London: I'd get a Lat/Long pair, an entity type, and (ideally) an address.

    Is there a way to do this? I seem to be able to get this data with a Google Places API, and wanted to know if a Bing Maps API could work as well. I'd consider using a different API instead if it's more suited to these types of searches. Thank you,

    Wednesday, February 28, 2018 3:15 AM

Answers

All replies

  • Bing Maps currently does not expose an API for business listings. However this is on the roadmap. The autosuggest module in Bing Maps V8 should be supporting business suggestions very soon (within a month). There are also some REST API's coming in the next couple of months. Stay tuned to the Bing Maps blog https://blogs.bing.com/maps as these will likely be announced there. Initially these will likely be limited to the US and then expand into other countries over time.

    It looks like this is already in the experimental branch of Bing Maps V8. Simply add "businessSuggestions: true" as an option to the autosuggest module. https://www.bing.com/mapspreview/sdkrelease/mapcontrol/isdk/autosuggestui

    I've put together a code sample to show this in action here: http://bingmapsv8samples.azurewebsites.net/#Business%20Suggestions


    [Blog] [twitter] [LinkedIn]




    Wednesday, February 28, 2018 7:06 PM
  • Thank you very much! Could you please clarify:

    1. Why do the 2 queries above give different outputs? (Why does the first ignore the search query and the second ignores the city filter?) Even if business suggestions are off, there should be no results in either of these searches, as there are no localities named "Oleana" in the specified bounds.
    2. What is include in searches at the moment? If not business results, but yes to Space Needle, Tower of London, and "1 Microsoft Way", then what category of items could I expect to be returned in these searches other than geographic localities?
    Wednesday, February 28, 2018 8:42 PM
  • 1. Both of your URLs are using an invalid format. You can't mix "query" type URL params with structured address params. In the case of the second URL, it is ignoring the URL parameters and only looking for "Oleana" where as in the first URL all the URL parameters are likely being considered and causing an error somewhere are your not supposed to mix the two different URL types together.

    2. Address and Places (zip/postal codes, states/provinces, counties, countries, wards, certain landmarks, bodies of water...). 


    [Blog] [twitter] [LinkedIn]

    Thursday, March 1, 2018 12:57 AM
    1. Can you tell me how I would know that I'm not permitted to mix location data with query type URLs from the documentation here: https://msdn.microsoft.com/en-us/library/ff701711.aspx? It seems to say I'm allowed to use "Common Parameters and Types" inside my query type URLs, which include Location parameters, like "adminDistrict". If both of the above are invalid, could you tell me what a valid query would be to get at what I wanted? (e.g. would return no results because there is no "Oleana" place in Cambridge, MA, and might return the business with "businessSuggestions: true" enabled if Oleana is in the Bing database.)
    2. Thank you; that's extremely helpful.
    Thursday, March 1, 2018 7:15 PM
  • There two separate documents showing the differences:

    https://msdn.microsoft.com/en-us/library/ff701714.aspx

    https://msdn.microsoft.com/en-us/library/ff701711.aspx

    Common parameters and types are these: https://msdn.microsoft.com/en-us/library/ff701723.aspx

    To be honest, these API's are 8 years old and I have never had anyone mix these two different types before. 


    [Blog] [twitter] [LinkedIn]

    Thursday, March 1, 2018 7:40 PM