On this page

    1. Home
    2. API
    3. API Reference
    4. Stats
    5. Providers Last N

    Providers Last N

    This endpoint retrieves performance and event statistics for all provider devices in your network over a custom lookback window (N hours).


    POST /stats/providers-last-n

    Retrieves a detailed report of provider activity, including connectivity events and transfer volumes for a specific number of hours.

    Request

    POST /stats/providers-last-n

    Headers:

    {
      "Host": "api.bringyour.com",
      "Authorization": "Bearer YOUR_JWT_TOKEN",
      "Content-Type": "application/json"
    }

    Body:

    {
      "last_n": 12
    }

    Fields

    FieldTypeDescription
    last_nnumberThe number of hours to look back (e.g., 6, 12, 48).

    Response

    200 Success

    Status: 200 OK

    Content-Type: application/json

    {
      "created_time": "2025-01-20T15:00:00Z",
      "providers": [
        {
          "client_id": "string",
          "connected": true,
          "connected_events_last_24h": [],
          "uptime_last_24h": 0,
          "transfer_data_last_24h": 0,
          "payout_last_24h": 0,
          "provide_mode": 0
        }
      ]
    }

    Fields

    FieldTypeDescription
    created_timestringISO 8601 timestamp of when the report was generated.
    providersarrayList of provider devices and their stats for the period.
    providers[].client_idstringUnique identifier for the provider.
    providers[].connectedbooleanCurrent connection status.
    providers[].uptime_last_24hnumberHours online during the lookback period.
    providers[].transfer_data_last_24hnumberGiB provided during the period.
    providers[].payout_last_24hnumberEstimated USDC earned.

    Example

    HTTP Request

    POST /stats/providers-last-n HTTP/1.1
    Host: api.bringyour.com
    Authorization: Bearer YOUR_JWT_TOKEN
    Content-Type: application/json
     
    {
      "last_n": 6
    }

    Successful HTTP Response

    {
      "created_time": "2025-01-20T16:00:00Z",
      "providers": [
        {
          "client_id": "c73040c1-0000-0000-0000-000000000000",
          "connected": true,
          "uptime_last_24h": 5.8,
          "transfer_data_last_24h": 2.1,
          "payout_last_24h": 0.21,
          "provide_mode": 2
        }
      ]
    }


    Powered by Sudoc v2.5.0
    Hide table of contents