achaitanyajami/icc-sportmonks-cricket

SportMonks Cricket API Client for PHP

v1.1.1 2024-03-20 03:16 UTC

This package is auto-updated.

Last update: 2024-11-20 04:38:41 UTC


README

PHP Library for Sportmonks Cricket API. Developed by Jami Arun Chaitanya.

Prerequisites

PHP >= 7.3

Installation

composer require achaitanyajami/icc-sportmonks-cricket

Setup

The API Client relies on Environment variables for configuration (setting API token & timezone).

Usage:

use Symfony\Component\Dotenv\Dotenv;
$dotenv = new Dotenv();
$dotenv->load(__DIR__.'/.env');

An example .env file:

# API TOKEN (Required)
# https://sportmonks.com/settings#/api
SPORTMONKS_API_TOKEN=_YOUR_API_TOKEN_HERE

# TIMEZONE (Optional)
# https://sportmonks.com/docs/football/2.0/getting-started/a/setting-the-timezone/82
SPORTMONKS_TIMEZONE=Europe/London

Usage

use Sportmonks\Cricket\CricketApi;

...

// Basic API call for all Fixtures
$response = CricketApi::fixtures();