Opta Sports API

Component ID

2368629

Component name

Opta Sports API

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This module offers integration with the Opta Sports statistics service.

This module does nothing by itself. It is intended as a framework for developers to use to build a sports score and statistics application.

I built this module to help me build a live cricket scoreboard for a client site.

You will need an account with Opta to use this API.

See http://www.optasports.com/

Currently this project supports HTTP fetch of fixtures, and statistics for a given game.

Example code to fetch a fixture (feed type 'c1m' for men's International Cricket used in this example):

$opta = new OptaService();
  $fixture = $opta->getCompetitionFixture('c1m', 0, 0);
  // Do stuff here, update your fixture etc.

$fixture will be an array of the returned data.

Here's an example fetching a scorecard for a cricket match:

$opta = new OptaService;
  $scorecard = $opta->getScoreCard('c2', $game_id);
  // Do stuff with $scorecard - store locally, update your display etc.

$scorecard will be an array of the returned data.

See the README and comments in includes/OptaService.inc and includes/OptaServiceInterface.inc for more information.