Skip to content

jaebradley/uber-estimates-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

95 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Greenkeeper badge Build Status codecov npm npm npm bundle size

A Node Uber Estimates Client

Introduction

A simple Node client that serves as an abstraction for the Uber Estimates API.

Installation

Install via NPM

npm install uber-estimates-client

Usage

Get Price Estimates

Gets the estimated price range for start and end coordinates.

Price Estimates Parameters

  • start (a coordinate)
  • end (a coordinate)
  • seats (optional)
    • default value is 2
    • maximum value is 2

Price Estimates Example

import UberEstimatesClient from 'uber-estimates-client';

const client = new UberEstimatesClient({ serverToken: 'my-server-token' });
let parameters = {
  start: {
    latitude: 1,
    longitude: 2,
  },
  end: {
    latitude: 3,
    longitude: 4,
  },
  seats: 1,
};
return client.getPriceEstimates(parameters);

Get Arrival Times

Gets the ETA for a given location and optional product

ETA parameters

  • start (a coordinate)
  • productId (optional)
    • must be a string

ETA Example

import UberEstimatesClient from 'uber-estimates-client';

const client = new UberEstimatesClient({ serverToken: 'my-server-token' });
let query = {
  start: {
    latitude: 1,
    longitude: 2,
  },
  productId: 'jaebaebae',
};
return client.getArrivalTimes(query);