pubg-http-api

1.0.1 • Public • Published

pubg-http-api

An axios HTTP client for PUBG API.

This library makes it easier for you to make HTTP PUBG API calls. It is not an abstraction distraction of the native HTTP PUBG API.

This library does not handle rate limiting! You need to provide your own rate limiting solution using the returned headers. See https://documentation.playbattlegrounds.com/en/api-keys.html#rate-limits

Example

const PubgHttpApi = require('pubg-http-api');
 
const pubgHttpClient = PubgHttpApi(process.env.PUBG_API_KEY, 'pc-na');
 
pubgHttpClient.get('players', {
  playerNames: ['shroud', 'break']
})
  .then((response) => {
    // response is an axios response
  });
 
pubgHttpClient.get('matches/a646eaee-36cd-11e8-b467-0ed5f89f718b')
  .then((response) => {
    // response is an axios response
  });

Usage

PubgHttpApi(apiKey, region) creates PUBG HTTP client

pubgHttpClient.get(endpoint, filters?) calls gets on endpoint with optional filters, where filters is an object with filter names to array of filter values

For all available endpoints and the contents of responses, see https://documentation.playbattlegrounds.com/en/introduction.html

Readme

Keywords

none

Package Sidebar

Install

npm i pubg-http-api

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

3.52 kB

Total Files

6

Last publish

Collaborators

  • pyrolistical