All URIs are relative to https://api.sportmonks.com, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
all() | GET /{version}/core/countries | All |
getById() | GET /{version}/core/countries/{countryId} | By ID |
search() | GET /{version}/core/countries/search/{name} | Search |
all($version): \Sportmonks\Model\CountriesAllResponse
All
<?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->countries->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 CountriesApi->all: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
version | string | The version of the API. | [optional] |
\Sportmonks\Model\CountriesAllResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getById($country_id, $version): \Sportmonks\Model\CountriesGetByIdResponse
By ID
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$sportmonks = new \Sportmonks\Client(
version: "v3",
sport: "football",
apiKey: "AUTHORIZATION",
);
$country_id = 1161; // The ID of the country you want to retrieve.
$version = "v3"; // The version of the API.
try {
$result = $sportmonks->countries->getById(
country_id: $country_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 CountriesApi->getById: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
country_id | int | The ID of the country you want to retrieve. | |
version | string | The version of the API. | [optional] |
\Sportmonks\Model\CountriesGetByIdResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
search($name, $version): \Sportmonks\Model\CountriesSearchResponse
Search
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$sportmonks = new \Sportmonks\Client(
version: "v3",
sport: "football",
apiKey: "AUTHORIZATION",
);
$name = "Fra"; // The name you want to search on
$version = "v3"; // The version of the API.
try {
$result = $sportmonks->countries->search(
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 CountriesApi->search: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
name | string | The name you want to search on | |
version | string | The version of the API. | [optional] |
\Sportmonks\Model\CountriesSearchResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]