konfig/sportmonks-php

Surpass the competition with superior sports data

v0.1.0 2023-07-19 18:35 UTC

This package is not auto-updated.

Last update: 2024-11-07 23:15:10 UTC


README

Surpass the competition with superior sports data

Installation & Usage

Requirements

This library requires PHP ^8.0

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/konfig-dev/sportmonks-php-sdk.git"
    }
  ],
  "require": {
    "konfig/sportmonks-php-sdk": "0.1.0"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/sportmonks-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$sportmonks = new \Sportmonks\Client(
    version: "v3",
    sport: "football",
    apiKey: "AUTHORIZATION",
);

$version = "v3"; // The version of the API.

try {
    $result = $sportmonks->cities->all(
        version: $version
    );
    print_r($result->$getData());
    print_r($result->$getPagination());
    print_r($result->$getSubscription());
    print_r($result->$getRateLimit());
    print_r($result->$getTimezone());
} catch (\Exception $e) {
    echo 'Exception when calling CitiesApi->all: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.sportmonks.com

Models

Author

This PHP package is automatically generated by Konfig: