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

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

  • 1.0.11
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

fpl-api-node

npm npm

A node wrapper for the Fantasy Premier League (fantasy.premierleague.com) restful web api. It's job is a simple one - to fetch and return data that maps to the available end-points.

Getting started

npm install fpl-api-node --save
const fplapi = require('fpl-api-node');

or

import * as fplapi from 'fpl-api-node';
fplapi.getEntry(123456).then((data) => {

  // do something with our data
  console.log(data);

}).catch((err) => {
  // something went wrong
});

Use cases

You can use the package in a number of ways. To leverage as a restful api on a web app using expressjs check out https://github.com/tgreyuk/fpl-angular-cli-express-seed.

A cache strategy is advisable on whatever platform the package is used with.

API

Functions

fetchBootstrapStatic

fetchBootstrapStatic(): Promise<BootstrapStatic>

Defined in index.ts:60

All static game data: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/bootstrap-static

Returns: Promise<BootstrapStatic>


fetchClassicLeagueStandings

fetchClassicLeagueStandings(leagueId: number): Promise<League>

Defined in index.ts:120

Classic league standings: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/leagues-classic-standings/${id}

Parameters:

NameTypeDefaultDescription
leagueIdnumber-League id

Returns: Promise<League>


fetchElementTypes

fetchElementTypes(): Promise<ElementType[]>

Defined in index.ts:89

Element types: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/elements-types

Returns: Promise<ElementType[]>


fetchElements

fetchElements(): Promise<Element[]>

Defined in index.ts:80

Elements (players): A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/elements

Returns: Promise<Element[]>


fetchEntry

fetchEntry(entryId: number): Promise<Entry>

Defined in index.ts:26

Entry (Fpl manager team): A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/entry/${id}/history

Parameters:

NameTypeDefaultDescription
entryIdnumber-Entry id

Returns: Promise<Entry>


fetchEntryEvent

fetchEntryEvent(entryId: number, eventNumber: number): Promise<EntryEvent>

Defined in index.ts:39

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}

Parameters:

NameTypeDefaultDescription
entryIdnumber-Entry id
eventNumbernumber-The event / gameweek number

Returns: Promise<EntryEvent>


fetchEntryTransfers

fetchEntryTransfers(entryId: number): Promise<EntryTransfers>

Defined in index.ts:50

Entry transfers: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/entry/${id}/transfers

Parameters:

NameTypeDefaultDescription
entryIdnumber-Entry id

Returns: Promise<EntryTransfers>


fetchEvent

fetchEvent(eventNumber: number): Promise<Event>

Defined in index.ts:109

Event /gameweek details: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/event/${eventNumber}/live

Parameters:

NameTypeDefaultDescription
eventNumbernumber--

Returns: Promise<Event>


fetchGameSettings

fetchGameSettings(): Promise<GameSettings>

Defined in index.ts:99

Game settings: A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/game-settings

Returns: Promise<GameSettings>


fetchTeams

fetchTeams(): Promise<Team[]>

Defined in index.ts:70

Teams (Premier Leaugue clubs): A promise that if fulfilled returns an object mapped to https://fantasy.premierleague.com/drf/teams

Returns: Promise<Team[]>


↩  Back to top


Interface: BootstrapStatic

Properties

NameType
element_typesElementType[]
elementsElement[]
eventsGameEvent[]
game-settingsGame
phasesGamePhase[]
teamsTeam[]
total-playersnumber

↩  Back to top


Interface: Element

Properties

NameType
assistsnumber
bonusnumber
bpsnumber
chance_of_playing_next_roundundefined⎮number
chance_of_playing_this_roundundefined⎮number
clean_sheetsnumber
codenumber
cost_change_eventnumber
cost_change_event_fallnumber
cost_change_startnumber
cost_change_start_fallnumber
creativitystring
dreamteam_countnumber
ea_indexnumber
element_typenumber
ep_nextstring
ep_thisstring
event_pointsnumber
first_namestring
formstring
goals_concedednumber
goals_scorednumber
ict_indexstring
idnumber
in_dreamteamboolean
influencestring
loaned_innumber
loaned_outnumber
loans_innumber
loans_outnumber
minutesnumber
newsstring
now_costnumber
own_goalsnumber
penalties_missednumber
penalties_savednumber
photostring
points_per_gamestring
red_cardsnumber
savesnumber
second_namestring
selected_by_percentstring
specialboolean
squad_numberundefined⎮number
statusstring
teamnumber
team_codenumber
threatstring
total_pointsnumber
transfers_innumber
transfers_in_eventnumber
transfers_outnumber
transfers_out_eventnumber
value_formstring
value_seasonstring
web_namestring
yellow_cardsnumber

