GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Get Country name and City name using postal code  XML
Forum Index -> General
Author Message
jkpatel1463



Joined: 25/01/2017 07:26:24
Messages: 1
Offline

Hello

I have only postal code and i need city name and country name based on postal code.

Let's take an Example:
I have

Postal code:10023

If i call a API of geonames then i will have City name as "10023" and country name as "United States"

I have Postal code "395006" & then i call API of geonames, i will have City as "SURAT" and country name as "India"


Can anyone help me ?

Thanks in advance
JOleg



Joined: 22/01/2017 01:02:39
Messages: 6
Offline

I did not look into postal codes within geonames, but common sense in your case says that it's not possible, at least for now. Postal codes may not contain ISO country codes and therefore your postal code 10023 may exist in more than 1 country, hence ambiguity. Some countries do have ISO 3166 code prefixed in front of postal code, but it has not been widely adopted. So, you need to know the country this postal code belongs to, to infer the city.

src:
https://en.wikipedia.org/wiki/Postal_code


Country code prefixes

ISO 3166-1 alpha-2 country codes were recommended by The European Committee for Standardization as well as the Universal Postal Union to be used in conjunction with postal codes starting in 1994,[11][12] but they have not become widely used. Andorra, Azerbaijan, Barbados, Ecuador, Latvia and Saint Vincent and the Grenadines use the ISO 3166-1 alpha-2 as a prefix in their postal codes.

In some countries (such as those of continental Europe, where a numeric postcode format of four or five digits is commonly used) the numeric postal code is sometimes prefixed with a country code when sending international mail to that country.
 
Izadore



Joined: 11/02/2017 09:11:34
Messages: 1
Offline

JOleg wrote:
Postal codes may not contain ISO country codes and therefore your postal code 10023 may exist in more than 1 country, hence ambiguity.
 


Ah, it makes sense when you put it like that. Still I'm trying to think of a workaround as there must be one.
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team