2017 © Pedro Peláez
 

symfony-bundle sportmonks-client-bundle

Easily talk to an SportMonks API in Symfony

image

hristonev/sportmonks-client-bundle

Easily talk to an SportMonks API in Symfony

  • Monday, July 23, 2018
  • by hristonev
  • Repository
  • 1 Watchers
  • 4 Stars
  • 259 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 4 Open issues
  • 5 Versions
  • 116 % Grown

The README.md

SportMonks API Client Library

Build Status, (*1)

API Version support

This API Client supports SportMonks v2.0., (*2)

Requirements

  • PHP 5.6 or higher

Installation

composer require hristonev/sportmonks-client-bundle, (*3)

Configuration

``` php // Bootstrap require 'vendor/autoload.php';, (*4)

use SportMonks\API\HTTPClient as SportMonksAPI; use SportMonks\API\Utilities\Auth;, (*5)

// Default values. Can be initialized without arguments. $scheme = 'https'; $hostname = 'sportmonks.com'; $subDomain = 'soccer'; $port = 443;, (*6)

// Auth. $token = 'open sesame';, (*7)

$client = new SportMonksAPI(); // or //$client = new SportMonksAPI($scheme, $hostname, $subDomain, $port);, (*8)

// Set auth. $client->setAuth(Auth::BASIC, [ 'token' => $token ]);, (*9)


## Usage example ### Paginated resource ``` php $data = []; do{ $data = array_merge($data, $client->countries()->findAll()); }while($client->countries()->nextPage()); print_r($data);

Reference

Include data

php $seasonId = 6361; $teamId = 85; $client->squad()->getBySeasonAndTeam( $seasonId, $teamId, [ 'query' => [ 'include' => 'player,position' ] ] ) Above example, includes player info and player-position info into collection. Check for more query parameters., (*10)

Basic methods endpoints

Basic methods find({id}), findAll(), nextPage(). nextPage() is used on paginated response., (*11)

  • continents
  • countries
  • leagues
  • seasons
    • find(id, true) Include results.
    • standings(season_id)
    • standingsLive(season_id)
    • topScorers(season_id)
  • fixtures
    • between()->period(from, to, teamId) Params from and to are DateTime objects, teamId is integer. TeamId is optional.
    • date()->day(date) Param is DateTime object.
    • commentaries(fixture_id)
    • videoHighlights(fixture_id)
    • tvStations(fixture_id)
    • odds(fixture_id)
    • oddsByBookmaker(fixture_id, bookmaker_id)
    • oddsByMarket(fixture_id, market_id)
    • oddsInPlay(fixture_id)
    • Fixtures does not support findAll method.
  • teams
    • find(id, true) Include stats.
    • season(id) Get teams by season.
    • Teams does not support findAll method.
  • head2Head
    • get(array) Array must contain 2 elements(team1_id,team2_id).
    • There is no additional mthods.
  • liveScores
    • today()
    • inPlay()
  • highlights
    • Video haighlights does not support find method. Additional method in fixtures is presented.
  • venues
    • Venue does not support findAll method.
  • bookmakers
  • players
    • Players does not support findAll method.
  • squad
    • getBySeasonAndTeam(season_id, team_id) No other methods

The Versions

23/07 2018

dev-master

9999999-dev

Easily talk to an SportMonks API in Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dimitar Hristonev

10/11 2017

1.0.2

1.0.2.0

Easily talk to an SportMonks API in Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dimitar Hristonev

07/11 2017

1.0.1

1.0.1.0

Easily talk to an SportMonks API in Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dimitar Hristonev

01/11 2017

1.0

1.0.0.0

Easily talk to an SportMonks API in Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dimitar Hristonev

31/10 2017

0.0.1

0.0.1.0

Easily talk to an SportMonks API in Symfony

  Sources   Download

MIT

The Requires

 

by Dimitar Hristonev