↩  Back to top


Interface: ElementType

Properties

NameType
idnumber
plural_namestring
plural_name_shortstring
singular_namestring
singular_name_shortstring

↩  Back to top


Interface: Entry

Properties

NameType
chipsEntryChip[]
entryEntryDetails
historyEntryHistory[]
leaguesEntryLeagues
seasonEntrySeason[]

↩  Back to top


Interface: EntryAutomaticSub

Properties

NameType
element_innumber
element_outnumber
entrynumber
eventnumber
idnumber

↩  Back to top


Interface: EntryChip

Properties

NameType
chipnumber
entrynumber
eventnumber
namestring
played_time_formattedstring
statusstring
timeDate

↩  Back to top


Interface: EntryDetails

Properties

NameType
banknumber
current_eventnumber
deletedboolean
emailboolean
event_transfersnumber
event_transfers_costnumber
extra_free_transfersnumber
favourite_teamany
idnumber
joined_secondsnumber
joined_timeDate
kitstring
namestring
playernumber
player_first_namestring
player_last_namestring
player_region_idnumber
player_region_namestring
player_region_short_isostring
started_eventnumber
strategyany
summary_event_pointsnumber
summary_event_rankany
summary_overall_pointsnumber
summary_overall_ranknumber
total_loansnumber
total_loans_activenumber
total_transfersnumber
transfers_or_loansstring
valuenumber

↩  Back to top


Interface: EntryEvent

Properties

NameType
active_chipstring
automatic_subsEntryAutomaticSub[]
can_change_captainboolean
cenumber
entryEntryDetails
entry_historyEntryHistory
fixturesFixture[]
leaguesEntryLeagues
manager_subsany[]
own_entryboolean
picksEntryPick[]
pointsnumber
stateEntryState

↩  Back to top


Interface: EntryHistory

Properties

NameType
banknumber
entrynumber
eventnumber
event_transfersnumber
event_transfers_costnumber
idnumber
movementstring
overall_ranknumber
pointsnumber
points_on_benchnumber
rankundefined⎮number
rank_sortundefined⎮number
targetsany
total_pointsnumber
valuenumber

↩  Back to top


Interface: EntryLeague

Properties

NameType
_scoringstring
admin_entryundefined⎮number
closedboolean
createdDate
entry_can_adminboolean
entry_can_forumboolean
entry_can_inviteboolean
entry_can_leaveboolean
entry_changeany
entry_codestring
entry_last_ranknumber
entry_movementstring
entry_ranknumber
forum_disabledboolean
idnumber
league_typestring
make_code_publicboolean
namestring
rankany
reprocess_standingsboolean
short_namestring
sizeany
start_eventnumber

↩  Back to top


Interface: EntryLeagues

Properties

NameType
classicEntryLeague[]
cupEntryLeague[]
h2hEntryLeague[]

↩  Back to top


Interface: EntryPick

Properties

NameType
can_captainany
can_subany
elementnumber
element_typenumber
explainany[][]
has_playedboolean
is_captainboolean
is_subboolean
is_vice_captainboolean
multipliernumber
pointsnumber
positionnumber
statsStats

↩  Back to top


Interface: EntrySeason

Properties

NameType
idnumber
playernumber
ranknumber
seasonnumber
season_namestring
total_pointsnumber

↩  Back to top


Interface: EntryState

Properties

NameType
deadline_timeDate
deadline_time_formattedstring
eventnumber
event_daynumber
sub_statestring

↩  Back to top


Interface: EntryTransferHistory

Properties

NameType
element_innumber
element_in_costnumber
element_outnumber
element_out_costnumber
entrynumber
eventnumber
idnumber
timeDate
time_formattedstring

