Skip to content

Analytics

SDK Reference · Resource

Analytics

Inspect proxy traffic, connections, domains, errors, and data transactions.

method

getTransactions()

List data transactions

Returns data allocation and consumption transactions visible to the caller. Sender and recipient filters are restricted to the caller's scope.

Signature

Promiseclient.analytics.getTransactions(options: AnalyticsGetTransactionsOptions): Promise<AnalyticsGetTransactionsResponse>

Parameters

NameTypeRequirementDescription
endstringOptionalExclusive end of the reporting window. Defaults to the current time. Accepts ISO 8601 datetime strings with or without a timezone offset (including Z and fractional seconds), YYYY-MM-DD HH:MM:SS, DD-MM-YYYY HH:MM:SS, YYYY-MM-DD, DD-MM-YYYY, or a Unix timestamp in seconds (including fractional seconds, not milliseconds). Datetime strings without an offset and date-only strings use the requested timezone; explicit offsets are converted to that timezone. Date-only values start at midnight. Seconds and fractional seconds are discarded, rounding the reporting boundary down to the minute. Prefer ISO 8601 with an explicit offset for unambiguous timezone handling.
idstringRequiredRoute identifier for this analytics action. Use query parameters to filter transactions.
limitnumberOptionalMaximum records returned on this page.
offsetnumberOptionalZero-based number of matching records to skip.
recipientIdstringOptionalRestrict transactions to this recipient account.
senderIdstringOptionalRestrict transactions to this sender account.
startstringOptionalInclusive start of the reporting window. Defaults to a recent window. Accepts ISO 8601 datetime strings with or without a timezone offset (including Z and fractional seconds), YYYY-MM-DD HH:MM:SS, DD-MM-YYYY HH:MM:SS, YYYY-MM-DD, DD-MM-YYYY, or a Unix timestamp in seconds (including fractional seconds, not milliseconds). Datetime strings without an offset and date-only strings use the requested timezone; explicit offsets are converted to that timezone. Date-only values start at midnight. Seconds and fractional seconds are discarded, rounding the reporting boundary down to the minute. Prefer ISO 8601 with an explicit offset for unambiguous timezone handling.
timezonestringOptionalIANA timezone used for bucket boundaries and datetime strings without an offset. Missing, empty or unknown names use the deployment timezone (UTC by default).
typenumberOptionalTransaction type identifier. Defaults to data transactions.
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.analytics.getTransactions({
id: "550e8400-e29b-41d4-a716-446655440000"
});

Returns

TransactionsResponse

The operation completed successfully.

typeTransactionsResponse7fields
count
number
Required
—
next
string
Required
—
previous
string
Required
—
timezone
string
Required
—
start
string
Required
—
end
string
Required
—
results
TransactionRecord[]
Required
—
typeTransactionRecord8fields
sender_uuid
string
Required
—
recipient_uuid
string
Required
—
type
number
Required
—
amount
number
Required
—
package_uuid
string
Required
—
details
string
Required
—
date
string
Required
—
timestamp
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: "not_found"The requested resource does not exist.
  • kind: "server"ProxyRequest could not complete the 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.analytics.getTransactionsWithResponse(options): Promise<ApiResponse<AnalyticsGetTransactionsResponse>>

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

method

getConnections()

List active proxy connections

Returns a paginated snapshot of active connections for the selected user and package scope.

Signature

Promiseclient.analytics.getConnections(options: AnalyticsGetConnectionsOptions = {}): Promise<AnalyticsGetConnectionsResponse>

Parameters

NameTypeRequirementDescription
limitnumberOptionalMaximum records returned on this page.
offsetnumberOptionalZero-based number of matching records to skip.
packageIdstringOptionalRestrict results to one purchased package.
userIdstringOptionalRestrict results to the current account or an accessible sub-user.
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.analytics.getConnections();

Returns

ConnectionsResponse

The operation completed successfully.

typeConnectionsResponse4fields
count
number
Required
—
next
string
Required
—
previous
string
Required
—
results
ConnectionRecord[]
Required
—
typeConnectionRecord4fields
user_id
string
Required
—
package_id
string
Required
—
connections
number
Required
—
server_ip
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: "server"ProxyRequest could not complete the 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.analytics.getConnectionsWithResponse(options): Promise<ApiResponse<AnalyticsGetConnectionsResponse>>

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

method

listDomains()

List top destination domains

Aggregates request count and transferred bytes by destination hostname for the selected reporting window and account scope.

Signature

