mirror of
https://github.com/LukeHagar/plexphp.git
synced 2025-12-06 04:20:51 +00:00
7.9 KiB
7.9 KiB
Statistics
(statistics)
Overview
API Calls that perform operations with Plex Media Server Statistics
Available Operations
- getBandwidthStatistics - Get Bandwidth Statistics
- getResourcesStatistics - Get Resources Statistics
- getStatistics - Get Media Statistics
getBandwidthStatistics
This will return the bandwidth statistics for the server
Example Usage
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->statistics->getBandwidthStatistics(
timespan: 4
);
if ($response->object !== null) {
// handle response
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
timespan |
?int | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
Response
?Operations\GetBandwidthStatisticsResponse
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\GetBandwidthStatisticsBadRequest | 400 | application/json |
| Errors\GetBandwidthStatisticsUnauthorized | 401 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
getResourcesStatistics
This will return the resources for the server
Example Usage
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->statistics->getResourcesStatistics(
timespan: 4
);
if ($response->object !== null) {
// handle response
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
timespan |
?int | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
Response
?Operations\GetResourcesStatisticsResponse
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\GetResourcesStatisticsBadRequest | 400 | application/json |
| Errors\GetResourcesStatisticsUnauthorized | 401 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
getStatistics
This will return the media statistics for the server
Example Usage
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->statistics->getStatistics(
timespan: 4
);
if ($response->object !== null) {
// handle response
}
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
timespan |
?int | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
Response
?Operations\GetStatisticsResponse
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\GetStatisticsBadRequest | 400 | application/json |
| Errors\GetStatisticsUnauthorized | 401 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |