mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 12:37:46 +00:00
Statistics
(Statistics)
Overview
API Calls that perform operations with Plex Media Server Statistics
Available Operations
- GetStatistics - Get Media Statistics
- GetResourcesStatistics - Get Resources Statistics
- GetBandwidthStatistics - Get Bandwidth Statistics
GetStatistics
This will return the media statistics for the server
Example Usage
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
);
var res = await sdk.Statistics.GetStatisticsAsync(timespan: 4);
// handle response
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Timespan |
long | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
Response
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| LukeHagar.PlexAPI.SDK.Models.Errors.GetStatisticsResponseBody | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetStatisticsStatisticsResponseBody | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | / |
GetResourcesStatistics
This will return the resources for the server
Example Usage
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
);
var res = await sdk.Statistics.GetResourcesStatisticsAsync(timespan: 4);
// handle response
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Timespan |
long | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
Response
GetResourcesStatisticsResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| LukeHagar.PlexAPI.SDK.Models.Errors.GetResourcesStatisticsResponseBody | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetResourcesStatisticsStatisticsResponseBody | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | / |
GetBandwidthStatistics
This will return the bandwidth statistics for the server
Example Usage
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
);
var res = await sdk.Statistics.GetBandwidthStatisticsAsync(timespan: 4);
// handle response
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Timespan |
long | ➖ | The timespan to retrieve statistics for the exact meaning of this parameter is not known |
4 |
Response
GetBandwidthStatisticsResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| LukeHagar.PlexAPI.SDK.Models.Errors.GetBandwidthStatisticsResponseBody | 400 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.GetBandwidthStatisticsStatisticsResponseBody | 401 | application/json |
| LukeHagar.PlexAPI.SDK.Models.Errors.SDKException | 4xx-5xx | / |