PHP code example of fpicosm / sportmonks-football-api

1. Go to this page and download the library: Download fpicosm/sportmonks-football-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fpicosm / sportmonks-football-api example snippets


    Sportmonks\FootballApi\FootballApiServiceProvider::class,
    

    
    
    if (!function_exists('config_path')) {
        function config_path($path = '')
        {
            return app()->basePath() . '/config' . ($path ? "/$path" : $path);
        }
    }

    return [
        'token' => env('SPORTMONKS_TOKEN'),
        'timezone' => env('SPORTMONKS_TIMEZONE') ?: env('APP_TIMEZONE'),
    ];
    

    $app->configure('football-api');
    

    $app->register(Sportmonks\FootballApi\FootballApiServiceProvider::class);
    

use Sportmonks\FootballApi\FootballApi;

FootballApi::endpoint()->method($params):

FootballApi::countries()->select('name,official_name')->all();
FootballApi::countries()->select(['name', 'official_name'])->all();

FootballApi::countries()->>

FootballApi::continents()->

FootballApi::countries()->page(2)->all();

FootballApi::countries()->perPage(150)->all();

FootballApi::bookmakers()->all();

FootballApi::bookmakers()->premium();

FootballApi::bookmakers()->find($bookmakerId);

FootballApi::bookmakers()->search($name);

FootballApi::bookmakers()->byFixture($fixtureId);

FootballApi::bookmakers($bookmakerId)->preMatchOddsByFixture($fixtureId);

FootballApi::bookmakers($bookmakerId)->inplayOddsByFixture($fixtureId);

FootballApi::bookmakers($marketId)->premiumOddsByFixture($fixtureId);

FootballApi::cities()->all();

FootballApi::cities()->find($cityId);

FootballApi::cities()->search($name);

FootballApi::coaches()->all();

FootballApi::coaches()->find($coachId);

FootballApi::coaches()->byCountry($countryId);

FootballApi::coaches()->search($name);

FootballApi::coaches()->lastUpdated();

FootballApi::coaches()->statisticsBySeason($seasonId);

FootballApi::commentaries()->all();

FootballApi::commentaries()->byFixture($fixtureId);

FootballApi::continents()->all();

FootballApi::continents()->find($continentId);

FootballApi::countries()->all();

FootballApi::countries()->find($countryId);

FootballApi::countries()->search($name);

FootballApi::countries($countryId)->leagues();

FootballApi::countries($countryId)->players();

FootballApi::countries($countryId)->teams();

FootballApi::countries($countryId)->coaches();

FootballApi::countries($countryId)->referees();

FootballApi::enrichments()->all();

FootballApi::expected()->byTeam();

FootballApi::expected()->byPlayer();

FootballApi::filters()->all();

FootballApi::fixtures()->all();

FootballApi::fixtures()->find($fixtureId);

FootballApi::fixtures()->multiples([1, 2, 3, 4, 5]);
// or
FootballApi::fixtures()->multiples('1,2,3,4,5');

FootballApi::fixtures()->byDate($date);

FootballApi::fixtures()->byDateRange($from, $to);

FootballApi::fixtures()->byDateRangeForTeam($from, $to, $teamId);

FootballApi::fixtures()->headToHead($firstTeamId, $secondTeamId);

FootballApi::fixtures()->search($teamName);

FootballApi::fixtures()->upcomingByMarket($marketId);

FootballApi::fixtures()->upcomingByTvStation($tvStationId);

FootballApi::fixtures()->pastByTvStation($tvStationId);

FootballApi::fixtures()->lastUpdated();

FootballApi::fixtures($fixtureId)->tvStations();

FootballApi::fixtures($fixtureId)->predictions();

FootballApi::fixtures($fixtureId)->bookmakers();

FootballApi::fixtures($fixtureId)->commentaries();

FootballApi::fixtures($fixtureId)->valueBets();

FootballApi::fixtures($fixtureId)->preMatchOdds();

FootballApi::fixtures($fixtureId)->preMatchOddsByBookmaker($bookmakerId);

