Coder Social home page Coder Social logo

ziptastic's Introduction

Ziptastic

We have moved to GetZiptastic.com!


Important

We recommend using GeoIP to determine the country code of your visitor as a suggestion when they are filling out your form. (http://pointlessrants.com/posts/python-geoip-python-geoip-cities-tutorial/)

Notes

We are now using the geonames.org database for postal codes. There are many more countries we support.

Available country codes: AD, AR, AS, AT, AU, BD, BE, BG, BR, CA, CH, CZ, DE, DK, DO, ES, FI, FO, FR, GB, GF, GG, GL, GP, GT, GU, GY, HR, HU, IM, IN, IS, IT, JE, JP, LI, LK, LT, LU, MC, MD, MH, MK, MP, MQ, MX, MY, NL, NO, NZ, PH, PK, PL, PM, PR, PT, RE, RU, SE, SI, SJ, SK, SM, TH, TR, US, VA, VI, YT, ZA

Usage

v2

This is the new updated version and requires that you pass in the country code as well.

Example: http://zip.getziptastic.com/v2/US/48867

v1

This version only supports US postal codes and can be accessed like this...

Example: http://zip.getziptastic.com/48867 and http://zip.getziptastic.com/?zip=48867

ziptastic's People

Contributors

curtisgibby avatar daspecster avatar gbaygon avatar joechrysler avatar schmich avatar walterdavis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ziptastic's Issues

No Danish postal codes

Sadly, the database does not seem to contain all, if any, Danish postal codes. Here is a list of resources to use:

  • Wikipedia
  • Another site that seems easier to scrape but may or may not be up to date
  • A site contains some additional details for various postal codes such as associated street name (Gade) and company (Firma)

Multiple cities resolution of zip codes

Multiple cities can map to a single zip code, but the API only returns one city per zip code.

For example, for zip code 21774, USPS.com returns "FREDERICK MD" and "FORT DETRICK MD" as valid cities, and "COLLEGE ESTATES MD" as a frequently-used erroneous city: https://tools.usps.com/go/ZipLookupResultsAction!input.action?resultMode=2&companyName=&address1=&address2=&city=&state=Select&urbanCode=&postalCode=21702&zip=

The Ziptastic API only returns Frederick.

Is the plan to recommend using Ziptastic only to fill in unpopulated fields, and discourage its use as a validator?

Project website URL is wrong

"elevenbasedtwo.com" is not to be found. Do you mean "elevenbasetwo.com"?

Also, I would think your project website would go to your GitHub pages site and not the actual API, which is difficult to visit in a browser.

Add ISO 3166-2 compliance

"Smart Tool! It would be nice, if the returned state is ISO 3166-2 instead of or additionally to the name."

Redis

Wouldn't this be the perfect candidate for using Redis as the datastore?

(Note: My opinion. Certainly open to debate.)

Australia country code given away

AU is the Australian country code - however it appears to be given to another country (unknown). Australian postcodes are four digits.

select * from zipcodes where Country = 'AU';

80593|96548|APO|AP|AU
80595|96550|APO|AP|AU
80598|96553|APO|AP|AU
80599|96554|DPO|AP|AU
80603|96577|APO|AP|AU

Server seems to hate any setRequestHeader content in the XHR request

I was re-writing the example using Prototype's Ajax.Request method (for clearer and potentially more cross-platform code) and discovered that the request would always fail. After some debugging with another member of the Prototype/Scriptaculous list, we came down to the realization that Prototype was adding the following headers to the request:

client.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
client.setRequestHeader('X-Prototype-Version', '1.7');
client.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*');

When any of those are present, your server returns an error: 501 Unsupported method ('OPTIONS').

If I comment them out, I get the correct response.

Can this be relaxed on the server, please?

Thanks,

Walter

Not Working in IE9

I've been sending requests to your example url (zip.elevenbasetwo.com) for a while now. I realize that it's never worked in IE9 and I believe the issue to be because the Response Headers do not include any kind of charset declaration.

Could you look into sending a proper charset back with the headers and perhaps update your example URL when you get a chance?

Thanks.

Support full Canadian postal codes

Canadian postal codes have two parts, separated by a space (e.g. "M4C 1B5").

The first part (called the Forward Sortation Area -- "M4C") is generally equivalent to the 5-digit ZIP code in the US in that it denotes a town (or section of a larger city), and is what the Ziptastic API currently supports:

http://zip.elevenbasetwo.com/v2/CA/M4C

The second part (called the Local Delivery Unit -- "1B5") drills down to more of a street or block level, much like the last four digits on a US ZIP+4 code.

The major difference between US zip codes and Canadian postal codes is that while I, as an American, couldn't name the full ZIP+4 for any of the homes I've ever lived in, Canadians know and use the full postal code.

Currently, querying the Ziptastic API on the Canadian full postal code (including both the FSA and the LDU) returns an empty result set:

http://zip.elevenbasetwo.com/v2/CA/M4C1B5 (and http://zip.elevenbasetwo.com/v2/CA/M4C+1B5 )

{}

Whereas querying the US API for the ZIP+4, while it's used much less frequently, works correctly:

http://zip.elevenbasetwo.com/v2/US/84040-5111

{"city": "Layton", "state": "Utah", "country": "US"}

Can you make the Canadian version similar to the US, so that an API call using the full postal code returns the same information as the partial 3-character version? Filter the input so that your database query actually only looks for the FSA, no matter what the input looks like. It appears you're already doing something similar to knock down a ZIP+4 to the 5-digit zip code in the US.

Add US State abbreviation (disqus comment)

"Hey guys, really great tool. We'd really like to use it for our website but have one question... is there any reason why US state abbreviation was removed from v2/, and is there any chance of adding a new key:value with the abbreviation to the new version? Thanks!"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.