(metrics)
- get - Get Metrics
- limits - Get Metrics Limits
Get metrics about your orders and subscriptions.
import dateutil.parser
import polar_sdk
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.metrics.get(start_date=dateutil.parser.parse("2024-02-07").date(), end_date=dateutil.parser.parse("2022-04-09").date(), interval=polar_sdk.Interval.WEEK)
# Handle response
print(res)
models.MetricsResponse
Error Type |
Status Code |
Content Type |
models.HTTPValidationError |
422 |
application/json |
models.SDKError |
4XX, 5XX |
*/* |
Get the interval limits for the metrics endpoint.
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.metrics.limits()
# Handle response
print(res)
Parameter |
Type |
Required |
Description |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.MetricsLimits
Error Type |
Status Code |
Content Type |
models.SDKError |
4XX, 5XX |
*/* |