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

# get_wallet_counterparties_analysis

> Counterparty analysis: most-interacted + top inflow/outflow addresses for a wallet.

## Reading the result

The response example uses made-up values and shows selected fields. Fields vary by network and available data.

* `most_interacted`, `top_inflow_senders`, and `top_outflow_receivers` each contain a counterparties result, ranked by interaction count, inbound USD volume, or outbound USD volume.

* Each group contains up to five counterparties. The same address can appear in more than one group.

* Check each group's `metadata` for `tx_derived` and `tx_note` when the analysis uses a recent transaction sample.


## OpenAPI

````yaml POST /api/tools/get_wallet_counterparties_analysis
openapi: 3.0.3
info:
  title: Nikiwa Tools API
  version: 1.0.0
  description: >-
    Curated blockchain, token, and DeFi market-data tools over authenticated
    HTTP/JSON. Authenticate with a developer key (`nkw_live_...`) carrying the
    `api:call` scope as `Authorization: Bearer <key>`. Each tool is a `POST
    /api/tools/<name>` whose JSON body is the tool's arguments.
servers:
  - url: https://pro-api.nikiwa.com
security:
  - bearerAuth: []
paths:
  /api/tools/get_wallet_counterparties_analysis:
    post:
      tags:
        - Tools API
      summary: get_wallet_counterparties_analysis
      description: >-
        Counterparty analysis: most-interacted + top inflow/outflow addresses
        for a wallet.
      operationId: invoke_get_wallet_counterparties_analysis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                  description: Wallet address to analyze on the selected network.
                network:
                  type: string
                  description: >-
                    Network to query, for example ethereum. See Supported
                    Networks for coverage.
                from_date:
                  type: string
                  description: >-
                    Start of the requested date range, in YYYY-MM-DD format.
                    Omit to use the default date range.
                to_date:
                  type: string
                  description: >-
                    End of the requested date range, in YYYY-MM-DD format. Omit
                    to use the default date range.
              required:
                - address
                - network
      responses:
        '200':
          description: >-
            Counterparty analysis: most-interacted + top inflow/outflow
            addresses for a wallet. Fields vary by network and available data.
            Check for `status: no_data`, `status: error`, or an `error` field
            even when HTTP status is 200. See [Errors &
            status](/api-reference/errors).
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                description: >-
                  Response fields depend on the network and available data. The
                  example shows selected fields; see Reading the result for
                  details.
              examples:
                illustrative:
                  summary: Illustrative response (selected fields)
                  description: >-
                    Made-up values showing the response structure. Not a live
                    result. Additional fields may be returned.
                  value:
                    type: counterparties_analysis
                    wallet_address: '0x1111111111111111111111111111111111111111'
                    chain: ethereum
                    most_interacted:
                      type: counterparties
                      data:
                        - peer:
                            address: '0x2222222222222222222222222222222222222222'
                            label: null
                            tags: []
                          tokens:
                            - EXM
                          volume_usd: 1000
                          volume_in_usd: 750
                          volume_out_usd: 250
                          tx_count: 6
                      metadata:
                        address: '0x1111111111111111111111111111111111111111'
                        order_field: interaction_count
                    top_inflow_senders:
                      type: counterparties
                      data:
                        - peer:
                            address: '0x2222222222222222222222222222222222222222'
                            label: null
                            tags: []
                          tokens:
                            - EXM
                          volume_usd: 1000
                          volume_in_usd: 750
                          volume_out_usd: 250
                          tx_count: 6
                      metadata:
                        address: '0x1111111111111111111111111111111111111111'
                        order_field: volume_in_usd
                    top_outflow_receivers:
                      type: counterparties
                      data:
                        - peer:
                            address: '0x2222222222222222222222222222222222222222'
                            label: null
                            tags: []
                          tokens:
                            - EXM
                          volume_usd: 1000
                          volume_in_usd: 750
                          volume_out_usd: 250
                          tx_count: 6
                      metadata:
                        address: '0x1111111111111111111111111111111111111111'
                        order_field: volume_out_usd
        '400':
          $ref: '#/components/responses/BodyReadError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/UnknownTool'
        '422':
          description: >-
            Invalid tool arguments or request-body validation failure. detail is
            a string for argument binding errors or an array for request
            validation errors.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/HttpError'
                  - $ref: '#/components/schemas/RequestValidationError'
              examples:
                arguments:
                  summary: Invalid tool arguments
                  value:
                    detail: >-
                      Invalid arguments for
                      'get_wallet_counterparties_analysis'.
                invalidJson:
                  summary: Malformed JSON
                  value:
                    detail:
                      - type: json_invalid
                        loc:
                          - body
                          - 1
                        msg: JSON decode error
                        input: {}
                        ctx:
                          error: Expecting property name enclosed in double quotes
        '429':
          $ref: '#/components/responses/ToolUsageLimit'
      security:
        - bearerAuth: []