↩  Back to top


Interface: EntryTransfers

Properties

NameType
entryEntry
historyEntryTransferHistory[]
leaguesEntryLeagues
wildcardsEntryWildcard[]

↩  Back to top


Interface: EntryWildcard

Properties

NameType
chipnumber
entrynumber
eventnumber
namestring
played_time_formattedstring
statusstring
timeDate

↩  Back to top


Interface: Event

Properties

NameType
elementsEventElements
fixturesFixture[]

↩  Back to top


Interface: EventElements

Indexable

[key: number]: object

explain: EventElementsExplain[]

stats: Stats


↩  Back to top


Interface: EventElementsExplain

Indexable

[key: string]: object

name: string

points: number

value: number


↩  Back to top


Interface: Fixture

Properties

NameType
codenumber
deadline_timeDate
deadline_time_formattedstring
eventnumber
event_daynumber
finishedboolean
finished_provisionalboolean
idnumber
kickoff_timeDate
kickoff_time_formattedstring
minutesnumber
provisional_start_timeboolean
startedboolean
statsFixtureStats
team_anumber
team_a_scorenumber
team_hnumber
team_h_scorenumber

↩  Back to top


Interface: FixtureStatHomeAndAway

Properties

NameType
aFixtureStatValue[]
hFixtureStatValue[]

↩  Back to top


Interface: FixtureStatValue

Properties

NameType
elementnumber
valuenumber

↩  Back to top


Interface: FixtureStats

Properties

NameType
assistsFixtureStatHomeAndAway
bonusFixtureStatHomeAndAway
bpsFixtureStatHomeAndAway
goals_scoredFixtureStatHomeAndAway
own_goalsFixtureStatHomeAndAway
penalties_missedFixtureStatHomeAndAway
penalties_savedFixtureStatHomeAndAway
red_cardsFixtureStatHomeAndAway
savesFixtureStatHomeAndAway
yellow_cardsFixtureStatHomeAndAway

↩  Back to top


Interface: Game

Properties

NameType
bps_assistsnumber
bps_attempted_passes_limitnumber
bps_big_chances_creatednumber
bps_big_chances_missednumber
bps_cbi_limitnumber
bps_clearances_blocks_interceptionsnumber
bps_dribblesnumber
bps_errors_leading_to_goalnumber
bps_errors_leading_to_goal_attemptnumber
bps_foulsnumber
bps_key_passesnumber
bps_long_playnumber
bps_long_play_limitnumber
bps_offsidenumber
bps_open_play_crossesnumber
bps_own_goalsnumber
bps_pass_percentage_70number
bps_pass_percentage_80number
bps_pass_percentage_90number
bps_penalties_concedednumber
bps_penalties_missednumber
bps_penalties_savednumber
bps_recoveriesnumber
bps_recoveries_limitnumber
bps_red_cardsnumber
bps_savesnumber
bps_short_playnumber
bps_tacklednumber
bps_tacklesnumber
bps_target_missednumber
bps_winning_goalsnumber
bps_yellow_cardsnumber
cup_start_event_idnumber
currency_decimal_placesnumber
currency_multipliernumber
currency_symbolstring
default_formationnumber[][]
facebook_app_idstring
fifa_league_idnumber
formationsGameFormations
game_timezonestring
league_h2h_tiebreakstring
league_join_private_maxnumber
league_join_public_maxnumber
league_max_ko_rounds_h2hnumber
league_points_h2h_drawnumber
league_points_h2h_losenumber
league_points_h2h_winnumber
league_prefix_publicstring
league_size_classic_maxnumber
league_size_h2h_maxnumber
perform_league_idnumber
photo_base_urlstring
scoring_assistsnumber
scoring_bonusnumber
scoring_bpsnumber
scoring_concede_limitnumber
scoring_creativitynumber
scoring_ea_indexnumber
scoring_ict_indexnumber
scoring_influencenumber
scoring_long_playnumber
scoring_long_play_limitnumber
scoring_own_goalsnumber
scoring_penalties_missednumber
scoring_penalties_savednumber
scoring_red_cardsnumber
scoring_savesnumber
scoring_saves_limitnumber
scoring_short_playnumber
scoring_threatnumber
scoring_yellow_cardsnumber
squad_squadplaynumber
squad_squadsizenumber
squad_team_limitnumber
squad_total_spendnumber
static_game_urlstring
support_email_addressstring
sys_cdn_cache_enabledboolean
sys_use_event_live_apiboolean
sys_vice_captain_enabledboolean
transfers_costnumber
transfers_limitnumber
transfers_sell_on_feenumber
transfers_typestring
ui_el_hide_currency_qiboolean
ui_el_hide_currency_syboolean
ui_element_wrapnumber
ui_selection_player_limitnumber
ui_selection_price_gapnumber
ui_selection_short_team_namesboolean
ui_show_home_awayboolean

