On this page

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

    title: Provider Last N short_name: Provider Last N description: Get statistics for a specific provider over the last N hours.

    Provider Last N

    This endpoint retrieves detailed statistics for a specific provider device (identified by client_id) over a specified lookback period (N hours).


    POST /stats/provider-last-n

    Get statistics for a specific provider over the last N hours.

    Request

    POST /stats/provider-last-n

    Headers:

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

    Body:

    {
      "client_id": "string",
      "last_n": 24
    }

    Fields

    FieldTypeDescription
    client_idstringRequired. The unique UDID of the provider device.
    last_nnumberRequired. The number of hours to look back (e.g., 24).

    Response

    200 Success

    Status: 200 OK

    Content-Type: application/json

    {
      "lookback": 24,
      "created_time": "2025-01-20T12:00:00Z",
      "uptime": {
        "2025-01-20-12": 60
      },
      "transfer_data": {
        "2025-01-20": 1.5
      },
      "payout": {
        "2025-01-20": 0.5
      },
      "search_interest": {
        "2025-01-20": 100
      },
      "contracts": {
        "2025-01-20": 5
      },
      "clients": {
        "2025-01-20": 3
      },
      "client_details": [
        {
          "client_id": "string",
          "transfer_data": {
            "2025-01-20": 0.5
          }
        }
      ]
    }

    Fields

    FieldTypeDescription
    lookbacknumberThe lookback period in hours as confirmed by the server.
    created_timestringISO 8601 timestamp of when this report was generated.
    uptimeobjectTotal online minutes indexed by hour (yyyy-mm-dd-hh).
    transfer_dataobjectTotal data provided in GiB indexed by date (yyyy-mm-dd).
    payoutobjectEstimated earnings in USDC indexed by date (yyyy-mm-dd).
    search_interestobjectCount of matching searches indexed by date (yyyy-mm-dd).
    contractsobjectCount of unique contracts indexed by date (yyyy-mm-dd).
    clientsobjectCount of distinct clients indexed by date (yyyy-mm-dd).
    client_detailsarrayGranular breakdown of transfer data for specific consumers.

    Example

    HTTP Request

    POST /stats/provider-last-n HTTP/1.1
    Host: api.bringyour.com
    Content-Type: application/json
    Authorization: Bearer YOUR_JWT_TOKEN
     
    {
      "client_id": "c73040c1-0000-0000-0000-000000000000",
      "last_n": 24
    }

    Successful HTTP Response

    {
      "lookback": 24,
      "created_time": "2025-01-20T12:30:00Z",
      "transfer_data": {
        "2025-01-20": 1.25
      },
      "payout": {
        "2025-01-20": 0.12
      }
    }


    Powered by Sudoc v2.5.0
    Hide table of contents