Bing Maps REST API Location Response Returns Neighborhood in place of City

Gluten 1 Reputation point
2022-04-03T02:23:36.61+00:00

The Bing Maps REST API Locations endpoint format seems to have changed recently.

Although it doesn't appear to be documented in the API, the locality field for an address in the API response previously mapped to the city for an address. The neighborhood field would list the neighborhood where available.

Now, I am seeing that the neighborhood field is never returned, even when setting includeNeighborhood=1 in the request, and the locality field seems to contain the neighborhood information, with no field mapping to city anymore.

This mapping of neighborhood onto the locality field only appears to apply to US addresses from my testing, and I do not see any other way to get the city for the address response (only adminDistrict2 which maps to county in the US).

Example request:

https://dev.virtualearth.net/REST/v1/Locations/47.60323,-122.33028?key=API_KEY&includeNeighborhood=1&culture=en-US

{
  "authenticationResultCode": "ValidCredentials",
  "brandLogoUri": "http://dev.virtualearth.net/Branding/logo_powered_by.png",
  "copyright": "Copyright © 2022 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": [
            47.599367282429327, -122.33791786087039, 47.60709271757068,
            -122.32264213912961
          ],
          "name": "504 4th Ave, Seattle, WA 98104, United States",
          "point": { "type": "Point", "coordinates": [47.60323, -122.33028] },
          "address": {
            "addressLine": "504 4th Ave",
            "adminDistrict": "WA",
            "adminDistrict2": "King Co.",
            "countryRegion": "United States",
            "formattedAddress": "504 4th Ave, Seattle, WA 98104, United States",
            "intersection": {
              "baseStreet": "4th Ave",
              "secondaryStreet1": "James St",
              "intersectionType": "Near",
              "displayName": "4th Ave and James St"
            },
            "locality": "Pioneer Square",
            "postalCode": "98104"
          },
          "confidence": "Medium",
          "entityType": "Address",
          "geocodePoints": [
            {
              "type": "Point",
              "coordinates": [47.60323, -122.33028],
              "calculationMethod": "Interpolation",
              "usageTypes": ["Display", "Route"]
            }
          ],
          "matchCodes": ["Good"]
        }
      ]
    }
  ],
  "statusCode": 200,
  "statusDescription": "OK",
  "traceId": "a669ab363dd44037a5991aec60da7b56|BN00005015|0.0.0.1"
}
Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
587 questions
Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
245 questions
{count} votes

1 answer

Sort by: Most helpful
  1. IoTGirl 2,976 Reputation points Microsoft Employee
    2022-04-21T17:07:52.44+00:00

    Hi @Gluten ,

    The Maps Engineering team has found the root cause of this issue and is implementing a fix. It is flighting this week and should be live by sometime next week.

    Sincerely, IoTGirl