Is there a way to get the ISO 3166-2 Code for a specific PostalCode/CountryCode Combination with the Bing Maps Locations API?
Per Example: 1210/AT => AT-9
Is there a way to get the ISO 3166-2 Code for a specific PostalCode/CountryCode Combination with the Bing Maps Locations API?
Per Example: 1210/AT => AT-9
Use the Bing Maps REST Location API and geocode your query (postal, country...). As part of the request add
&incl=ciso2
which will return the country's ISO2 code value. For example:https://dev.virtualearth.net/REST/v1/Locations?q=1210%2C%20AT&incl=ciso2&key=YOUR_Bing_Maps_Key
Will return the following:
Notice in the address property of the response there is
"countryRegionIso2": "AT"
Documentation on the Bing Maps REST Locaiton API can be found here: https://msdn.microsoft.com/en-US/library/ff701711.aspx
There is a best practices guide here: https://msdn.microsoft.com/en-us/library/dn894107.aspx
If using .NET you may want to use the Bing Maps REST .NET Toolkit: https://github.com/Microsoft/BingMapsRESTToolkit It makes it really easy to use the REST services in .NET and also has a NuGet package for easily including in your project.