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

concept-not-found/pubg-http-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published