Uber.getPriceEstimate()

A price estimate for each product offered.

Usage

Hover over inputs/exits for more info.

var Uber = require('machinepack-uber');


// A price estimate for each product offered.

Uber.getPriceEstimate({

apiKey: 'xAmBxAmBxAmBkjbyKkjbyKkjbyK',

startLatitude: 37.623908,

startLongitude: -122.381592,

endLatitude: 37.623908,

endLongitude: -122.401213,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// The rate limit has been exceeded.

rateLimitExceeded: function () {

 

},

// Distance between two points exceeds 100 miles.

tooFar: function () {

 

},

// Invalid api key.

invalidApiKey: function () {

 

},

// There is no available price for this location.

noPriceAvail: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

apiKey required

The private Uber API key for this application.

'xAmBxAmBxAmBkjbyKkjbyKkjbyK'
startLatitude required

Latitude component of start location.

37.623908
startLongitude required

Longitude component of start location.

-122.381592
endLatitude required

Latitude component of end location.

37.623908
endLongitude required

Longitude component of end location.

-122.401213

Exits

error

An unexpected error occurred.

rateLimitExceeded

The rate limit has been exceeded.

tooFar

Distance between two points exceeds 100 miles.

invalidApiKey

Invalid api key.

noPriceAvail

There is no available price for this location.

success

OK.

[ { productId: '08f17084-23fd-4103-aa3e-9b660223934b',
    currencyCode: 'USD',
    displayName: 'UberBLACK',
    estimate: '$23-29',
    lowEstimate: 23,
    highEstimate: 29,
    surgeMultiplier: 1,
    duration: 640,
    distance: 5.34 } ]