Include the lib/hyperpublic.js file in your application
var Hyperpublic = require('/lib/hyperpublic');
Create the Hyperpublic object by declaring it
var hyperpublic = new Hyperpublic.Client('YOUR CLIENT KEY', 'YOUR CLIENT SECRET');
Now you can query against the Hyperpublic API. Each query takes two arguments. The first argument is the query itself while the second argument is the name of the callback function that you have specfied (if you’re not familiar with JSONP, start here).
client.places.find(your_query, your_callback);
A simple query for a person who has the id ‘4’ would look something like the call below. This call also triggers a function called ‘callback’.
hyperpublic.places.show({ "id":4 }, 'callback');
It’s very easy to search the Hyperpublic by sending a series of paramaters to the API. If I wanted to find 2 pizza places in New York, NY 10014, I would issue a query like this:
hyperpublic.places.find({ "location" : "New York, NY 10014", "q":"pizza", "limit": "2" }, 'callback');
The Hyperpublic API would then return a JSON object which represtents the data available in the callback function.
For detailed documentation on the Hyperpublic API, visit the developer site.