BytesFlows Docs

Traffic Query API

Query account available traffic, used traffic, and traffic usage records.

Traffic Query API

This document describes how to query your account's traffic status and historical usage records.

1. Query Account Traffic Overview

Used to retrieve the account's available traffic, used traffic, and total quota.

Endpoint Information

  • URL: /api/v1/dashboard/asset
  • Method: GET
  • Authentication: Requires Authorization: Bearer <Your-Token> in the Header or authentication via Cookies.

Response Example

{
  "code": 200,
  "msg": "success",
  "data": {
    "totalTraffic": 188978561024,
    "dynamicTraffic": 188944515072,
    "balance": 0.00,
    "currency": "USD"
  }
}

Response Parameters

ParameterTypeDescription
totalTrafficnumberTotal traffic quota (Unit: Byte)
dynamicTrafficnumberCurrent available traffic (Unit: Byte)
balancenumberAccount balance
currencystringCurrency unit

[!TIP] Traffic Used is calculated as: totalTraffic - dynamicTraffic.


2. Query Traffic Usage Records

Query the history of traffic acquired by the account, with support for pagination and type filtering.

Endpoint Information

  • URL: /api/v1/user/traffic/records
  • Method: GET
  • Authentication: Requires Authorization: Bearer <Your-Token>.

Request Parameters (Query)

ParameterTypeRequiredDescription
pageNonumberNoPage number, default is 1
pageSizenumberNoNumber of items per page, default is 10
sourceTypestringNoFilter type: order (purchase records), sign (check-in rewards)

Response Example

{
  "code": 200,
  "msg": "success",
  "data": {
    "records": [
      {
        "id": "123456",
        "orderId": "ORD-7890",
        "sourceType": "order",
        "traffic": 1073741824,
        "trafficUsed": 524288,
        "createTime": "2026-02-21 20:00:00",
        "expireTime": "2026-03-21 20:00:00",
        "status": 1
      }
    ],
    "total": 1
  }
}

Response Parameters (Record Object)

ParameterTypeDescription
orderIdstringOrder ID or Task ID
trafficnumberTotal quota for this record (Unit: Byte)
trafficUsednumberTraffic consumed for this record (Unit: Byte)
sourceTypestringSource: order for purchase, sign for check-in
statusnumberStatus: 1 for Active, 0 for Expired/Invalid
createTimestringCreation time
expireTimestringExpiration time

On this page