mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-06 04:20:52 +00:00
9.5 KiB
9.5 KiB
Statistics
(statistics)
Overview
API Calls that perform operations with Plex Media Server Statistics
Available Operations
- get_statistics - Get Media Statistics
- get_resources_statistics - Get Resources Statistics
- get_bandwidth_statistics - Get Bandwidth Statistics
get_statistics
This will return the media statistics for the server
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.statistics.get_statistics(timespan=4)
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
timespan |
Optional[int] | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetStatisticsResponse
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GetStatisticsBadRequest | 400 | application/json |
| errors.GetStatisticsUnauthorized | 401 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
get_resources_statistics
This will return the resources for the server
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.statistics.get_resources_statistics(timespan=4)
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
timespan |
Optional[int] | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetResourcesStatisticsResponse
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GetResourcesStatisticsBadRequest | 400 | application/json |
| errors.GetResourcesStatisticsUnauthorized | 401 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
get_bandwidth_statistics
This will return the bandwidth statistics for the server
Example Usage
from plex_api_client import PlexAPI
s = PlexAPI(
access_token="<YOUR_API_KEY_HERE>",
client_id="3381b62b-9ab7-4e37-827b-203e9809eb58",
client_name="Plex for Roku",
client_version="2.4.1",
platform="Roku",
device_nickname="Roku 3",
)
res = s.statistics.get_bandwidth_statistics(timespan=4)
if res.object is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
timespan |
Optional[int] | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Response
operations.GetBandwidthStatisticsResponse
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GetBandwidthStatisticsBadRequest | 400 | application/json |
| errors.GetBandwidthStatisticsUnauthorized | 401 | application/json |
| errors.SDKError | 4XX, 5XX | */* |