Skip to content

Latest commit

 

History

History
577 lines (412 loc) · 14.7 KB

OddsApi.md

File metadata and controls

577 lines (412 loc) · 14.7 KB

Sportmonks\OddsApi

All URIs are relative to https://api.sportmonks.com, except if the operation defines another base path.

Method HTTP request Description
bookmakerById() GET /{version}/odds/bookmakers/{bookmakerId} By ID
bookmakersAll() GET /{version}/odds/bookmakers All
bookmakersByFixtureId() GET /{version}/odds/bookmakers/fixtures/{fixtureId} By Fixture ID
bookmakersMappingByFixtureId() GET /{version}/odds/bookmakers/fixtures/{fixtureId}/mapping Mapping by Fixture ID
bookmakersSearch() GET /{version}/odds/bookmakers/search/{name} Search
fixturesUpcomingByMarketId() GET /{version}/{sport}/fixtures/upcoming/markets/{marketId} Upcoming Fixtures by Market ID
marketById() GET /{version}/odds/markets/{marketId} By ID
marketsAll() GET /{version}/odds/markets All
marketsSearch() GET /{version}/odds/markets/search/{name} Search

bookmakerById()

bookmakerById($bookmaker_id, $version): \Sportmonks\Model\OddsBookmakerByIdResponse

By ID

Example

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

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

$bookmaker_id = 1; // The ID of the bookmaker you want to retrieve.
$version = "v3"; // The version of the API.

try {
    $result = $sportmonks->odds->bookmakerById(
        bookmaker_id: $bookmaker_id, 
        version: $version
    );
    print_r($result->$getData());
    print_r($result->$getSubscription());
    print_r($result->$getRateLimit());
    print_r($result->$getTimezone());
} catch (\Exception $e) {
    echo 'Exception when calling OddsApi->bookmakerById: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
bookmaker_id int The ID of the bookmaker you want to retrieve.
version string The version of the API. [optional]

Return type

\Sportmonks\Model\OddsBookmakerByIdResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

bookmakersAll()

bookmakersAll($version): \Sportmonks\Model\OddsBookmakersAllResponse

All

Example

<?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->odds->bookmakersAll(
        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 OddsApi->bookmakersAll: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
version string The version of the API. [optional]

Return type

\Sportmonks\Model\OddsBookmakersAllResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

bookmakersByFixtureId()

bookmakersByFixtureId($fixture_id, $version): \Sportmonks\Model\OddsBookmakersByFixtureIdResponse

By Fixture ID

Example

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

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

$fixture_id = 18528479; // The ID of the bookmaker you want to retrieve.
$version = "v3"; // The version of the API.

try {
    $result = $sportmonks->odds->bookmakersByFixtureId(
        fixture_id: $fixture_id, 
        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 OddsApi->bookmakersByFixtureId: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
fixture_id int The ID of the bookmaker you want to retrieve.
version string The version of the API. [optional]

Return type

\Sportmonks\Model\OddsBookmakersByFixtureIdResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

bookmakersMappingByFixtureId()

bookmakersMappingByFixtureId($fixture_id, $version): \Sportmonks\Model\OddsBookmakersMappingByFixtureIdResponse

Mapping by Fixture ID

Example

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

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

$fixture_id = 18528479; // The fixtureId you want to retrieve the bookmaker mapping from.
$version = "v3"; // The version of the API.

try {
    $result = $sportmonks->odds->bookmakersMappingByFixtureId(
        fixture_id: $fixture_id, 
        version: $version
    );
    print_r($result->$getData());
    print_r($result->$getSubscription());
    print_r($result->$getRateLimit());
    print_r($result->$getTimezone());
} catch (\Exception $e) {
    echo 'Exception when calling OddsApi->bookmakersMappingByFixtureId: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
fixture_id int The fixtureId you want to retrieve the bookmaker mapping from.
version string The version of the API. [optional]

Return type

\Sportmonks\Model\OddsBookmakersMappingByFixtureIdResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

bookmakersSearch()

bookmakersSearch($name, $version): \Sportmonks\Model\OddsBookmakersSearchResponse

Search

Example

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

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

$name = "Bet"; // The name you want to search on
$version = "v3"; // The version of the API.

try {
    $result = $sportmonks->odds->bookmakersSearch(
        name: $name, 
        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 OddsApi->bookmakersSearch: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
name string The name you want to search on
version string The version of the API. [optional]

Return type

\Sportmonks\Model\OddsBookmakersSearchResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

fixturesUpcomingByMarketId()

fixturesUpcomingByMarketId($market_id, $version, $sport): \Sportmonks\Model\OddsFixturesUpcomingByMarketIdResponse

Upcoming Fixtures by Market ID

Example

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

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

$market_id = 1; // The ID of the market you want to retrieve upcoming fixtures from.
$version = "v3"; // The sport you want to retrieve upcoming fixtures from.
$sport = "football";

try {
    $result = $sportmonks->odds->fixturesUpcomingByMarketId(
        market_id: $market_id, 
        version: $version, 
        sport: $sport
    );
    print_r($result->$getData());
    print_r($result->$getMessage());
    print_r($result->$getSubscription());
    print_r($result->$getRateLimit());
    print_r($result->$getTimezone());
} catch (\Exception $e) {
    echo 'Exception when calling OddsApi->fixturesUpcomingByMarketId: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
market_id int The ID of the market you want to retrieve upcoming fixtures from.
version string The sport you want to retrieve upcoming fixtures from. [optional]
sport string [optional]

Return type

\Sportmonks\Model\OddsFixturesUpcomingByMarketIdResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

marketById()

marketById($market_id, $version): \Sportmonks\Model\OddsMarketByIdResponse

By ID

Example

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

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

$market_id = 1; // The ID of the market you want to retrieve.
$version = "v3"; // The version of the API.

try {
    $result = $sportmonks->odds->marketById(
        market_id: $market_id, 
        version: $version
    );
    print_r($result->$getData());
    print_r($result->$getSubscription());
    print_r($result->$getRateLimit());
    print_r($result->$getTimezone());
} catch (\Exception $e) {
    echo 'Exception when calling OddsApi->marketById: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
market_id int The ID of the market you want to retrieve.
version string The version of the API. [optional]

Return type

\Sportmonks\Model\OddsMarketByIdResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

marketsAll()

marketsAll($version): \Sportmonks\Model\OddsMarketsAllResponse

All

Example

<?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->odds->marketsAll(
        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 OddsApi->marketsAll: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
version string The version of the API. [optional]

Return type

\Sportmonks\Model\OddsMarketsAllResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

marketsSearch()

marketsSearch($name, $version): \Sportmonks\Model\OddsMarketsSearchResponse

Search

Example

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

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

$name = "Over"; // The name you want to search on
$version = "v3"; // The version of the API.

try {
    $result = $sportmonks->odds->marketsSearch(
        name: $name, 
        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 OddsApi->marketsSearch: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
name string The name you want to search on
version string The version of the API. [optional]

Return type

\Sportmonks\Model\OddsMarketsSearchResponse

Authorization

apikeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]