Promiseclient.analytics.listDomains(options: AnalyticsListDomainsOptions = {}): Promise<AnalyticsListDomainsResponse>

Parameters

NameTypeRequirementDescription
endstringOptionalExclusive end of the reporting window. Defaults to the current time. Accepts ISO 8601 datetime strings with or without a timezone offset (including Z and fractional seconds), YYYY-MM-DD HH:MM:SS, DD-MM-YYYY HH:MM:SS, YYYY-MM-DD, DD-MM-YYYY, or a Unix timestamp in seconds (including fractional seconds, not milliseconds). Datetime strings without an offset and date-only strings use the requested timezone; explicit offsets are converted to that timezone. Date-only values start at midnight. Seconds and fractional seconds are discarded, rounding the reporting boundary down to the minute. Prefer ISO 8601 with an explicit offset for unambiguous timezone handling.
hostnamestringOptionalComma-separated domains, IPv4/IPv6 addresses or HTTP(S) URLs to include. Surrounding whitespace is ignored. URLs and host:port values are normalized to their hostname; schemes, ports, paths and IPv6 brackets are removed. Use brackets around IPv6 addresses when specifying a port.
includeSubUsersbooleanOptionalAggregate the selected user's data with all of their sub-users. Superusers can apply this to any selected user; resellers can apply it to their own account. Ignored for regular users. Use true or false. Defaults to false.
ledgerIdstringOptionalRestrict results to one data ledger when supported.
limitnumberOptionalMaximum records returned on this page.
offsetnumberOptionalZero-based number of matching records to skip.
orderingstringOptionalSort domains by transferred data or request count.
packageIdstringOptionalRestrict results to one purchased package.
searchstringOptionalCase-insensitive partial match against the listed field: `hostname`.
startstringOptionalInclusive start of the reporting window. Defaults to a recent window. Accepts ISO 8601 datetime strings with or without a timezone offset (including Z and fractional seconds), YYYY-MM-DD HH:MM:SS, DD-MM-YYYY HH:MM:SS, YYYY-MM-DD, DD-MM-YYYY, or a Unix timestamp in seconds (including fractional seconds, not milliseconds). Datetime strings without an offset and date-only strings use the requested timezone; explicit offsets are converted to that timezone. Date-only values start at midnight. Seconds and fractional seconds are discarded, rounding the reporting boundary down to the minute. Prefer ISO 8601 with an explicit offset for unambiguous timezone handling.
timezonestringOptionalIANA timezone used for bucket boundaries and datetime strings without an offset. Missing, empty or unknown names use the deployment timezone (UTC by default).
userIdstringOptionalRestrict results to the current account or an accessible sub-user.
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.analytics.listDomains();

Returns

DomainsResponse

The operation completed successfully.

typeDomainsResponse6fields
next
string
Required
—
previous
string
Required
—
timezone
string
Required
—
start
string
Required
—
end
string
Required
—
results
DomainRecord[]
Required
—
typeDomainRecord3fields
hostname
string
Required
—
requests
number
Required
—
data
number
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: "server"ProxyRequest could not complete the 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.analytics.listDomainsWithResponse(options): Promise<ApiResponse<AnalyticsListDomainsResponse>>

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

method

listFeed()

List proxy request activity

Returns recent proxy requests with traffic, endpoint, location, protocol, package, and sticky-session details.

Signature

Promiseclient.analytics.listFeed(options: AnalyticsListFeedOptions = {}): Promise<AnalyticsListFeedResponse>

Parameters

