Freelancing Gods 2014

God
30 Dec 2007

Postcode API

A couple of weeks ago I quickly coded a basic webservice – using Merb – for Australian Postcode data. Just got hosting for it sorted out last night, so now I can blog about it.

Postie

The emphasis is on simple – you can search by postcode or suburb, and get the data back either as a HTML page, XML, or JSON. That’s pretty much it. The request urls aren’t complicated, either:

Suburb requests use partial matching, so you don’t need the full suburb name. If you want the JSON returned with the MIME type of application/json, use the .json extension.

I’ve no plans at this point on using this, but perhaps it’s useful for someone out there – if so, would love to hear about it.

Comments

6 responses to this article

30 Dec 2007
Tim Lucas said:

That’s really cool. I’m sure someone will find it handy.

30 Dec 2007
shoaib said:

well done Pat, this will come in handy

30 Dec 2007
Dr Nic said:

Ooh tastie indeed.

A cmd-line wrapper for the API would be like a tastie toasted sandwich.

19 Jan 2008
Marston A. said:

Hey Pat,

This looks like a great tool indeed! Would you happen to know of any similar API’s/Plug-in’s for U.S. Postal Codes?

20 Jan 2008
pat said:

Heya Marston

It looks like the USPS has a couple of APIs that do the job – there’s “documentation on their site”http://www.usps.com/webtools/technical.htm

Not quite as simple as mine… but if you find a csv or similar of all the US zip codes and matching cities and states, I could look at building an equivalent service for it.

20 May 2011
Matthew Lock said:

Hello, could you make your webservice available via JSONP by adding a ?callback= parameter to your .js url? That way we can call your API from javascript in a web page.

http://en.wikipedia.org/wiki/JSONP

http://api.jquery.com/jQuery.getJSON/

Leave a Comment

Comments are formatted using Textile. Please be respectful of others when posting comments. Be nice.

RssSubscribe to the RSS feed

Related Links

Related Posts

About Freelancing Gods

Freelancing Gods is written by , who works on the web as a web developer in Melbourne, Australia, specialising in Ruby on Rails.

In case you're wondering what the likely content here will be about (besides code), keep in mind that Pat is passionate about the internet, music, politics, comedy, bringing people together, and making a difference. And pancakes.

His ego isn't as bad as you may think. Honest.

Here's more than you ever wanted to know.

Ruby on Rails Projects

Other Sites

Creative Commons Logo All original content on this site is available through a Creative Commons by-nc-sa licence.