Skip to content

Providers

SDK Reference · Resource

Providers

Read provider data balances and observation history. Superuser credentials required.

method

listDataBalances()

List provider data balances

Requires a JWT belonging to an active superuser or an API key owned by an active superuser, including requests using X-Impersonate-User. Returns one result per provider with recorded balances. The latest observation by observed_at is the baseline; available_bytes is that observation's balance, not a sum of purchased data. All byte amounts are decimal strings. Calculations are saved asynchronously; inspect freshness, error and calculated_at before using them. History is ordered by creation time descending and limited by PROVIDER_DATA_BALANCE_HISTORY_LIMIT (default 10). Pagination counts providers, not history entries.

Signature

Promiseclient.providers.listDataBalances(options: ProvidersListDataBalancesOptions = {}): Promise<ProvidersListDataBalancesResponse>

Parameters

NameTypeRequirementDescription
limitnumberOptionalNumber of results to return per page.
offsetnumberOptionalThe initial index from which to return the results.
acceptLanguagestringOptionalPreferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English.

Example

const result = await client.providers.listDataBalances();

Returns

PaginatedProviderDataBalanceList

The operation completed successfully.

typePaginatedProviderDataBalanceList4fields
count
number
Required
—
next
string
Optional
—
previous
string
Optional
—
results
ProviderDataBalance[]
Required
—
typeProviderDataBalance13fields
checkpoint_id
string
Required
—
provider_id
string
Required
—
provider_name
string
Required
—
observed_at
string
Required
Time the available balance was observed.
available_bytes
string
Required
Observed balance in bytes, as a decimal string.
used_bytes
string
Required
Calculated usage since the observation, in bytes.
remaining_bytes
string
Required
Remaining bytes at calculated_at, as a decimal string.
remaining_percent
number
Required
—
severity
SeverityEnum | NullEnum
Required
—
enumSeverityEnum0fields

* `warning` - warning * `danger` - danger

No fields.

enumNullEnum0fields

No fields.

freshness
FreshnessEnum
Required
—
enumFreshnessEnum0fields

* `fresh` - fresh * `stale` - stale * `unavailable` - unavailable

No fields.

error
string
Required
—
calculated_at
string
Required
Time of the last successful calculation.
history
ProviderBalanceCheckpoint[]
Required
Latest entries by creation time, limited by PROVIDER_DATA_BALANCE_HISTORY_LIMIT (default 10).
typeProviderBalanceCheckpoint5fields
id
string
Required
—
available_bytes
string
Required
Observed balance in bytes, as a decimal string.
observed_at
string
Required
—
created
string
Required
—
created_by
string
Required
—

Throws

ApiError

Normalized API, transport, and response processing failure.

  • kind: "validation"The request arguments or business rules are invalid.
  • kind: "authentication"Authentication credentials are missing, expired, or invalid.
  • kind: "permission"The authenticated account cannot perform this operation.
  • kind: "network"The request could not reach ProxyRequest.
  • kind: "unexpected"The response could not be decoded or did not match the SDK contract.
Advanced variants
  • client.providers.listDataBalancesWithResponse(options): Promise<ApiResponse<ProvidersListDataBalancesResponse>>

    Returns response status, headers, ETag and idempotency metadata with the decoded data.