PHP Classes

PHP TheSportsDb: Get game information from the Sports DB site API

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 50%Total: 118 All time: 9,534 This week: 49Up
Version License PHP version Categories
thesportsdb 1.0.9GNU General Publi...5.5PHP 5, Games, Web services
Description 

Author

This package can get game information from the Sports DB site API.

It can send HTTP requests to thesportsdb.com API Web server to retrieve several types of information about sports games.

Currently it can get information about sports and their leagues, seasons, teams and players.

Innovation Award
PHP Programming Innovation award nominee
June 2016
Number 8


Prize: One downloadable copy of Komodo IDE
The SportsDb is a site that uses crowd sourcing to aggregate information about games of many different sports.

This package provides means to retrieve information about sports and their leagues, seasons, teams and players from the The SportsDB site.

Manuel Lemos
Picture of Jelle Sebreghts
  Performance   Level  
Innovation award
Innovation award
Nominee: 4x

Details

TheSportsDb

PHP Library to connect to the api of http://thesportsdb.com/

Example code

<?php

include_once __DIR__ . '/default_bootstrap.php';

// Get all sports.
$sports = $db->getSports();

// Print the first sport.
$sport = reset($sports);
print_r($sport->raw());

// Get the leagues of this sport (lazy loaded).
$leagues = $sport->getLeagues();

// Print the first league.
$league = reset($leagues);
print_r($league->raw());

// Get the seasons for this league.
$seasons = $league->getSeasons();

// Print the first season.
$season = reset($seasons);
print_r($season->raw());

// Get the events for this league.
$events = $season->getEvents();

// Print the first event.
$event = reset($events);
// Trigger lazy load, the full event object will be loaded when calling $event->raw().
$event->getName();
print_r($event->raw());

Code Climate Scrutinizer Code Quality Codacy Badge SensioLabsInsight Build Status

Code Coverage


  Files folder image Files (103)  
File Role Description
Files folder imageconfig (1 file)
Files folder imagesrc (1 file, 3 directories)
Files folder imagetests (1 file, 1 directory)
Accessible without login Plain text file .codeclimate.ruleset.xml Data Auxiliary data
Accessible without login Plain text file .codeclimate.yml Data Auxiliary data
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file default_bootstrap.php Conf. Configuration script
Accessible without login Plain text file default_bootstrap_dic.php Conf. Configuration script
Accessible without login Plain text file LICENSE Lic. License
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:118
This week:0
All time:9,534
This week:49Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:62%StarStarStarStar
Documentation:-
Examples:66%StarStarStarStar
Tests:-
Videos:-
Overall:50%StarStarStar
Rank:2713