↩  Back to top


Interface: GameElement

Properties

NameType
bps_clean_sheetsnumber
bps_goals_scorednumber
scoring_clean_sheetsnumber
scoring_goals_concedednumber
scoring_goals_scorednumber
squad_max_playnumber
squad_min_playnumber
squad_selectnumber

↩  Back to top


Interface: GameEvent

Properties

NameType
average_entry_scorenumber
data_checkedboolean
deadline_timeDate
deadline_time_epochnumber
deadline_time_formattedstring
deadline_time_game_offsetnumber
finishedboolean
highest_scoreundefined⎮number
highest_scoring_entryundefined⎮number
idnumber
is_currentboolean
is_nextboolean
is_previousboolean
namestring

↩  Back to top


Interface: GameFormations

Properties

NameType
1-2-5-3number[][]
1-3-4-3number[][]
1-3-5-2number[][]
1-4-3-3number[][]
1-4-4-2number[][]
1-4-5-1number[][]
1-5-2-3number[][]
1-5-3-2number[][]
1-5-4-1number[][]

↩  Back to top


Interface: GamePhase

Properties

NameType
idnumber
namestring
start_eventnumber
stop_eventnumber

↩  Back to top


Interface: GameSettings

Properties

NameType
element_typeGameElement
gameGame

↩  Back to top


Interface: IApiLeaguePositions

Properties

NameType
entrynumber
entry_namestring
event_totalnumber
idnumber
last_ranknumber
leaguenumber
movementstring
own_entryboolean
player_namestring
ranknumber
rank_sortnumber
start_eventnumber
stop_eventnumber
totalnumber

↩  Back to top


Interface: League

Properties

NameType
leagueLeagueDetails
new_entriesLeagueStandings
standingsLeagueStandings
update_statusnumber

↩  Back to top


Interface: LeagueDetails

Properties

NameType
_scoringstring
admin_entryany
closedboolean
createdDate
forum_disabledboolean
idnumber
league_typestring
leagueban_setany[]
make_code_publicboolean
namestring
rankany
reprocess_standingsboolean
short_namestring
sizeany
start_eventnumber

↩  Back to top


Interface: LeagueStandings

Properties

NameType
has_nextboolean
numbernumber
resultsIApiLeaguePositions[]

↩  Back to top


Interface: Stats

Properties

NameType
assistsnumber
bonusnumber
bpsnumber
clean_sheetsnumber
creativitynumber
goals_concedednumber
goals_scorednumber
ict_indexnumber
in_dreamteamboolean
influencenumber
minutesnumber
own_goalsnumber
penalties_missednumber
penalties_savednumber
red_cardsnumber
savesnumber
threatnumber
total_pointsnumber
yellow_cardsnumber

↩  Back to top


Interface: Team

Properties

NameType
codenumber
current_event_fixtureTeamFixture[]
drawnumber
formany
idnumber
link_urlstring
lossnumber
namestring
next_event_fixtureTeamFixture[]
playednumber
pointsnumber
positionnumber
short_namestring
strengthnumber
strength_attack_awaynumber
strength_attack_homenumber
strength_defence_awaynumber
strength_defence_homenumber
strength_overall_awaynumber
strength_overall_homenumber
team_divisionnumber
unavailableboolean
winnumber

↩  Back to top


Interface: TeamFixture

Properties

NameType
daynumber
event_daynumber
idnumber
is_homeboolean
monthnumber
opponentnumber

↩  Back to top


Keywords

FAQs

Package last updated on 25 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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