Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Latest commit

 

History

History
31 lines (23 loc) · 1.38 KB

README.md

File metadata and controls

31 lines (23 loc) · 1.38 KB

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