GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Retrieve all state or province codes for a country  XML
Forum Index -> General
Author Message
lifebio



Joined: 18/01/2012 14:46:41
Messages: 1
Offline

I am working on integrating the web services into our application. So far pretty good. I have 1 question tho:
I am using this service like:

http://api.geonames.org/search?country=US&featureCode=ADM1&style=SHORT&username=<xxxx>

but would like to get the state code(abbreviation) returned. I see the code in the admin1_code (and the alternatename “abbr”) field in the db. The need is to have the states/provinces/etc for the country. So for the US, I would have all 50 states+.

If I use the web service like this:

http://api.geonames.org/search?country=US&featureCode=ADM1&style=FULL&username=<xxx>

I get the abbreviation, but that is far too big a payload to process.

Is there something I am missing or a parameter or a different service to call?

Any assistance would be appreciated.
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline


you can set the desired out put language to the pseudo-language 'abbr'.

http://api.geonames.org/search?country=US&featureCode=ADM1&style1=SHORT&username=xxx&lang=abbr

Best Regards

Marc

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team