Why is bing maps api less accurate than bing.com/maps ?

s001 1 Reputation point
2021-03-08T12:53:25.157+00:00

For example, this API query:
dev.virtualearth.net/REST/v1/Locations?query=211%20T%20%26%20C%20Way%20Haverhill,%20NH%2003785&userLocation=43.336900,-71.647802&maxResults=1
Returns: ...
"address":{"adminDistrict":"NH","adminDistrict2":"Grafton County","countryRegion":"United States","formattedAddress":"Haverhill, NH","locality":"Haverhill"},
"confidence":"Medium",
"entityType":"PopulatedPlace", ...

While the website: bing.com/maps?q=211%20T%20%26%20C%20Way%20Haverhill,%20NH%2003785
Returns a proper hit.

How can I match the accuracy of the website when using the API?

Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
245 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. IoTGirl 2,976 Reputation points Microsoft Employee
    2021-03-10T07:50:31.293+00:00

    Hi @s001 ,

    I can address your question by telling you there are three different APIs that make up the answer:

    1. The Documentation for Location API calls are here: https://learn.microsoft.com/en-us/bingmaps/rest-services/locations/ but your call is using the less precise query string call instead of the Address call.
    2. Bing.com/Maps uses the AutoSuggest API that allows you to type characters then choose from a potential list

    You should use the API that best matches your scenario but if you are looking for a more accurate address, try Location by address where you separate the address into the component parts before making the call.

    Sincerely,
    IoTGirl


  2. IoTGirl 2,976 Reputation points Microsoft Employee
    2021-03-16T17:40:25.4+00:00

    Hello @s001 ,

    Please try the API with the same context. When hosted in the browser, the Bing Maps V8 control gets context from the Browser. In the left menu of https://www.bing.com/api/maps/sdk/mapcontrol/isdk you can find a number of AutoSuggest samples.

    Sincerely,
    IoTGirl