In response to each numbered question:
- I can confirm that the autosuggest API will not return the state and country names in just one format. The data in this API comes from a lot of different data providers and has a mix of different data types (Place, local business, Address). In some cases standard codes are used (e.g. state abbreviation like WA for Washington) and others the full or alternate name. The one exception is that I believe this API returns a
countryRegionIso2
property. I don't recall ever seeing differences in the county field. If you are focused on a limited set of countries, you could create a simple lookup table for these values and data map them to your preferred format. What you are looking to do is called address standardization (or normalization), which is not a feature provided by Bing or Azure Maps. There are specialized services for this available by 3rd parties, there are some open source solutions as well. Have you geocoded all the addresses in your database with Bing Maps? By doing this, and updating the address fields with what is returned would make it so that those addresses are aligned with what is currently in the Bing Maps system and this will then allow you to do the matching on the fly with good accuracy (may not match 100% of the time). - No, this is not publicly exposed and can potentially change over time.
- No. Address data changes daily on a global scale. Formatting, places with multiple alternate names, geopolitical sensitive names... Text matching on address data in general has a ton of complications and will always have inaccuracies. There are several different ways to match address data. Text matching works if you sanitize both the data in your database and the input you get from the user (or Autosuggest API) to normalize it. Doing this for state and country names on a global scale using a lookup table is fairly easy. County names however are number more difficult as there tends to be a lot more discrepancies with these. Another method that is often used is to look at the coordinates and do a search for nearby records. Combine this with text matching on just the address line field after that, or simply show all records near that inputted location (what most systems do).