> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hypermid.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Partner Stats

> Retrieve partner volume and transaction statistics

Returns aggregated statistics for your partner account, including total volume, transaction counts, and revenue metrics.

<ParamField query="period" type="string">
  Time period for stats: `24h`, `7d`, `30d`, `90d`, `all`. Default: `30d`.
</ParamField>

<ParamField query="groupBy" type="string">
  Group results by: `day`, `week`, `month`. Default: `day`.
</ParamField>

<ResponseExample>
  ```json 200 theme={"system"}
  {
    "data": {
      "period": "30d",
      "totalVolumeUSD": "1250000.00",
      "totalTransactions": 4523,
      "successfulTransactions": 4401,
      "failedTransactions": 122,
      "successRate": 97.3,
      "totalFeesEarnedUSD": "1875.00",
      "averageTransactionUSD": "276.32",
      "topChains": [
        { "chainId": 1, "name": "Ethereum", "volumeUSD": "450000.00", "count": 1200 },
        { "chainId": 42161, "name": "Arbitrum", "volumeUSD": "320000.00", "count": 1100 },
        { "chainId": 137, "name": "Polygon", "volumeUSD": "180000.00", "count": 850 }
      ],
      "dailyStats": [
        {
          "date": "2024-03-25",
          "volumeUSD": "42000.00",
          "transactions": 156,
          "feesEarnedUSD": "63.00"
        },
        {
          "date": "2024-03-24",
          "volumeUSD": "38500.00",
          "transactions": 142,
          "feesEarnedUSD": "57.75"
        }
      ]
    },
    "error": null,
    "meta": {
      "requestId": "x4a5b6c7-d8e9-0123-7890-234567890123",
      "timestamp": 1711234582,
      "rateLimit": {
        "limit": 2000,
        "remaining": 1976,
        "reset": 1711234627
      }
    }
  }
  ```
</ResponseExample>

<CodeGroup>
  ```typescript TypeScript theme={"system"}
  const stats = await client.getPartnerStats({ period: "30d" });

  console.log("Total volume:", stats.data.totalVolumeUSD, "USD");
  console.log("Transactions:", stats.data.totalTransactions);
  console.log("Success rate:", stats.data.successRate, "%");
  console.log("Fees earned:", stats.data.totalFeesEarnedUSD, "USD");
  ```

  ```bash cURL theme={"system"}
  curl "https://api.hypermid.io/v1/partner/stats?period=30d" \
    -H "X-API-Key: your-api-key"
  ```

  ```go Go theme={"system"}
  req, _ := http.NewRequest("GET",
      "https://api.hypermid.io/v1/partner/stats?period=30d", nil)
  req.Header.Set("X-API-Key", "your-api-key")
  resp, _ := http.DefaultClient.Do(req)
  ```
</CodeGroup>


## OpenAPI

````yaml GET /v1/partner/stats
openapi: 3.0.3
info:
  title: Hypermid Partner API
  version: 1.0.0
  description: >-
    Cross-chain swap aggregator API. Supports 30+ EVM chains, Solana, Bitcoin,
    Sui, and Near Intents chains (NEAR, TON, Tron, XRP, etc.).


    ## Authentication

    Pass your API key via the `X-API-Key` header. Public endpoints work without
    a key (anonymous tier). Partner endpoints (`/v1/partner/*`) require a valid
    key.


    ## Rate Limits

    - **Anonymous**: 30 requests/minute (per IP)

    - **Partner (authenticated)**: 100 requests/minute (per API key)


    These limits are designed for human-driven widget usage and mirror our
    upstream aggregator (LiFi) limits to prevent any single user from exhausting
    shared quota.


    Rate limit info is returned in `meta.rateLimit` on every response.


    ## Response Envelope

    All responses follow the shape:

    ```json

    { "data": <T | null>, "error": <{ code, message, details? } | null>, "meta":
    { "requestId", "timestamp", "rateLimit?" } }

    ```
  contact:
    name: Hypermid
    url: https://hypermid.io
servers:
  - url: https://api.hypermid.io
    description: Production
security:
  - ApiKeyAuth: []
  - {}
tags:
  - name: Swap
    description: Cross-chain swap quoting, routing, status, and reference data
  - name: Execute
    description: Transaction execution and deposit management for Near Intents swaps
  - name: On-Ramp
    description: Fiat-to-crypto on-ramp via RampNow
  - name: Partner
    description: Partner account, analytics, and webhook management (requires X-API-Key)
  - name: Tracking
    description: Swap event tracking for partner attribution
  - name: System
    description: Health check and API metadata
paths:
  /v1/partner/stats:
    get:
      tags:
        - Partner
      summary: Get partner analytics
      description: >-
        Returns aggregated volume, fee, and transaction stats. Optionally filter
        by date range.
      operationId: getPartnerStats
      parameters:
        - name: from
          in: query
          required: false
          schema:
            type: string
            format: date
          description: Start date (YYYY-MM-DD)
        - name: to
          in: query
          required: false
          schema:
            type: string
            format: date
          description: End date (YYYY-MM-DD)
      responses:
        '200':
          description: Stats data
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/PartnerStats'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        data:
          description: Response payload (null on error)
        error:
          nullable: true
          type: object
          properties:
            code:
              type: string
              example: INVALID_PARAMS
            message:
              type: string
              example: 'Missing required parameters: fromChain'
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - data
        - error
        - meta
    PartnerStats:
      type: object
      properties:
        tx_count:
          type: integer
        completed_count:
          type: integer
        failed_count:
          type: integer
        volume_usd:
          type: number
        fees_earned_usd:
          type: number
        avg_duration_seconds:
          type: integer
        by_chain:
          type: array
          items:
            type: object
        by_provider:
          type: array
          items:
            type: object
    Meta:
      type: object
      properties:
        requestId:
          type: string
          format: uuid
        timestamp:
          type: integer
          description: Unix epoch seconds
        rateLimit:
          type: object
          properties:
            limit:
              type: integer
            remaining:
              type: integer
            reset:
              type: integer
              description: Unix epoch seconds when the window resets
      required:
        - requestId
        - timestamp
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Partner API key. Optional for public endpoints, required for
        /v1/partner/*.

````