PHP code example of joesaunderson / sportmonks-soccer

1. Go to this page and download the library: Download joesaunderson/sportmonks-soccer 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/ */

    

joesaunderson / sportmonks-soccer example snippets


use Sportmonks\Soccer\SoccerApi;

...

// Basic API call for all Bookmakers
$response = SoccerApi::bookmakers()->getAll();

// API call for Fixtures with es()
    ->setIncludes(['goals', 'flatOdds:filter(bookmaker_id|2)'])
    ->getByDate('2019-05-28');

// API call for Fixtures with page specified 
$response = SoccerApi::fixtures()
    ->setPage(3)
    ->getByDate('2019-05-28');

->setBookmakers([1, 2])
->setFixtures([1, 2])
->setLeagues([1, 2])
->setMarkets([1, 2])

$response = SoccerApi::bookmakers()->getAll();

$response = SoccerApi::bookmakers()->getById($bookmakerId);

$response = SoccerApi::coaches()->getById($coachId);

$response = SoccerApi::commentaries()->getByFixtureId($fixtureId);

$response = SoccerApi::continents()->getAll();

$response = SoccerApi::continents()->getById($continentId);

$response = SoccerApi::countries()->getAll();

$response = SoccerApi::countries()->getById($countryId);

$response = SoccerApi::fixtures()->getById($fixtureId);

$response = SoccerApi::fixtures()->getByDate($date);

$response = SoccerApi::fixtures()->getByDateRange($dateFrom, $dateTo);

$response = SoccerApi::fixtures()->getByDateRangeForTeam($dateFrom, $dateTo, $teamId);

$response = SoccerApi::fixtures()->getByMultipleIds([$fixtureId1, $fixtureId2...]);

$response = SoccerApi::fixtures()->getLastUpdated();

$response = SoccerApi::head2head()->getByTeamIds($team1Id, $team2Id);

$response = SoccerApi::leagues()->getAll();

$response = SoccerApi::leagues()->getById($legueId);

$response = SoccerApi::liveScores()->getAll();

$response = SoccerApi::liveScores()->getAllInPlay();

$response = SoccerApi::markets()->getAll();

$response = SoccerApi::markets()->getById($marketId);

$response = SoccerApi::odds()->getByFixtureAndBookmaker($fixtureId, $bookmakerId);

$response = SoccerApi::odds()->getByFixtureAndMarket($fixtureId, $marketId);

$response = SoccerApi::odds()->getByFixtureId($fixtureId);

$response = SoccerApi::odds()->getInPlayByFixtureId($fixtureId);

$response = SoccerApi::players()->getById($playerId);

$response = SoccerApi::predictions()->getLeagues()

$response = SoccerApi::predictions()->getProbabilities()

$response = SoccerApi::predictions()->getProbabilitiesByFixtureId($fixtureId)

$response = SoccerApi::predictions()->getValueBets()

$response = SoccerApi::predictions()->getValueBetsByFixtureId($fixtureId)

$response = SoccerApi::rounds()->getById($roundId);

$response = SoccerApi::rounds()->getBySeasonId($seasonId);

$response = SoccerApi::seasons()->getAll();

$response = SoccerApi::seasons()->getById($seasonId);

$response = SoccerApi::stages()->getById($stageId);

$response = SoccerApi::stages()->getBySeasonId($seasonId);

$response = SoccerApi::standings()->getBySeasonId($seasonId);

$response = SoccerApi::standings()->getLiveStandingsBySeasonId($seasonId);

$response = SoccerApi::teams()->getById($teamId);

$response = SoccerApi::teams()->getBySeasonId($seasonId);

$response = SoccerApi::teamSquads()->getByTeamAndSeason($teamId, $seasonId);

$response = SoccerApi::topScorers()->getBySeasonId($seasonId);

$response = SoccerApi::topScorers()->getAggregatedBySeasonId($seasonId);

$response = SoccerApi::tvStations()->getByFixtureId($fixtureId);

$response = SoccerApi::venues()->getById($venueId);

$response = SoccerApi::venues()->getBySeasonId($seasonId);

$response = SoccerApi::videoHighlights()->getAll();