Meters

February 25, 2026 ยท View on GitHub

(meters)

Overview

Available Operations

list

List meters.

Scopes: meters:read meters:write

Example Usage

from polar_sdk import Polar


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.meters.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", page=1, limit=10)

    while res is not None:
        # Handle items

        res = res.next()

Parameters

ParameterTypeRequiredDescription
organization_idOptionalNullable[models.MetersListQueryParamOrganizationIDFilter]:heavy_minus_sign:Filter by organization ID.
queryOptionalNullable[str]:heavy_minus_sign:Filter by name.
is_archivedOptionalNullable[bool]:heavy_minus_sign:Filter on archived meters.
pageOptional[int]:heavy_minus_sign:Page number, defaults to 1.
limitOptional[int]:heavy_minus_sign:Size of a page, defaults to 10. Maximum is 100.
sortingList[models.MeterSortProperty]:heavy_minus_sign:Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.
metadataDict[str, models.MetadataQuery]:heavy_minus_sign:Filter by metadata key-value pairs. It uses the deepObject style, e.g. ?metadata[key]=value.
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.MetersListResponse

Errors

Error TypeStatus CodeContent Type
models.HTTPValidationError422application/json
models.SDKError4XX, 5XX*/*

create

Create a meter.

Scopes: meters:write

Example Usage

import polar_sdk
from polar_sdk import Polar


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.meters.create(request={
        "name": "<value>",
        "filter_": {
            "conjunction": polar_sdk.FilterConjunction.OR,
            "clauses": [
                {
                    "property": "<value>",
                    "operator": polar_sdk.FilterOperator.NE,
                    "value": "<value>",
                },
            ],
        },
        "aggregation": {
            "func": polar_sdk.Func.SUM,
            "property": "<value>",
        },
        "organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
    })

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
requestmodels.MeterCreate:heavy_check_mark:The request object to use for the request.
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.Meter

Errors

Error TypeStatus CodeContent Type
models.HTTPValidationError422application/json
models.SDKError4XX, 5XX*/*

get

Get a meter by ID.

Scopes: meters:read meters:write

Example Usage

from polar_sdk import Polar


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.meters.get(id="<value>")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
idstr:heavy_check_mark:The meter ID.
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.Meter

Errors

Error TypeStatus CodeContent Type
models.ResourceNotFound404application/json
models.HTTPValidationError422application/json
models.SDKError4XX, 5XX*/*

update

Update a meter.

Scopes: meters:write

Example Usage

from polar_sdk import Polar


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.meters.update(id="<value>", meter_update={})

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
idstr:heavy_check_mark:The meter ID.
meter_updatemodels.MeterUpdate:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.Meter

Errors

Error TypeStatus CodeContent Type
models.ResourceNotFound404application/json
models.HTTPValidationError422application/json
models.SDKError4XX, 5XX*/*

quantities

Get quantities of a meter over a time period.

Scopes: meters:read meters:write

Example Usage

import polar_sdk
from polar_sdk import Polar
from polar_sdk.utils import parse_datetime


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.meters.quantities(id="<value>", start_timestamp=parse_datetime("2025-11-25T04:37:16.823Z"), end_timestamp=parse_datetime("2025-11-26T17:06:00.727Z"), interval=polar_sdk.TimeInterval.DAY, timezone="UTC")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
idstr:heavy_check_mark:The meter ID.
start_timestampdate:heavy_check_mark:Start timestamp.
end_timestampdate:heavy_check_mark:End timestamp.
intervalmodels.TimeInterval:heavy_check_mark:Interval between two timestamps.
timezoneOptional[str]:heavy_minus_sign:Timezone to use for the timestamps. Default is UTC.
customer_idOptionalNullable[models.MetersQuantitiesQueryParamCustomerIDFilter]:heavy_minus_sign:Filter by customer ID.
external_customer_idOptionalNullable[models.MetersQuantitiesQueryParamExternalCustomerIDFilter]:heavy_minus_sign:Filter by external customer ID.
customer_aggregation_functionOptionalNullable[models.AggregationFunction]:heavy_minus_sign:If set, will first compute the quantities per customer before aggregating them using the given function. If not set, the quantities will be aggregated across all events.
metadataDict[str, models.MetadataQuery]:heavy_minus_sign:Filter by metadata key-value pairs. It uses the deepObject style, e.g. ?metadata[key]=value.
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.MeterQuantities

Errors

Error TypeStatus CodeContent Type
models.ResourceNotFound404application/json
models.HTTPValidationError422application/json
models.SDKError4XX, 5XX*/*