pubg.io
An ES6 Promise A+ Compliant NodeJS Library for the Official PlayerUnknown: Battlegrounds API.
PLEASE NOTE - This is an unfinished wrapper until the PUBG API is officially released to the public. Although tested, I can't guarantee this will consistently work until I have created a full release. You're free to test it if you have an API key, however and will accept collaborations. 🤘
Install
Install with Yarn
yarn add pubg.io
Install with NPM
npm install pubg.io
Import (ES6)
;
Defaults
Option | Type | Default | Description |
---|---|---|---|
platform | String | 'PC' | The platform to get data from. You can use PC or Xbox |
region | String | 'EU' | The region to get data from. See https://goo.gl/MqbFty for allowed regions. |
query | Object | {} | The Query String object to pass additional filters/requests. |
Usage
const api = 'InsertAPIKeyHere';
Match
https://developer.playbattlegrounds.com/docs/en/matches.html
Defaults & Limitations
- Data retention period is 14 days
- The max search time span between createdAt-start and createdAt-end is 14 days.
- If you don’t specify createdAt-start, the default is now() - 14 days.
- If you don’t specify createdAt-end, the default is now().
- If you search for a time > now, the default is now().
- If you search for a time before the retention period, the default is the retention period (now() - 14 days).
- If createdAt-start >= createdAt-end, you will receive an error.
GET_MATCH
api;
GET_MATCHES
api;
Filters
Use the query
option to set filters/sorting parameters.
Oldest First
api;
Newest First
api;
Limit
// Limit to 2 itemsapi;
Offset
// Offset data by 2 items, returning item 2 through to 5.api;
Testing
Testing is carried out with Mocha. To test, run:
npm test
TODO
- Build calls to GET_TELEMETRY data
- Refactor/implement individual calls, i.e.,
; const myAPI = key; const myMatch = key ...options callback;