components:
  responses:
    BodyReadError:
      description: >-
        The server could not read or parse the request body. Malformed JSON
        normally returns 422 instead.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpError'
          examples:
            bodyRead:
              summary: Body parsing failure
              value:
                detail: There was an error parsing the body
    Unauthorized:
      description: Missing, malformed, invalid, revoked, or insufficiently scoped API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpError'
          examples:
            missingHeader:
              summary: Missing or malformed Authorization header
              value:
                detail: Missing or malformed Authorization header
            invalidKey:
              summary: Invalid key or missing API scope
              value:
                detail: Invalid API key
    UnknownTool:
      description: >-
        Unknown or non-public tool name. Check GET /api/tools for available
        names.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpError'
          examples:
            unknownTool:
              summary: Unknown tool
              value:
                detail: Unknown tool 'unknown_tool'
    ToolUsageLimit:
      description: >-
        Per-key request rate or enforced plan quota exceeded. Inspect detail to
        distinguish the cause. Plan identifiers, quotas, and reset times in the
        example are illustrative.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/HttpError'
              - $ref: '#/components/schemas/PlanQuotaError'
          examples:
            rateLimit:
              summary: Per-key rate limit
              value:
                detail: Rate limit exceeded
            planQuota:
              summary: Plan quota exhausted (illustrative values)
              value:
                detail:
                  error_code: PLAN_LIMIT_REACHED
                  meter: api_calls
                  plan_id: example_plan
                  limit: 1000
                  resets_at: '2026-10-01T00:00:00+00:00'
                  message: >-
                    You have reached your plan's usage limit for this feature.
                    Upgrade your plan to continue, or wait until the limit
                    resets.
      headers:
        Retry-After:
          description: >-
            Seconds until the plan quota resets, when its reset time is known.
            Not sent by the per-key rate limiter.
          schema:
            type: string
          example: '3600'
  schemas:
    HttpError:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Explanation of the rejected request.
    RequestValidationError:
      type: object
      required:
        - detail
      properties:
        detail:
          type: array
          description: Request validation failures. Available fields depend on the failure.
          items:
            type: object
            required:
              - loc
              - msg
              - type
            properties:
              loc:
                type: array
                items:
                  oneOf:
                    - type: string
                    - type: integer
                description: Location of the invalid value in the request.
              msg:
                type: string
              type:
                type: string
              input:
                description: Rejected input, when included.
              ctx:
                type: object
                additionalProperties: true
                description: Additional validation context, when included.
    PlanQuotaError:
      type: object
      required:
        - detail
      properties:
        detail:
          type: object
          required:
            - error_code
            - meter
            - plan_id
            - limit
            - resets_at
            - message
          properties:
            error_code:
              type: string
              enum:
                - PLAN_LIMIT_REACHED
            meter:
              type: string
              description: >-
                Usage meter that reached its limit. Tools API calls use
                api_calls.
            plan_id:
              type: string
              description: Plan identifier for the key owner.
            limit:
              type: integer
              description: Quota for this meter.
            resets_at:
              type: string
              format: date-time
              nullable: true
              description: Quota reset time, or null if unknown.
            message:
              type: string
              description: Explanation of the quota restriction.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````