none
Why does the Bing maps API return such poor results compared to the website

    Question

  • If I sent a query to 

    http://dev.virtualearth.net/REST/v1/Locations?q=tesco%20superstore%2C%20Finglas%20Clearwater&key=..my key..

    the response not only fails to find the Tesco store there but returns a bunch of bad guesses based in other parts of the world.  If I include "Ireland" at the end of the query the response is actually _worse_ because it seems to think I'm asking for the whole country.

    If I go to https://www.bing.com/map and just type "Tesco superstore, Finglas Clearwater" into the search bar it immediately locates the store and shows it on the map.

    How can I get query results from the API more consistent with what I experience on the webpage?  At the moment the API feels like an abandoned product (still on V1, poor docs, poor responses etc).  Should I be using an alternative API/product?

    Thursday, January 10, 2019 12:12 PM

All replies

  • Hi nmacmull,

    The locations call you are using is an unstructured call that takes the words in priority order left to right.  You are comparing it to the Autosuggest structured query that uses the keystrokes entered, also from left to right, to give suggestions.

    1,  You are using the least precise Location query call.  I suggest you review some of the other more structured calls available at https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/

    2, The experience you are using as a comparison is Autosuggest.  You can find the details of that API here https://docs.microsoft.com/en-us/bingmaps/rest-services/autosuggest.  If you are specifically looking for a business, there is a modifier for that as well... you can try the experience at https://www.bing.com/api/maps/sdk/mapcontrol/isdk/autosuggestbusiness

    Sincerely,

    IoTGirl

    Thursday, January 10, 2019 7:14 PM
    Owner
  • IoTGirl, thanks for the reply.  The AutoSuggestion API looks promising but unfortunately I can't get it (or the businesses version) to provide useful results.  Here's the same query using that API and deliberately using a userLocation right next to the target result.

    http://dev.virtualearth.net/REST/v1/Autosuggest?query=tesco%20finglas%20clearwater&userLocation=53.383625,-6.292044,10&includeEntityTypes=Business&key=...

    In this case the response simply contains an empty value array in the resources.

    Really what I'm looking for is an API that does the same kind of inference that the Bing Maps web search does. In my application I've only got a poorly-formatted textual description of the target and want to start by just treating this as a raw query. Alternatively put, I just want a programmatic interface to the search box (and results!) on www.bing.com/maps/ !

    It  seems that none of the available APIs provide this kind of free-form query - are there any plans to introduce one?

    Thursday, January 10, 2019 11:35 PM
  • Hi nmacmull,

    What experience do you get without the business entity type called out?  I might suggest you try this option instead: https://www.bing.com/api/maps/sdk/mapcontrol/isdk/lookupentities 

    I replaced the co-ordinates in the sample with yours (https://www.bing.com/api/maps/sdk/mapcontrol/isdk/lookupentities) and recieved the following result:

    Address:
    82 Glenhill Road, Dublin, County Dublin, IE

    Nearby entities:
    Glasnevin, Clearwater Shopping Centre
    Clearwater Retail Park
    Brian Duggan Dentist
    DID Electrical
    Flaherty Patk
    Finglas South, Ardmore Hotel
    Clearwater Shopping Centre
    Burger King
    Gerard Ridgeway Carpet Sales
    Finglas South, Finglas Road

    I don't see Tesco in this list, is it new?  If I search for Tesco, I find one near (53.284847, -6.238434) and it does appear in that list

    Address:
    2 Ardglas Estate, Dublin, County Dublin, IE

    Nearby entities:
    Dundrum Town Centre
    Tesco
    Baby Elegance
    Rainforest Adventure Golf
    Ballinteer, Pallottine Fathers
    Ballinteer, Sandyford Road
    TK Maxx
    Juggernaut
    Cycle Surgery
    The Rockfield Lounge

    Sincerely,

    IoTGirl

    Monday, January 14, 2019 8:19 PM
    Owner
  • Thanks IoTGirl.

    Note - i realised that the earlier examples I used above specified 'superstore' where they should actually have read "extra" but the results are the same regardless.

    Dropping the "businessentities" flag doesn't make any difference. 

    Wrt to the lookupentities API,   unless I'm missing something, that API requires a starting lat/long?   As I said, in my use case, I have a set of textual strings with little contextual information and I am trying to  turn them into lat/longs  for consumption by a desktop application.  I.e. I just want to do basic geocoding of fuzzy data.  I appreciate I'm going to have apply some filtering to the results to find the right entity match but at the moment I can't even come close with the Bing API.  

    In contrast, this Google API does a much better job...

    https://maps.googleapis.com/maps/api/geocode/json?address=tesco%20extra%20Finglas&key=...

    It correctly identifies the large building that contains the store (though annoying fails to use the string "Tesco" in the response).  

    It's particularly frustrating when, as I say, www.bing.com/maps/ clearly _does_ know where the target location is! ;-)

     Neil

    Tuesday, January 15, 2019 12:38 PM
  • Hi Neil,

    I'll pass this thread up to the Bing Maps folks and see what they say.

    Sincerely,

    IoTGirl

    Tuesday, January 15, 2019 6:45 PM
    Owner
  • Hi Neil,

    The AutoSuggest team state that the Bing Maps website actually provides a bounded region based on the map being shown.  As you do not provide that bounded region, you will get different results.  See UserMapView & UserCircularView at  https://docs.microsoft.com/en-us/bingmaps/rest-services/autosuggest

    Sincerely,

    IoTGirl

    Thursday, January 17, 2019 10:10 PM
    Owner
  • IoTGirl.  This explanation doesn't really hold up.  If I center the map in the middle of China the search still correctly finds the Tesco store.  If I run in from a VM based in the US, it correctly finds the Tesco store.  I'm sure you (or the maps team) can trivially reproduce this yourself!   The left hand side of the screenshot below is the results of the query performed from a West-US Azure VM.  The right-hand side just shows the starting location.


    • Edited by nmacmull Saturday, January 19, 2019 5:24 PM
    Saturday, January 19, 2019 5:23 PM
  • Hi Neil,

    You are asking a different question in your latest example.

    • Your first question was regarding different suggestions from autosuggest when passing the same market, same bounding box, and same user location. The answer to your first scenario remains the same, the requirements for getting the same results from Autosuggest API are passing in the same parameters, regardless of the interface.
    • Your second sample shows that geocoding works when your map view is in China but this will not be the same market, bounding box or potentially user location.

    I hope that clarifies the initial answer for you.

    Sincerely,

    IotGirl


    Tuesday, January 22, 2019 6:45 PM
    Owner
  • Honestly, my intent has been consistent and is best summed up by this sentence in the original post...

    >How can I get query results from the API more consistent with what I experience on the webpage?

    Perhaps the wording of the _title_ made it appear I am interested in a technical description of what is happening under the hood?  That isn't really the case.  As I've said a few times now, I would simply like to know if there is a REST API that, given only the keywords "Tesco", "finglas" and "Clearwater", can deduce that I am asking for the lat/long of a Tesco store and return it.   None of the suggestions so far have come close to that functionality.

    Clearly something under the hood at www.bing.com/maps is able to do that as demonstrated by the screenshots above.  If the Bing team have chosen not to expose an equivalent query service via any of the APIs, that's fine - I'll make do with the Google API though I would have preferred to use Bing.  :-)

      Neil 


    • Edited by nmacmull Tuesday, January 22, 2019 6:59 PM
    Tuesday, January 22, 2019 6:58 PM
  • >the requirements for getting the same results from autosuggest API are passing in the same parameters, regardless of the interface

    This answer suggests there is some combination of parameters that does provide identical results to the web UI.  I haven't been able to find it based on your help so far, nor on extensive reading of the documentation or active experimentation with forming urls.  Perhaps the simplest thing would just be to post a an example URL (without key) which return the results I am looking for?  

    Tuesday, January 22, 2019 7:20 PM