# 352-uber

> Uber API for NodeJS

Latest version **0.0.4** (published 2015-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install 352-uber
pnpm add 352-uber
yarn add 352-uber
bun add 352-uber
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2015-07-22 |
| First published | 2015-07-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | 352inc |
| Maintainers | dvideby0 |
| Keywords | uber, api |

## Links

- npm: https://www.npmjs.com/package/352-uber
- Repository: https://github.com/352media/352-uber
- Issues: https://github.com/352media/352-uber/issues
- npm.io page: https://npm.io/package/352-uber

## Dependencies (3)

- [promise](https://npm.io/package/promise.md) ^6.1.0
- [request](https://npm.io/package/request.md) ^2.53.0
- [underscore](https://npm.io/package/underscore.md) ^1.8.2

## Recent versions

- 0.0.4 (latest) — 2015-07-22
- 0.0.3 — 2015-07-22
- 0.0.2 — 2015-07-22
- 0.0.1 — 2015-07-22

## README

uber-api
====

NodeJS implementation of Uber API.
The latest update has promise pattern implemented.

## Installation
```
npm install uber-api
```

## Usage
```javascript
var Uber = require('uber-api')({server_token:'YOUR SERVER TOKEN',version:'v1'}),
    lat = 36,
    lon = -94;

Uber.getProducts(lat, lon, function(error, response) {
  if (error) {
    console.log(error);
  } else {
    console.log(response);
  }
});

Uber.getProducts(lat, lon).then(function(response){
  console.log(response);
}, function(error){
  console.error(response);
});
```

## API Reference
```
getProducts(latitude, longitude[, callback])
getPriceEstimate(start_latitude, start_longitude, end_latitude, end_longitude[, callback])
getTimeEstimate(start_latitude, start_longitude [,customer_uuid] [,product_id][, callback])
getPromotions(start_latitude, start_longitued, end_latitude, end_longitued [, callback])
+getMe([callback])
+†getHistory([callback])
```

+These require special tokens you can get via OAuth2.  You can then initialize Uber with {bearer_token:'YOUR BEARER TOKEN',version:'v1'}.

† This functionality inspects the version passed in and if it is "v1" will auto adjust to "v1.1".  As per the Uber documentation (https://developer.uber.com/v1/endpoints/#user-activity-v1) v1 requires special permission to use. This library currently assumes this permission is not in place.

Rate limit state is returned as a member of the response object.
```
Uber.getProducts(lat, lon).then(function(response){
  console.log(response.rate_limit);
});
```

---
_Source: https://npm.io/package/352-uber · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
