npm.io
0.2.0 • Published 6 years ago

node-fpl-api

Licence
MIT
Version
0.2.0
Deps
5
Size
13 kB
Vulns
25
Weekly
0

FPL API

This is a really simple typescript/node module for retreiving a days power consumption and cost from FPL.

Thanks to https://github.com/Klathmon/python-fpl-api for the original reverse engineering work.

Warning: This uses undocumented APIs and could break at any moment.

Usage

import FPLAPI from "node-fpl-api";

const main = async () => {
    const api = new FPLAPI("user@name.com", "password");
    const account = await api.login();

    const consumption = await api.getDailyConsumption(account!, "20191110", "20191111");

    console.log(JSON.stringify(consumption));
}

main();