Files
plexpy/docs/sdks/statistics/README.md
2024-09-09 18:08:47 +00:00

9.6 KiB
Raw Blame History

Statistics

(statistics)

Overview

API Calls that perform operations with Plex Media Server Statistics

Available Operations

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>",
    x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)

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 Object Status Code Content Type
errors.GetStatisticsResponseBody 400 application/json
errors.GetStatisticsStatisticsResponseBody 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>",
    x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)

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 Object Status Code Content Type
errors.GetResourcesStatisticsResponseBody 400 application/json
errors.GetResourcesStatisticsStatisticsResponseBody 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>",
    x_plex_client_identifier="gcgzw5rz2xovp84b4vha3a40",
)

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 Object Status Code Content Type
errors.GetBandwidthStatisticsResponseBody 400 application/json
errors.GetBandwidthStatisticsStatisticsResponseBody 401 application/json
errors.SDKError 4xx-5xx /