Help language development. Donate to The Perl Foundation
APISports::Football - An interface to API-Football.
APISports::Football is a Raku module for interfacing with API Sports Football.
An API key is required to use the API.
use APISports::Football:auth<zef:CIAvash>; my $f = APISports::Football.new: :api_key<1234>; my @competitions = $f.competitions: name => 'premier league', :current, type => LeagueType::League, :country<england>;
You need to have Raku and zef, then run:
zef install "APISports::Football:auth<zef:CIAvash>"
or if you have cloned the repo:
zef install .
prove -ve 'raku -I.' --ext rakutest
or
prove6 -I. -v
API key required by api-football.com
An object for making requests to api-football.com
method timezones( Bool :h(:$http_body) ) returns Mu
Get the respone object containing list of available timezones.
Get the HTTP response body
method countries( Bool :h(:$http_body), *%params (Str :$name, Str :$code where { ... }, Str :$search where { ... }) ) returns Mu
Get the respone object containing list of available countries.
Get the HTTP response body
Name of the country
Code of the country
Name of the country
method seasons( Bool :h(:$http_body) ) returns Mu
Get the respone object containing list of available seasons for competitions.
Get the HTTP response body
method competitions( Bool :h(:$http_body), *%params (Int :$id where { ... }, Str :$name, Str :$country, Str :$code where { ... }, Int :$season where { ... }, Int :$team where { ... }, LeagueType(Str) :$type, Bool :$current, Str :$search where { ... }, Int :$last where { ... }) ) returns Mu
Get the respone object containing list of available competitions.
Get the HTTP response body
ID of the league
Name of the league
Country name of the league
Code of the country
Season of the league
ID of the team
Type of the league
State of the league
Name or country name of the league
The X last leagues added to the API
method clubs( Bool :h(:$http_body), *%params (Int :$id where { ... }, Str :$name, Int :$league where { ... }, Str :$country, Int :$season where { ... }, Str :$search where { ... }) ) returns Mu
Get the respone object containing list of available clubs.
Get the HTTP response body
ID of the team
Name of the team
ID of the league
Country name of the team
Season of the league
Name or country name of the team
method team_stats( Bool :h(:$http_body), *%params (Int :$team! where { ... }, Int :$league! where { ... }, Int :$season! where { ... }, Date(Any) :$date) ) returns Mu
Get the respone object containing team's statistics.
Get the HTTP response body
ID of the team
ID of the league
Season of the league
The limit date
method team_seasons( Bool :h(:$http_body), *%params (Int :$team! where { ... }) ) returns Mu
Get the respone object containing list of available seasons for a team.
Get the HTTP response body
ID of the team
method venues( Bool :h(:$http_body), *%params (Int :$id where { ... }, Str :$name, Str :$country, Str :$search where { ... }) ) returns Mu
Get the respone object containing list of available venues.
Get the HTTP response body
ID of the venue
Name of the venue
Country name of the venue
Name, city or the country of the venue
method tables( Bool :h(:$http_body), *%params (Int :$team where { ... }, Int :$league where { ... }, Int :$season! where { ... }) ) returns Mu
Get the respone object containing standings of a league or team.
Get the HTTP response body
ID of the team
ID of the league
Season of the league
method rounds( Bool :h(:$http_body), *%params (Int :$league! where { ... }, Int :$season! where { ... }, Bool :$current) ) returns Mu
Get the respone object containing list of rounds for a league or cup.
Get the HTTP response body
ID of the league
Season of the league
Current round only
method matches( Bool :h(:$http_body), *%params (Int :$id where { ... }, Str :$live where { ... }, Date(Any) :$date, Int :$league where { ... }, Int :$season where { ... }, Int :$team where { ... }, Int :$last where { ... }, Int :$next where { ... }, Date(Any) :$from, Date(Any) :$to, Str :$round, MatchStatus(Str) :$status, Str :$timezone where { ... }) ) returns Mu
Get the respone object containing list of available matches.
Get the HTTP response body
ID of the fixture
all or IDs of two teams
A valid date
ID of the league
Season of the league
ID of the team
For the X last fixtures
For the X next fixtures
Fixtures from date
Fixtures to date
Round of the fixture
Status of the fixture
A valid timezone
method head_to_head( Bool :h(:$http_body), *%params (Str :$h2h! where { ... }, Date(Any) :$date, Int :$league where { ... }, Int :$season where { ... }, Int :$last where { ... }, Int :$next where { ... }, Date(Any) :$from, Date(Any) :$to, MatchStatus(Str) :$status, Str :$timezone where { ... }) ) returns Mu
Get the respone object containing list of head to heads between two teams.
Get the HTTP response body
IDs of two teams
Date of the fixtures
ID of the league
Season of the league
For the X last fixtures
For the X next fixtures
Fixtures from date
Fixtures to date
Status of the fixture
A valid timezone
method match_stats( Bool :h(:$http_body), *%params (Int :$fixture! where { ... }, Int :$team where { ... }, MatchStats(Str) :$type) ) returns Mu
Get the respone object containing statistics of a match.
Get the HTTP response body
ID of the fixture
ID of the team
Type of statistics
method fixture_events( Bool :h(:$http_body), *%params (Int :$fixture! where { ... }, Int :$team where { ... }, Int :$player where { ... }, FixtureEvent(Str) :$type) ) returns Mu
Get the respone object containing events for a fixture.
Get the HTTP response body
ID of the fixture
ID of the team
ID of the player
Type of events
method fixture_lineups( Bool :h(:$http_body), *%params (Int :$fixture! where { ... }, Int :$team where { ... }, Int :$player where { ... }, FixtureLineup(Str) :$type) ) returns Mu
Get the respone object containing lineups for a fixture.
Get the HTTP response body
ID of the fixture
ID of the team
ID of the player
Type of lineups
method fixture_players( Bool :h(:$http_body), *%params (Int :$fixture! where { ... }, Int :$team where { ... }) ) returns Mu
Get the respone object containing statistics for players from a fixture.
Get the HTTP response body
ID of the fixture
ID of the team
method injuries( Bool :h(:$http_body), *%params (Int :$league where { ... }, Int :$fixture where { ... }, Int :$team where { ... }, Int :$player where { ... }, Date(Any) :$date, Int :$season where { ... }, Str :$timezone where { ... }) ) returns Mu
Get the respone object containing list of players not participating in matches.
Get the HTTP response body
ID of the league
ID of the fixture
ID of the team
ID of the player
Date of the injury
Season of the league, required with league, team and player parameters
A valid timezone
method predictions( Bool :h(:$http_body), *%params (Int :$fixture! where { ... }) ) returns Mu
Get the respone object containing predictions for a fixture.
Get the HTTP response body
ID of the fixture
method coachs( Bool :h(:$http_body), *%params (Int :$id where { ... }, Int :$team where { ... }, Str :$search where { ... }) ) returns Mu
Get the respone object containing information about coachs and their careers.
Get the HTTP response body
ID of the coach
ID of the team
Name of the coach
method players( Bool :h(:$http_body), *%params (Int :$id where { ... }, Int :$team where { ... }, Int :$league where { ... }, Int :$season where { ... }, Str :$search where { ... }, Int :$page) ) returns Mu
Get the respone object containing information and statistics about players.
Get the HTTP response body
ID of the player
ID of the team
ID of the league
Season of the league
Name of the player
Use for pagination
method player_seasons( Bool :h(:$http_body), *%params (Int :$player where { ... }) ) returns Mu
Get the respone object containing list of available seasons for players statistics.
Get the HTTP response body
ID of the player
method squads( Bool :h(:$http_body), *%params (Int :$player where { ... }, Int :$team where { ... }) ) returns Mu
Get the respone object containing squad of a team or squads of a player.
Get the HTTP response body
ID of the player
ID of the team
method top_scorers( Bool :h(:$http_body), *%params (Int :$league! where { ... }, Int :$season! where { ... }) ) returns Mu
Get the respone object containing best players for a league or cup.
Get the HTTP response body
ID of the league
Season of the league
method top_assists( Bool :h(:$http_body), *%params (Int :$league! where { ... }, Int :$season! where { ... }) ) returns Mu
Get the respone object containing best assists for a league or cup.
Get the HTTP response body
ID of the league
Season of the league
method top_yellow_cards( Bool :h(:$http_body), *%params (Int :$league! where { ... }, Int :$season! where { ... }) ) returns Mu
Get the respone object containing players with the most yellow cards for a league or cup.
Get the HTTP response body
ID of the league
Season of the league
method top_red_cards( Bool :h(:$http_body), *%params (Int :$league! where { ... }, Int :$season! where { ... }) ) returns Mu
Get the respone object containing players with the most red cards for a league or cup.
Get the HTTP response body
ID of the league
Season of the league
method transfers( Bool :h(:$http_body), *%params (Int :$player where { ... }, Int :$team where { ... }) ) returns Mu
Get the respone object containing all available transfers for players and teams.
Get the HTTP response body
ID of the player
ID of the team
method trophies( Bool :h(:$http_body), *%params (Int :$player where { ... }, Int :$coach where { ... }) ) returns Mu
Get the respone object containing all available trophies for a player or coach.
Get the HTTP response body
ID of the player
ID of the coach
method sidelined( Bool :h(:$http_body), *%params (Int :$player where { ... }, Int :$coach where { ... }) ) returns Mu
Get the respone object containing all available sidelined information for a player or coach.
Get the HTTP response body
ID of the player
ID of the coach
If a response contains errors, a Failure
of type X::APISports::Football::APIError
is returned.
If HTTP errors occur, Failure
of type X::APISports::Football::HTTPError
is returned.
https://codeberg.org/CIAvash/APISports-Football
https://codeberg.org/CIAvash/APISports-Football/issues
Siavash Askari Nasr https://siavash.askari-nasr.com
Copyright © 2022 Siavash Askari Nasr
APISports::Football is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
APISports::Football is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with APISports::Football. If not, see http://www.gnu.org/licenses/.