FootballApi::fixtures($fixtureId)->preMatchOddsByMarket($marketId);

FootballApi::fixtures($fixtureId)->inplayOdds();

FootballApi::fixtures($fixtureId)->inplayOddsByBookmaker($bookmakerId);

FootballApi::fixtures($fixtureId)->inplayOddsByMarket($marketId);

FootballApi::fixtures($fixtureId)->premiumOdds();

FootballApi::fixtures($fixtureId)->premiumOddsByBookmaker($bookmakerId);

FootballApi::fixtures($fixtureId)->premiumOddsByMarket($marketId);

FootballApi::leagues()->all();

FootballApi::leagues()->find($leagueId);

FootballApi::leagues()->live();

FootballApi::leagues()->byFixtureDate($date);

FootballApi::leagues()->byCountry($countryId);

FootballApi::leagues()->search($name);

FootballApi::leagues()->allByTeam($teamId);

FootballApi::leagues()->currentByTeam($teamId);

FootballApi::leagues($leagueId)->liveStandings();

FootballApi::leagues($leagueId)->predictions();

FootballApi::livescores()->inplay();

FootballApi::livescores()->all();

FootballApi::livescores()->lastUpdated();

FootballApi::markets()->all();

FootballApi::markets()->premium();

FootballApi::markets()->find($marketId);

FootballApi::markets()->search($name);

FootballApi::markets($marketId)->preMatchOddsByFixture($fixtureId);

FootballApi::markets($marketId)->inplayOddsByFixture($fixtureId);

FootballApi::markets($marketId)->premiumOddsByFixture($fixtureId);

FootballApi::news()->all();

FootballApi::news()->bySeason($seasonId);

FootballApi::news()->upcoming();

FootballApi::oddsInplay()->all();

FootballApi::oddsInplay()->byFixture($fixtureId);

FootballApi::oddsInplay()->byFixtureAndBookmaker($fixtureId, $bookmakerId);

FootballApi::oddsInplay()->byFixtureAndMarket($fixtureId, $marketId);

FootballApi::oddsInplay()->lastUpdated();

FootballApi::oddsPreMatch()->all();

FootballApi::oddsPreMatch()->byFixture($fixtureId);
bash
    php artisan vendor:publish --provider="Sportmonks\FootballApi\FootballApiServiceProvider"
    
