axl-media-org / sportradar-sdk
PHP-based SDK to work with the Sportradar API & live events.
0.3.0
2021-02-08 12:09 UTC
Requires
- php: ^7.3|^8.0
- guzzlehttp/guzzle: ^6.5|^7.0
- illuminate/pagination: ^7.0|^8.0
- illuminate/support: ^7.0|^8.0
- nesbot/carbon: ^2.31
Requires (Dev)
- mockery/mockery: ^1.4
- orchestra/testbench: ^5.0|^6.0
This package is auto-updated.
Last update: 2024-11-13 10:35:46 UTC
README
Sportradar SDK is a PHP-based SDK to work with the Sportradar API & live events.
🚀 Installation
You can install the package via composer:
composer require axl-media-org/sportradar-sdk
Publish the config:
$ php artisan vendor:publish --provider="AxlMedia\SportradarSdk\SportradarSdkServiceProvider" --tag="config"
🙌 Usage
Laravel
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(); };
PHP
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(); };
Full API
🐛 Testing
vendor/bin/phpunit
🤝 Contributing
Please see CONTRIBUTING for details.