PHP code example of axl-media-org / sportradar-sdk

1. Go to this page and download the library: Download axl-media-org/sportradar-sdk 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/ */

    

axl-media-org / sportradar-sdk example snippets


use AxlMedia\SportradarSdk\Facades\Facade as Sportradar;

$summaries = Sportradar::sport('soccer')
    ->sportEvents()
    ->from('summaries')
    ->getLiveSummaries();

while ($summaries->parseable()) {
    foreach ($summaries->getContent() as $match) {
        foreach ($match['sport_event']['competitors'] as $team) {
            //
        }
    }

    $summaries = $summaries->next();
};

use AxlMedia\SportradarSdk\SoccerV4;

// The key is the access_level and the value is the actual API key.
SoccerV4::keys([
    'production' => 'some-key',
    'trial' => 'some-key',
]);

$summaries = (new SoccerV4)
    ->sportEvents()
    ->from('summaries')
    ->getLiveSummaries();

while ($summaries->parseable()) {
    foreach ($summaries->getContent() as $match) {
        foreach ($match['sport_event']['competitors'] as $team) {
            //
        }
    }

    $summaries = $summaries->next();
};