Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fpl-api-node

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fpl-api-node - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

lib/index.d.ts

21

package.json
{
"name": "fpl-api-node",
"version": "1.0.3",
"version": "1.0.4",
"description": "A simple node wrapper for the fantasy.premierleague.com restful web api",
"main": "index.js",
"main": "lib/index.js",
"typings": "lib/index",
"files": [
"lib/"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"docs": "typedoc --out docs --mode file --readme none --hideGenerator"
},

@@ -13,2 +18,7 @@ "repository": {

},
"keywords": [
"fantasy premier league",
"fpl",
"api"
],
"author": "Thomas Grey",

@@ -21,4 +31,9 @@ "license": "MIT",

"dependencies": {
"@types/node-fetch": "^1.6.6",
"node-fetch": "^1.6.3"
},
"devDependencies": {
"tslint": "^4.0.2",
"typescript": "^2.1.4"
}
}

160

README.md

@@ -6,3 +6,3 @@ # fpl-api-node

A simple node wrapper for the fantasy.premierleague.com restful web api
A simple node wrapper for the Fantasy Premier League (fantasy.premierleague.com) restful web api.

@@ -15,9 +15,22 @@ ## Installation

## Usage
The package is written in typescript and can be consumed either strongly-typed or in plain Javascript.
Typescript:
```js
import * as fplapi from 'fpl-api-node';
```
Javascript:
```js
const fplapi = require('fpl-api-node');
```
fplapi.getEntry(123456).then((data) => {
### Example
```js
fplapi.getEntry(123456).then((entry) => {
// do something with our data
console.log(data);
console.log(entry);

@@ -29,117 +42,104 @@ }).catch((err) => {

## API
## Documentation
* [fplApiNode](#module_fplApiNode)
* [.getAllStaticData()](#module_fplApiNode.getAllStaticData) ⇒ <code>Promise</code>
* [.getTeams()](#module_fplApiNode.getTeams) ⇒ <code>Promise</code>
* [.getElements()](#module_fplApiNode.getElements) ⇒ <code>Promise</code>
* [.getEvent(eventNumber)](#module_fplApiNode.getEvent) ⇒ <code>Promise</code>
* [.getEntry(id)](#module_fplApiNode.getEntry) ⇒ <code>Promise</code>
* [.getEntryHistory(id)](#module_fplApiNode.getEntryHistory) ⇒ <code>Promise</code>
* [.getEntryEvent(id, eventNumber)](#module_fplApiNode.getEntryEvent) ⇒ <code>Promise</code>
* [.getEntryTransfers(id)](#module_fplApiNode.getEntryTransfers) ⇒ <code>Promise</code>
* [.getClassicLeagueStandings(id)](#module_fplApiNode.getClassicLeagueStandings) ⇒ <code>Promise</code>
### Typescript
<a name="module_fplApiNode.getAllStaticData"></a>
Typescript docs can be found at <a href="https://tgreyuk.github.io/fpl-api-node">https://tgreyuk.github.io/fpl-api-node</a>
### fplApiNode.getAllStaticData() ⇒ <code>Promise</code>
All static game data.
A promise that if fullfilled returns a json object mapped to:
https://fantasy.premierleague.com/drf/bootstrap-static
### API
**Kind**: static method of <code>[fplApiNode](#module_fplApiNode)</code>
<a name="module_fplApiNode.getTeams"></a>
<a name="module_fplApiNode"></a>
### fplApiNode.getTeams() ⇒ <code>Promise</code>
Teams (Premier Leaugue clubs)
A promise that if fullfilled returns a json object mapped to:
https://fantasy.premierleague.com/drf/teams
* [fplApiNode](#module_fplApiNode)
* [~getEntry(entryId)](#module_fplApiNode..getEntry) ⇒ <code>Promise</code>
* [~getEntryEvent(entryId, eventNumber)](#module_fplApiNode..getEntryEvent) ⇒ <code>Promise</code>
* [~getEntryTransfers(entryId)](#module_fplApiNode..getEntryTransfers) ⇒ <code>Promise</code>
* [~getAllStaticData()](#module_fplApiNode..getAllStaticData) ⇒ <code>Promise</code>
* [~getTeams()](#module_fplApiNode..getTeams) ⇒ <code>Promise</code>
* [~getElements()](#module_fplApiNode..getElements) ⇒ <code>Promise</code>
* [~getElementTypes()](#module_fplApiNode..getElementTypes) ⇒ <code>Promise</code>
* [~getGameSettings()](#module_fplApiNode..getGameSettings) ⇒ <code>Promise</code>
* [~getEvent()](#module_fplApiNode..getEvent) ⇒ <code>Promise</code>
* [~getClassicLeagueStandings(leagueId)](#module_fplApiNode..getClassicLeagueStandings) ⇒ <code>Promise</code>
**Kind**: static method of <code>[fplApiNode](#module_fplApiNode)</code>
<a name="module_fplApiNode.getElements"></a>
<a name="module_fplApiNode..getEntry"></a>
### fplApiNode.getElements() ⇒ <code>Promise</code>
Elements (players)
A promise that if fullfilled returns a json object mapped to:
https://fantasy.premierleague.com/drf/elements
### fplApiNode~getEntry(entryId) ⇒ <code>Promise</code>
Entry (Fpl manager team): A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/entry/${id}/history
**Kind**: static method of <code>[fplApiNode](#module_fplApiNode)</code>
<a name="module_fplApiNode.getEvent"></a>
**Kind**: inner method of <code>[fplApiNode](#module_fplApiNode)</code>
### fplApiNode.getEvent(eventNumber) ⇒ <code>Promise</code>
Event /gameweek details
A promise that if fullfilled returns a json object mapped to:
https://fantasy.premierleague.com/drf/event/${eventNumber}/live
| Param | Description |
| --- | --- |
| entryId | Entry id |
**Kind**: static method of <code>[fplApiNode](#module_fplApiNode)</code>
<a name="module_fplApiNode..getEntryEvent"></a>
### fplApiNode~getEntryEvent(entryId, eventNumber) ⇒ <code>Promise</code>
Entry event. Details of a particular event (or gameweek): A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/entry/${id}/event/${eventNumber}
**Kind**: inner method of <code>[fplApiNode](#module_fplApiNode)</code>
| Param | Description |
| --- | --- |
| entryId | Entry id |
| eventNumber | The event / gameweek number |
<a name="module_fplApiNode.getEntry"></a>
<a name="module_fplApiNode..getEntryTransfers"></a>
### fplApiNode.getEntry(id) ⇒ <code>Promise</code>
Entry (FPL team)
A promise that if fullfilled returns a json object mapped to:
https://fantasy.premierleague.com/drf/entry/${id}
### fplApiNode~getEntryTransfers(entryId) ⇒ <code>Promise</code>
Entry transfers: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/entry/${id}/transfers
**Kind**: static method of <code>[fplApiNode](#module_fplApiNode)</code>
**Kind**: inner method of <code>[fplApiNode](#module_fplApiNode)</code>
| Param | Description |
| --- | --- |
| id | Entry id |
| entryId | Entry id |
<a name="module_fplApiNode.getEntryHistory"></a>
<a name="module_fplApiNode..getAllStaticData"></a>
### fplApiNode.getEntryHistory(id) ⇒ <code>Promise</code>
Entry history. An expanded entry view with additional objects.
A promise that if fullfilled returns a json object mapped to:
https://fantasy.premierleague.com/drf/entry/${id}/history
### fplApiNode~getAllStaticData() ⇒ <code>Promise</code>
All static game data: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/bootstrap-static
**Kind**: static method of <code>[fplApiNode](#module_fplApiNode)</code>
**Kind**: inner method of <code>[fplApiNode](#module_fplApiNode)</code>
<a name="module_fplApiNode..getTeams"></a>
| Param | Description |
| --- | --- |
| id | Entry id |
### fplApiNode~getTeams() ⇒ <code>Promise</code>
Teams (Premier Leaugue clubs): A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/teams
<a name="module_fplApiNode.getEntryEvent"></a>
**Kind**: inner method of <code>[fplApiNode](#module_fplApiNode)</code>
<a name="module_fplApiNode..getElements"></a>
### fplApiNode.getEntryEvent(id, eventNumber) ⇒ <code>Promise</code>
Entry event. Details of a particular event (or gameweek)
A promise that if fullfilled returns a json object mapped to:
https://fantasy.premierleague.com/drf/entry/${id}/event/${eventNumber}
### fplApiNode~getElements() ⇒ <code>Promise</code>
Elements (players): A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/elements
**Kind**: static method of <code>[fplApiNode](#module_fplApiNode)</code>
**Kind**: inner method of <code>[fplApiNode](#module_fplApiNode)</code>
<a name="module_fplApiNode..getElementTypes"></a>
| Param | Description |
| --- | --- |
| id | Entry id |
| eventNumber | The event / gameweek number |
### fplApiNode~getElementTypes() ⇒ <code>Promise</code>
Element types: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/elements-types
<a name="module_fplApiNode.getEntryTransfers"></a>
**Kind**: inner method of <code>[fplApiNode](#module_fplApiNode)</code>
<a name="module_fplApiNode..getGameSettings"></a>
### fplApiNode.getEntryTransfers(id) ⇒ <code>Promise</code>
Entry transfers.
A promise that if fullfilled returns a json object mapped to:
https://fantasy.premierleague.com/drf/entry/${id}/transfers
### fplApiNode~getGameSettings() ⇒ <code>Promise</code>
Game settings: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/game-settings
**Kind**: static method of <code>[fplApiNode](#module_fplApiNode)</code>
**Kind**: inner method of <code>[fplApiNode](#module_fplApiNode)</code>
<a name="module_fplApiNode..getEvent"></a>
| Param | Description |
| --- | --- |
| id | Entry id |
### fplApiNode~getEvent() ⇒ <code>Promise</code>
Event /gameweek details: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/event/${eventNumber}/live
<a name="module_fplApiNode.getClassicLeagueStandings"></a>
**Kind**: inner method of <code>[fplApiNode](#module_fplApiNode)</code>
<a name="module_fplApiNode..getClassicLeagueStandings"></a>
### fplApiNode.getClassicLeagueStandings(id) ⇒ <code>Promise</code>
Classic league standings
A promise that if fullfilled returns a json object mapped to:
https://fantasy.premierleague.com/drf/leagues-classic-standings/${id}
### fplApiNode~getClassicLeagueStandings(leagueId) ⇒ <code>Promise</code>
Classic league standings: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/leagues-classic-standings/${id}
**Kind**: static method of <code>[fplApiNode](#module_fplApiNode)</code>
**Kind**: inner method of <code>[fplApiNode](#module_fplApiNode)</code>
| Param | Description |
| --- | --- |
| id | League id |
| leagueId | League id |
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc