comment 1

Sapi, A Node.js Client For Sensis API

We had a hack day at Sensis a couple of days ago where I ended up writing Sapi, a Node.js client for Sensis API. This module is now available on NPM.

The latest version (v0.0.5) was tested against Sensis API open beta version ob-20110511. I think I’ve got all of its documented features covered. Let me know if I missed anything.

Sapi module provides a chainable interface to construct the endpoint parameters, here’s an example:

sapi
  .query('restaurants')
  .location('Melbourne')
  .search(function (err, result) {
    ...
  });

The above snippet performs a search for restaurants in Melbourne. It uses Sensis API search endpoint with query and location parameters.

If you want to add more parameters, e.g. for postcode and state filtering, just keep chaining them like this:

sapi
  .query('restaurants')
  .location('Melbourne')
  .postcode('3000')
  .state('VIC')
  .search(function (err, result) {
    ...
  });

Simple enough? Check out Sapi README for installation and further usage guide.

So, if you would like to write an application which requires Australian business listings information, check out Sensis API and apply for a key. And if you’re a Node.js coder, give Sapi a try.

Note: I know there’s also node-sapi module published to NPM, but it seems to be just a placeholder as the source code currently only implements API key checking.

About these ads

1 Comment so far

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s