| GeoNames Home | Postal Codes | Download / Webservice | About | |
| Url | » | ws.geonames.org/postalCodeSearch? |
| Result | » |
returns a list of postal codes and places for the
placename/postalcode query as xml document
For the US the first returned zip code is determined using zip code area shapes, the following zip codes are based on the centroid. For all other supported countries all returned postal codes are based on centroids. |
| Parameter | Value | Description |
|---|---|---|
| postalcode | string (postalcode or placename required) | postal code |
| postalcode_startsWith | string | the first characters or letters of a postal code |
| placename | string (postalcode or placename required) | all fields : placename,postal code, country, admin name (Important: urlencoded utf8) |
| placename_startsWith | string | the first characters of a place name |
| country | string : country code, ISO-3166 (optional) | Default is all countries. |
| countryBias | string | records from the countryBias are listed first |
| maxRows | integer (optional) | the maximal number of rows in the document returned by the service. Default is 10 |
| style | string SHORT,MEDIUM,LONG,FULL (optional) | verbosity of returned xml document, default = MEDIUM |
| operator | string AND,OR (optional) | the operator 'AND' searches for all terms in the placename parameter, the operator 'OR' searches for any term, default = AND |
| charset | string (optional) | default is 'UTF8', defines the encoding used for the document returned by the web service. |
| isReduced | true or false (optional) | default is 'false', when set to 'true' only the UK outer codes are returned. Attention: the default value on the commercial servers is currently set to 'true'. It will be changed later to 'false'. |
Example http://ws.geonames.org/postalCodeSearch?postalcode=9011&maxRows=10
This service is also available in JSON format : http://ws.geonames.org/postalCodeSearchJSON?postalcode=9011&maxRows=10