php
FootballApi::oddsPreMatch()->byFixtureAndBookmaker($fixtureId, $bookmakerId);
php
FootballApi::oddsPreMatch()->byFixtureAndMarket($fixtureId, $marketId);
php
FootballApi::oddsPreMatch()->lastUpdated();
php
FootballApi::oddsPremium()->all();
php
FootballApi::oddsPremium()->byFixture($fixtureId);
php
FootballApi::oddsPremium()->byFixtureAndBookmaker($fixtureId, $bookmakerId);
php
FootballApi::oddsPremium()->byFixtureAndMarket($fixtureId, $marketId);
php
FootballApi::oddsPremium()->updatedBetween($from, $to);
php
FootballApi::oddsPremium()->historicalBetween($from, $to);
php
FootballApi::oddsPremium()->historical();
php
FootballApi::players()->all();
php
FootballApi::players()->find($playerId);
php
FootballApi::players()->byCountry($countryId);
php
FootballApi::players()->search($name);
php
FootballApi::players()->lastUpdated();
php
FootballApi::players($playerId)->transfers();
php
FootballApi::players()->statisticsBySeason($seasonId);
php
FootballApi::predictions()->probabilities();
php
FootballApi::predictions()->byLeague($leagueId);
php
FootballApi::predictions()->byFixture($fixtureId);
php
FootballApi::predictions()->valueBets();
php
FootballApi::predictions()->valueBetsByFixture($fixtureId);
php
FootballApi::referees()->all();
php
FootballApi::referees()->find($refereeId);
php
FootballApi::referees()->byCountry($countryId);
php
FootballApi::referees()->search($name);
php
FootballApi::referees()->bySeason($seasonId);
php
FootballApi::referees()->statisticsBySeason($seasonId);
php
FootballApi::regions()->all();
php
FootballApi::regions()->find($regionId);
php
FootballApi::regions()->search($name);
php
FootballApi::resources()->all();
php
FootballApi::rivals()->all();
php
FootballApi::rivals()->byTeam($teamId);
php
FootballApi::rounds()->all();
php
FootballApi::rounds()->find($roundId);
php
FootballApi::rounds()->bySeason($seasonId);
php
FootballApi::rounds()->search($name);
php
FootballApi::rounds($roundId)->standings();
php
FootballApi::rounds($roundId)->statistics();
php
FootballApi::schedules()->bySeason($seasonId);
php
FootballApi::schedules()->byTeam($teamId);
php
FootballApi::schedules()->bySeasonAndTeam($seasonId, $teamId);
php
FootballApi::seasons()->all();
php
FootballApi::seasons()->find($seasonId);
php
FootballApi::seasons()->byTeam($teamId);
php
FootballApi::seasons()->search($year);
php
FootballApi::seasons($seasonId)->schedules();
php
FootballApi::seasons($seasonId)->schedulesByTeam($teamId);
php
FootballApi::seasons($seasonId)->stages();
php
FootballApi::seasons($seasonId)->rounds();
php
FootballApi::seasons($seasonId)->standings();
php
FootballApi::seasons($seasonId)->standingsCorrection();
php
FootballApi::seasons($seasonId)->topscorers();
php
FootballApi::seasons($seasonId)->teams();
php
FootballApi::seasons($seasonId)->squadsByTeam($teamId);
php
FootballApi::seasons($seasonId)->venues();
php
FootballApi::seasons($seasonId)->news();
php
FootballApi::seasons($seasonId)->referees();
php
FootballApi::seasons($seasonId)->playerStatistics();
php
FootballApi::seasons($seasonId)->teamStatistics();
php
FootballApi::seasons($seasonId)->coachStatistics();
php
FootballApi::seasons($seasonId)->refereeStatistics();
php
FootballApi::squads()->byTeam($teamId);
php
FootballApi::squads()->extendedByTeam($teamId);
php
FootballApi::squads()->byTeamAndSeason($teamId, $seasonId);
php
FootballApi::stages()->all();
php
FootballApi::stages()->find($stageId);
php
FootballApi::stages()->bySeason($seasonId);
php
FootballApi::stages()->search($name);
php
FootballApi::stages($stageId)->topscorers();
php
FootballApi::stages($stageId)->statistics();
php
FootballApi::standings()->all();
php
FootballApi::standings()->bySeason($seasonId);
php
FootballApi::standings()->correctionBySeason($seasonId);
php
FootballApi::standings()->byRound($roundId);
php
FootballApi::standings()->liveByLeague($leagueId);
php
FootballApi::states()->all();
php
 FootballApi::states()->find($stateId);
php
FootballApi::statistics()->playersBySeason($seasonId);
php
FootballApi::statistics()->teamsBySeason($seasonId);
php
FootballApi::statistics()->coachesBySeason($seasonId);
php
FootballApi::statistics()->refereesBySeason($seasonId);
php
FootballApi::statistics()->byStage($stageId);
php
FootballApi::statistics()->byRound($roundId);
php
FootballApi::teams()->all();
php
FootballApi::teams()->find($teamId);
php
FootballApi::teams()->byCountry($countryId);
php
FootballApi::teams()->bySeason($seasonId);
php
FootballApi::teams()->search($name);
php
FootballApi::teams($teamId)->fixturesByDateRange($from, $to);
php
FootballApi::teams($teamId)->headToHead($opponentId);
php
FootballApi::teams($teamId)->allLeagues();
php
FootballApi::teams($teamId)->currentLeagues();
php
FootballApi::teams($teamId)->schedules();
php
FootballApi::teams($teamId)->schedulesBySeason($seasonId);
php
FootballApi::teams($teamId)->seasons();