Files
plexpy/docs/sdks/statistics

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

with PlexAPI(
    access_token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.statistics.get_statistics(timespan=4)

    assert res.object is not None

    # Handle response
    print(res.object)

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

with PlexAPI(
    access_token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.statistics.get_resources_statistics(timespan=4)

    assert res.object is not None

    # Handle response
    print(res.object)

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

with PlexAPI(
    access_token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.statistics.get_bandwidth_statistics(timespan=4)

    assert res.object is not None

    # Handle response
    print(res.object)

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 */*