locked
Discrepancy Between Bing Maps Location API and Web Interface Search Results RRS feed

  • Question

  • When I type the following query string:

    "Hampton Inn Houma, Houma, LA"

    into the web interface at http://www.bing.com/mapspreview, I receive what I want - the location of the hotel in-question. However, when I send the following query:

    http://dev.virtualearth.net/REST/v1/Locations?query=Hampton+Inn+Houma%2C+Houma%2C+LA&incl=queryParse&maxResults=1&key=MY_API_KEY

    to the Bing Maps Location API, as documented at https://msdn.microsoft.com/en-us/library/ff701711.aspx, I receive a response that is in the right city and state, but does not contain the specific location of the hotel in-question: This is the response that I get:

    {"authenticationResultCode":"ValidCredentials","brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2016 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":1,"resources":[{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[29.54486083984375,-90.766349792480469,29.611419677734375,-90.6358413696289],"name":"Houma, LA","point":{"type":"Point","coordinates":[29.597330093383789,-90.719131469726562]},"address":{"adminDistrict":"LA","adminDistrict2":"Terrebonne Par.","countryRegion":"United States","formattedAddress":"Houma, LA","locality":"Houma"},"confidence":"Medium","entityType":"PopulatedPlace","geocodePoints":[{"type":"Point","coordinates":[29.597330093383789,-90.719131469726562],"calculationMethod":"Rooftop","usageTypes":["Display"]}],"matchCodes":["Good","UpHierarchy"],"queryParseValues":[{"property":"AddressLine","value":"Hampton Inn Houma"},{"property":"Locality","value":"Houma"},{"property":"AdminDistrict","value":"LA"}]}]}],"statusCode":200,"statusDescription":"OK","traceId":"124a933bfbd54bd99600e4f912e61667|CO30276240|02.00.164.2600|CO3SCH010265220, CO3SCH050500652, CO3SCH010273834, CO3SCH010265516"}

    Should I be using a different API to find geolocation of a hotel based on name, city, state, country, etc.? I would think that the Bing Maps Location API would be what I need, but since its results seem to differ from what I get upon a search via the Bing Maps web interface, I'm not sure what I should be doing.


    • Edited by aaronrubin Wednesday, May 11, 2016 8:44 PM
    Wednesday, May 11, 2016 8:43 PM

Answers

  • The Bing Location API is a geocoding API. Geocoders converts addresses into coordinates. The query you are passing in is a business point of interest search. Bing Maps does have several point of interest data sources available for developers but they currently don't support free form queries like this.

    The business results on the Bing Maps consumer site are often licensed from other companies such as Yelp and TripAdvisor, but that license limits Bing Maps such that they can use the data in first party apps (Microsoft owned), but can't expose it in 3rd party apps (developer API's). These companies often have API's of their own that you can use with Bing Maps:

    https://www.yelp.com/developers

    https://developer-tripadvisor.com/content-api/


    [Blog] [twitter] [LinkedIn]


    Wednesday, May 11, 2016 11:44 PM