Pixelicc / Pixelic-API-Wrapper

A Wrapper for the Pixelic-API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DEPRECATED

Links

Discord Support | NPM | GitHub

Install

npm i pixelic-api-wrapper
const PixelicAPI = require("pixelic-api-wrapper");

Quick Start

To be able to use the Pixelic-API via the Pixelic-API-Wrapper you still need to generate an API-Key. Instructions on how to generate an API-Key can be found here : https://docs.pixelic.de

Step 1 of 2

const pixelicAPI = new PixelicAPI("HERE-YOUR-KEY-GOES");

Step 2 of 2

➤ Using promises?

pixelicAPI
  .getDaily("Pixelic")
  .then((dailyData) => {
    /* process data */
  })
  .catch((error) => {
    /* handle error */
  });

➤ Using async/await?

try {
  const dailyData = await pixelicAPI.getDaily("Pixelic");
  /* process data */
} catch (error) {
  /* handle error */
}

Docs

Constructor

const pixelicAPI = new PixelicAPI("API-KEY", {
  /* options */
});

Basic options:

Option Default Description
ratelimit 60 Set how many "normal" Requests you want to send per Minute.
leaderboardRatelimit 10 Set how many Leaderboard Requests you want to send per Minute.
registerRatelimit 5 Set how many Register Requests you want to send per 5-Minutes.
checkForUpdates true Set whether to check for Updates on start.
redis.host null Redis-Host (Used for Clustered-Ratelimiting)
redis.port null Redis-Port (Used for Clustered-Ratelimiting)
redis.username null Redis-Username (Used for Clustered-Ratelimting)
redis.password null Redis-Password (Used for Clustered-Ratelimiting)

Clustered-Ratelimiting with Redis

const pixelicAPI = new PixelicAPI("API-KEY", {
  redis: {
    host: "10.0.0.10",
    port: 6379,
    username: "default",
    password: "",
  },
});

About

A Wrapper for the Pixelic-API

License:MIT License


Languages

Language:JavaScript 100.0%