# r6api

> Module to query UbiSoft's web API

Latest version **1.12.2** (published 2017-09-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install r6api
pnpm add r6api
yarn add r6api
bun add r6api
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.12.2 |
| Published | 2017-09-06 |
| First published | 2016-09-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | gitgudscrub |

## Links

- npm: https://www.npmjs.com/package/r6api
- Repository: https://gitlab.com/gitgudscrub/r6api
- Homepage: https://gitlab.com/gitgudscrub/r6api#readme
- Issues: https://gitlab.com/gitgudscrub/r6api/issues
- npm.io page: https://npm.io/package/r6api

## Dependencies (8)

- [lodash](https://npm.io/package/lodash.md) ^4.13.1
- [moment](https://npm.io/package/moment.md) ^2.17.1
- [request](https://npm.io/package/request.md) ^2.72.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.1
- [notsofast](https://npm.io/package/notsofast.md) ^1.0.1
- [require-all](https://npm.io/package/require-all.md) ^2.0.0
- [ensure-array](https://npm.io/package/ensure-array.md) 0.0.5
- [subclass-error](https://npm.io/package/subclass-error.md) ^0.1.1

## Recent versions

- 1.12.2 (latest) — 2017-09-06
- 1.12.1 — 2017-09-06
- 1.12.0 — 2017-06-06
- 1.11.0 — 2017-06-04
- 1.10.2 — 2017-05-19
- 1.10.1 — 2017-04-23
- 1.10.0 — 2017-03-03
- 1.8.4 — 2017-01-10
- 1.8.3 — 2016-12-20
- 1.8.2 — 2016-12-16
- 1.8.1 — 2016-12-16
- 1.8.0 — 2016-12-11
- 1.7.3 — 2016-12-11
- 1.7.2 — 2016-12-11
- 1.7.1 — 2016-11-30
- … 8 more at https://npm.io/package/r6api/versions

## README

# R6Api  

initialize:
```
let api = require("r6api")({
    email: "my-ubi@login.com",
    password: "sup3rs3c3t"
});
```

api functions:


## getAuthToken()

### description  
the Authorization header used

### returns
a promise of the auth header string:


## findByName(name: string)

### description  
this find's a players unique id.

### params
    - name: the player's name

### returns
a promise of an array containing id objects:
```
[
    {
        "id": "1b50085a-8a20-4ce6-b75f-db6a00e4d718",
        "name": "LaxisB"
    }
]
```  
  
## getCurrentName(...ids: string)  

### description

get the current names for all passed id's  

### params
    - id: the uplay id  

### returns
a promise of an array containing íd objects:

```
[ 
    { 
        "id": "1b50085a-8a20-4ce6-b75f-db6a00e4d718",
        "name": "LaxisB" 
    }, 
    { 
        "id": "ccd28cc4-845e-4726-8cf8-e2cac4de82a2",
        "name": "NaughtyMuppet" 
    } 
]
```  

## getPlayTime(...ids: string)  

### description
returns the seconds played in casual and ranked for the given ids  

### params
    - id: the uplay id

### returns
a promise of an array containing the play times:
```
[ 
    { 
        "id": "ccd28cc4-845e-4726-8cf8-e2cac4de82a2",
        "casual": 2183940,
        "ranked": 272432 
    },
    { 
        "id": "1b50085a-8a20-4ce6-b75f-db6a00e4d718",
        "casual": 960196,
        "ranked": 116373 
    } 
]

```

## getStats(...ids: string)  

### description
returns the players stats  

### params
    - id: the uplay id

### returns
a promise of an array containing the stats:
```
[
    {
        "id": "ccd28cc4-845e-4726-8cf8-e2cac4de82a2",
        "matchesLost": 908,
        "matchesWon": 2023,
        "kills": 10078,
        "deaths": 7039
    },
    {
        "id": "1b50085a-8a20-4ce6-b75f-db6a00e4d718",
        "matchesLost": 389,
        "matchesWon": 901,
        "kills": 3846,
        "deaths": 3023
    }
]
```

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