NameTypeRequirementDescription
citystringOptionalNormalized city targeting code. country and region are required.
countrystringOptionalLowercase ISO 3166-1 alpha-2 country code.
endstringOptionalExclusive end of the reporting window. Defaults to the current time. Accepts ISO 8601 datetime strings with or without a timezone offset (including Z and fractional seconds), YYYY-MM-DD HH:MM:SS, DD-MM-YYYY HH:MM:SS, YYYY-MM-DD, DD-MM-YYYY, or a Unix timestamp in seconds (including fractional seconds, not milliseconds). Datetime strings without an offset and date-only strings use the requested timezone; explicit offsets are converted to that timezone. Date-only values start at midnight. Seconds and fractional seconds are discarded, rounding the reporting boundary down to the minute. Prefer ISO 8601 with an explicit offset for unambiguous timezone handling.
hostnamestringOptionalComma-separated domains, IPv4/IPv6 addresses or HTTP(S) URLs to include. Surrounding whitespace is ignored. URLs and host:port values are normalized to their hostname; schemes, ports, paths and IPv6 brackets are removed. Use brackets around IPv6 addresses when specifying a port.
ledgerIdstringOptionalRestrict results to one data ledger when supported.
limitnumberOptionalMaximum records returned on this page.
offsetnumberOptionalZero-based number of matching records to skip.
packageIdstringOptionalRestrict results to one purchased package.
protocolstringOptionalProxy protocol: http or socks5.
regionstringOptionalNormalized region targeting code. country is required.
searchstringOptionalCase-insensitive partial match against the listed field: `hostname`.
startstringOptionalInclusive start of the reporting window. Defaults to a recent window. Accepts ISO 8601 datetime strings with or without a timezone offset (including Z and fractional seconds), YYYY-MM-DD HH:MM:SS, DD-MM-YYYY HH:MM:SS, YYYY-MM-DD, DD-MM-YYYY, or a Unix timestamp in seconds (including fractional seconds, not milliseconds). Datetime strings without an offset and date-only strings use the requested timezone; explicit offsets are converted to that timezone. Date-only values start at midnight. Seconds and fractional seconds are discarded, rounding the reporting boundary down to the minute. Prefer ISO 8601 with an explicit offset for unambiguous timezone handling.
timezonestringOptionalIANA timezone used for bucket boundaries and datetime strings without an offset. Missing, empty or unknown names use the deployment timezone (UTC by default).
userIdstringOptionalRestrict results to the current account or an accessible sub-user.
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.analytics.listFeed();

Returns

FeedResponse

The operation completed successfully.

typeFeedResponse7fields
count
number
Required
—
next
string
Required
—
previous
string
Required
—
timezone
string
Required
—
start
string
Required
—
end
string
Required
—
results
FeedRecord[]
Required
—
typeFeedRecord20fields
id
string
Required
Exact decimal UInt64 identifier, normalized from the API's JSON number.
established_connections
number
Required
—
reseller_id
string
Required
—
user_id
string
Required
—
package_id
string
Required
—
ledger_id
string
Required
—
username
string
Required
—
user_ip
string
Required
—
server_ip
string
Required
—
data
number
Required
—
hostname
string
Required
—
protocol
string
Required
—
method
string
Required
—
pool
string
Required
—
is_session
boolean
Required
—
country
string
Required
—
region
string
Required
—
city
string
Required
—
asn
string
Required
—
timestamp
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: "server"ProxyRequest could not complete the 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.analytics.listFeedWithResponse(options): Promise<ApiResponse<AnalyticsListFeedResponse>>

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

method

listLogs()

List proxy error logs

Returns request-level proxy errors with server, client, targeting, package, and error-code context.

Signature

Promiseclient.analytics.listLogs(options: AnalyticsListLogsOptions = {}): Promise<AnalyticsListLogsResponse>

Parameters

NameTypeRequirementDescription
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.
citystringOptionalNormalized city targeting code. country and region are required.
countrystringOptionalLowercase ISO 3166-1 alpha-2 country code.
endstringOptionalExclusive end of the reporting window. Defaults to the current time. Accepts ISO 8601 datetime strings with or without a timezone offset (including Z and fractional seconds), YYYY-MM-DD HH:MM:SS, DD-MM-YYYY HH:MM:SS, YYYY-MM-DD, DD-MM-YYYY, or a Unix timestamp in seconds (including fractional seconds, not milliseconds). Datetime strings without an offset and date-only strings use the requested timezone; explicit offsets are converted to that timezone. Date-only values start at midnight. Seconds and fractional seconds are discarded, rounding the reporting boundary down to the minute. Prefer ISO 8601 with an explicit offset for unambiguous timezone handling.
errorCodenumberOptionalRestrict results to one non-negative proxy error code.
hostnamestringOptionalCompatibility parameter; ignored by the server.
ledgerIdstringOptionalRestrict results to one data ledger when supported.
limitnumberOptionalMaximum records returned on this page.
offsetnumberOptionalZero-based number of matching records to skip.
packageIdstringOptionalRestrict results to one purchased package.
protocolstringOptionalProxy protocol: http or socks5.
regionstringOptionalNormalized region targeting code. country is required.
startstringOptionalInclusive start of the reporting window. Defaults to a recent window. Accepts ISO 8601 datetime strings with or without a timezone offset (including Z and fractional seconds), YYYY-MM-DD HH:MM:SS, DD-MM-YYYY HH:MM:SS, YYYY-MM-DD, DD-MM-YYYY, or a Unix timestamp in seconds (including fractional seconds, not milliseconds). Datetime strings without an offset and date-only strings use the requested timezone; explicit offsets are converted to that timezone. Date-only values start at midnight. Seconds and fractional seconds are discarded, rounding the reporting boundary down to the minute. Prefer ISO 8601 with an explicit offset for unambiguous timezone handling.
timezonestringOptionalIANA timezone used for bucket boundaries and datetime strings without an offset. Missing, empty or unknown names use the deployment timezone (UTC by default).
userIdstringOptionalRestrict results to the current account or an accessible sub-user.

