achaitanyajami / icc-sportmonks-cricket
SportMonks Cricket API Client for PHP
v1.1.1
2024-03-20 03:16 UTC
Requires
- php: ^7.3 | ^8
- symfony/dotenv: ^5.4
- symfony/http-client: ^5.4
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();