This project introduces a GraphQL API, developed using Golang and hosted on Vercel, designed to streamline access to public information from the Fantasy Premier League. Its primary objective is to offer a simplified, unified, and user-friendly method for retrieving Fantasy Premier League data, eliminating the need to interact with multiple separate endpoints.
The API is using the Fantasy Premier League public API, but authentication is required simply to control some minimal rate limits. The API is using a simple token-based authentication, where the token is passed in the Authorization
header. Yes, for free!
Authorization : Bearer <api-token>
You can request a token by sending an email to me or creating an issue in this repository.
You can find the GraphQL Schema here
The API provides the following:
- Teams information (e.g. name, short name, code, strength attack, etc.)
- Players information (e.g. name, teams, points, cost, game stats, etc.)
- Events information (e.g. kick-off datetime, stats, etc.)
- Head to Head information with historical games between 2 teams (e.g. team names, team scores, etc.)
{
players {
webName
team
news
position
chanceOfPlayingNextRound
expectedGoals
form
nowCost
pointsPerGame
selectedByPercent
selectedRank
selectedRankType
totalPoints
minutes
goalsScored
assists
cleanSheets
goalsConceded
ownGoals
influence
ownGoals
ictIndex
threat
creativity
bonus
redCards
yellowCards
}
}
{
player(webName: "Salah") {
webName
team
news
position
chanceOfPlayingNextRound
}
}
{
players(teamShortName: "LIV") {
webName
team
news
position
chanceOfPlayingNextRound
expectedGoals
form
nowCost
pointsPerGame
selectedByPercent
selectedRank
selectedRankType
totalPoints
minutes
goalsScored
assists
cleanSheets
goalsConceded
ownGoals
influence
ownGoals
ictIndex
threat
creativity
bonus
redCards
yellowCards
}
}
For support, issues, or contributions, please visit our GitHub repository.
Anfield API is licensed under the MIT license