Socket
Socket
Sign inDemoInstall

sapi

Package Overview
Dependencies
1
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sapi

Sensis API Node.js client


Version published
Maintainers
1
Created

Changelog

Source

0.0.4

  • Add proxy support.
  • Modify endpoint callback to return SAPI response object.

Readme

Source

sapi http://travis-ci.org/cliffano/sapi

Sensis API Node.js client.

This is handy when you want to use Sensis API service from a Node.js application. This Sapi module provides a chainable interface to set the endpoint parameters.

Tested with Sensis API version ob-20110511.

Installation

npm install sapi

or as a dependency in package.json file:

"dependencies": {
  "sapi": "x.y.z"
}

Usage

var sapi = new (require('sapi'))('key', 'http://api.sensis.com.au/ob-20110511/test/');

sapi.proxy('http://user:pass@proxy:8080'); // optional

Parameters can then be chained to an endpoint:

sapi
  .param1('value1')
  .param2('value2')
  .param3('value3')
  .endpoint(function (err, result) {
    ...
  });

Search for restaurants in Melbourne:

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

Get listing details by ID:

sapi
  .query('12345')
  .getByListingId(function (err, result) {
    ...
  });

Retrieve categories metadata:

sapi
  .dataType('categories')
  .metadata(function (err, result) {
    ...
  });

Send report events:

sapi
  .userIp('192.1.2.3')
  .id('VyY2UiOi')
  .content('(03) 1234 5678')
  .report(function (err, result) {
    ...
  });

Endpoints

Check out Sensis API documentation for further details of the endpoints, a list of parameters, and response message structure:

Keywords

FAQs

Last updated on 13 Jul 2012

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc