Uber API

Well, a whole lot has changed over the last few years (since my last post). I've dove head first into new tech, mostly NodeJS. I've not done much Flash work in the last couple years but have done a whole lot of JavaScript and front end work.
Along with branching out (away from total Flash dev), I've started in on random projects that I think someone would benefit from and will be contributing where/when I can and building new "stuff" when I have time.
My first jaunt down this path is with the Uber API. Given I have been working in Node a whole lot the last couple years, I decided "why not?" It's a simple API but hey, if I can make it even more simple and developer friendly plus show my work and how I do things (and it's open source), there's benefit for everyone involved!
First, this is going to assume you have node installed as well as npm. From the command line, to install the module, run:
npm install uber-api

Here's a small example to get the available uber products.

var Uber = require('uber-api')('YOUR SERVER TOKEN','v1');

Uber.getProducts(36.3233, -94.1223, function(error, data) {  
  if (error) {
  console.log("ERROR: " + error);
  } else {
  console.log(data);
  }
});

The assumption is you've also registered an app with Uber and gotten your server token. It's pretty straight forward and simple.

There are currently three methods.

getProducts(latitude, longitude, callback)

getPriceEstimate(start_latitude, start_longitude, end_latitude, end_longitude, callback)

getTimeEstimate(start_latitude, start_longitude, [customer_uuid], [product_id], callback)  

Hopefully, this short intro will help you get going on the Uber API for your browser based apps! :)

Nathan Daniel

Read more posts by this author.

Atlanta, GA

Subscribe to Nathan P Daniel

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!