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

Recommend this page to a friend!
  Info   View files View files (103)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2021-01-28 (1 month ago) RSS 2.0 feedStarStarStar 50%Total: 109 All time: 9,342 This week: 312Up
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  
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

 Version Control Unique User Downloads Download Rankings  
 100%
Total:109
This week:0
All time:9,342
This week:312Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:62%StarStarStarStar
Documentation:-
Examples:66%StarStarStarStar
Tests:-
Videos:-
Overall:50%StarStarStar
Rank:2338
  

For more information send a message to info at phpclasses dot org.