Discord Support | NPM | GitHub
npm i pixelic-api-wrapper
const PixelicAPI = require("pixelic-api-wrapper");
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
const pixelicAPI = new PixelicAPI("HERE-YOUR-KEY-GOES");
pixelicAPI
.getDaily("Pixelic")
.then((dailyData) => {
/* process data */
})
.catch((error) => {
/* handle error */
});
try {
const dailyData = await pixelicAPI.getDaily("Pixelic");
/* process data */
} catch (error) {
/* handle error */
}
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) |
const pixelicAPI = new PixelicAPI("API-KEY", {
redis: {
host: "10.0.0.10",
port: 6379,
username: "default",
password: "",
},
});