Example

const result = await client.analytics.listLogs();

Returns

LogsResponse

The operation completed successfully.

typeLogsResponse7fields
count
number
Required
—
next
string
Required
—
previous
string
Required
—
timezone
string
Required
—
start
string
Required
—
end
string
Required
—
results
LogRecord[]
Required
—
typeLogRecord22fields
id
number
Required
—
server_ip
string
Required
—
user_ip
string
Required
—
protocol
string
Required
—
method
string
Required
—
user_id
string
Required
—
reseller_id
string
Required
—
username
string
Required
—
hostname
string
Required
—
status_code
number
Required
—
error_code
number
Required
—
error_message
string
Required
—
country
string
Required
—
region
string
Required
—
city
string
Required
—
asn
string
Required
—
level
string
Required
—
is_session
boolean
Required
—
timestamp
string
Required
—
package_id
string
Optional
—
package_alias
string
Optional
—
ledger_id
string
Optional
—

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: "server"ProxyRequest could not complete the 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.analytics.listLogsWithResponse(options): Promise<ApiResponse<AnalyticsListLogsResponse>>

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

method

getOverall()

Get traffic totals over time

Returns transferred bytes and request counts grouped into time buckets for charts and usage reporting.

Signature

Promiseclient.analytics.getOverall(options: AnalyticsGetOverallOptions = {}): Promise<AnalyticsGetOverallResponse>

Parameters

NameTypeRequirementDescription
endstringOptionalExclusive end of the reporting window. Defaults to the current time. Accepts ISO 8601 datetime strings with or without a timezone offset (including Z and fractional seconds), YYYY-MM-DD HH:MM:SS, DD-MM-YYYY HH:MM:SS, YYYY-MM-DD, DD-MM-YYYY, or a Unix timestamp in seconds (including fractional seconds, not milliseconds). Datetime strings without an offset and date-only strings use the requested timezone; explicit offsets are converted to that timezone. Date-only values start at midnight. Seconds and fractional seconds are discarded, rounding the reporting boundary down to the minute. Prefer ISO 8601 with an explicit offset for unambiguous timezone handling.
includeSubUsersbooleanOptionalAggregate the selected user's data with all of their sub-users. Superusers can apply this to any selected user; resellers can apply it to their own account. Ignored for regular users. Use true or false. Defaults to false.
limitnumberOptionalMaximum records returned on this page.
offsetnumberOptionalZero-based number of matching records to skip.
packageIdstringOptionalRestrict results to one purchased package.
startstringOptionalInclusive start of the reporting window. Defaults to a recent window. Accepts ISO 8601 datetime strings with or without a timezone offset (including Z and fractional seconds), YYYY-MM-DD HH:MM:SS, DD-MM-YYYY HH:MM:SS, YYYY-MM-DD, DD-MM-YYYY, or a Unix timestamp in seconds (including fractional seconds, not milliseconds). Datetime strings without an offset and date-only strings use the requested timezone; explicit offsets are converted to that timezone. Date-only values start at midnight. Seconds and fractional seconds are discarded, rounding the reporting boundary down to the minute. Prefer ISO 8601 with an explicit offset for unambiguous timezone handling.
timezonestringOptionalIANA timezone used for bucket boundaries and datetime strings without an offset. Missing, empty or unknown names use the deployment timezone (UTC by default).
userIdstringOptionalRestrict results to the current account or an accessible sub-user.
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.analytics.getOverall();

Returns

OverallResponse

The operation completed successfully.

typeOverallResponse7fields
count
number
Required
—
next
string
Required
—
previous
string
Required
—
timezone
string
Required
—
start
string
Required
—
end
string
Required
—
results
OverallPoint[]
Required
—
typeOverallPoint3fields
data
number
Required
—
requests
number
Required
—
timestamp
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: "server"ProxyRequest could not complete the 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.analytics.getOverallWithResponse(options): Promise<ApiResponse<AnalyticsGetOverallResponse>>

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