I am searching to try to simplify address entry right into a system in which the city textbox has autosuggest initially populated through the user's geolocation. Previously it's appeared that autosuggesting the town title is prohibitively pricey not understanding the province/condition/country first however it does not seem sensible to want the consumer to go in the address backwards once we don't consider address information by doing this. However, not autosuggesting the town title means we finish track of a variety of strange and wonderful records for mis-typed metropolitan areas from around the globe.

I'm wondering if there is a service will be able to query that will instantly respond most abundant in appropriate city names according not only to exactly what the user makes its way into within the textbox, however the location of this user in line with the country and political boundary they fall within?

For example, should i be in Canada [like me and that i enter 'Mi' then I'd be given all metropolitan areas within Canada beginning with 'Mi' until it had been determined the information I had been entering wasn't Canadian after which, it might make use of the next probably set up country according to our usage pattern - i.e. it might look into the U.S. next, then Mexico after which other not as likely locations. I'm able to write all of this myself basically had the database but I'm not sure where I'm able to locate one and my suspicion is it could be less scalable than querying a pre-existing service on the internet.

Looks as if MaxMind provides a free database you could download in CSV: http://www.maxmind.com/app/geolitecity

There's a web-based demo to check it a little if you want, but not a way to question it via a web service.

IPInfoDB also offers their database readily available for download: http://ipinfodb.com/ip_database.php - they've an XML API, however it only supports searching for the townOrnation for the IP. You are trying to behave a bit more wide than that, searching for every city inside a particular country, with country selected according to IP. I would not expect that you have a web service for your, it is a pretty specific requirement.

Edited to include: You could utilize the IPInfoDB API to find information about the nation though, after which create the autocomplete suggestions from the local country/city database. This way all of the IP-geolocation wouldn't have to be done in your area. You will find various places that exist a listing of metropolitan areas inside a particular country. For instance, here's some comprehensive lists maintained through the National Geospatial-Intelligence Agency: http://earth-info.nga.mil/gns/html/cntry_files.html