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

# Get a completed trade

> One completed trade by its `trade_id` (as returned by [`GET /completed-trades/`](/api-reference/completed-trades/list-completed-trades)), with the same fields as a row of that list. Set `include_fills=true` to embed the trade's fills in `data.fills`, in the same shape as [`GET /completed-trades/{trade_id}/fills`](/api-reference/completed-trades/fills-for-a-completed-trade). An unknown `trade_id` returns `404`.



## OpenAPI

````yaml /api-reference/openapi.json get /completed-trades/{trade_id}
openapi: 3.0.3
info:
  title: 'Hypedexer API: Indexed Data'
  version: 1.0.0
  description: >-
    API to query indexed Hyperliquid trading data.


    This API provides access to stored/indexed trading data:

    - **Fills**: Executed orders and fills (Spot-only or All = Spot + Perp)

    - **Analytics**: Aggregations and statistics based on indexed data

    - **Completed Trades**: Trade objects and their related fills

    - **Users**: User overviews, performance and activity

    - **Social Trading**: Per-trader equity curve, PnL calendar, account
    leverage and top trades

    - **Funding**: Funding rate history, user funding payments, predicted rates

    - **Liquidations**: Liquidation events with filters

    - **Overview**: Market dashboard metrics (volume, fees, traders, PnL)

    - **Spot**: Spot token metadata, pairs, and auctions

    - **TWAPs**: TWAP orders, execution stats and fills

    - **Vaults**: Vault details, summaries, equity, ledger


    > Note: this API is REST only. Responses are computed from indexed data.
    Real-time data is pushed on the [WebSocket](/websocket/overview).
servers:
  - url: https://api.hypedexer.com
    description: Production, routed to the nearest region (EU or JP)
security:
  - ApiKeyAuth: []
tags:
  - name: Fills
    description: Fills endpoints.
  - name: Analytics
    description: Aggregations and stats.
  - name: Completed Trades
    description: Trades and fills.
  - name: Users
    description: User profiles.
  - name: Funding
    description: Funding rates and payments (HL-compatible).
  - name: Liquidations
    description: Liquidation events.
  - name: Overview
    description: Market dashboard metrics.
  - name: Spot
    description: Spot token metadata, pairs and auctions.
  - name: TWAPs
    description: TWAP orders, stats and fills.
  - name: Vaults
    description: Vault details, summaries, equity and ledger.
  - name: Social Trading
    description: >-
      Per-trader equity, PnL calendar, performance, account leverage and top
      trades.
  - name: Market history
    description: >-
      Historical Hyperliquid market microstructure: best bid/offer aggregates
      and spread statistics (April 2024 to February 2026), and the order book
      reconstructed minute by minute: April 2024 to February 2026 from our
      archive (top ~20 levels per side) and, since 23 September 2026, the full
      order book replayed from our own node. Served from the EU region.
paths:
  /completed-trades/{trade_id}:
    get:
      tags:
        - Completed Trades
      summary: Get a completed trade
      description: >-
        One completed trade by its `trade_id` (as returned by [`GET
        /completed-trades/`](/api-reference/completed-trades/list-completed-trades)),
        with the same fields as a row of that list. Set `include_fills=true` to
        embed the trade's fills in `data.fills`, in the same shape as [`GET
        /completed-trades/{trade_id}/fills`](/api-reference/completed-trades/fills-for-a-completed-trade).
        An unknown `trade_id` returns `404`.
      parameters:
        - name: trade_id
          in: path
          required: true
          description: Completed trade id, e.g. `trade_BTC_20a96155`
          schema:
            type: string
        - name: include_fills
          in: query
          description: Embed the trade's fills in `data.fills`
          schema:
            type: boolean
            default: false
        - name: X-API-Key
          in: header
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                  total_count:
                    type: integer
                    nullable: true
                  next_cursor:
                    type: string
                    nullable: true
                  has_more:
                    type: boolean
                    nullable: true
              example:
                success: true
                message: Completed trade trade_BTC_20a96155
                data:
                  user: '0x50bba1ebee0056af4a6fae7032f227f292739384'
                  coin: BTC
                  direction: long
                  start_time: '2026-10-31T10:42:39.460000'
                  end_time: '2026-10-31T12:26:33.708000'
                  duration_s: 6234
                  entry_price: 77462
                  exit_price: 77560
                  size_close: 0.00136
                  pnl_realized: 0.13328
                  leverage_type: cross
                  position_value: 105.34832
                  total_fills: 2
                  total_fees: 0.200286
                  avg_fill_price: 77511
                  first_fill_time: '2026-10-31T10:42:39.460000'
                  last_fill_time: '2026-10-31T12:26:33.708000'
                  total_volume: 210.82992
                  trade_id: trade_BTC_20a96155
                  close_hash: >-
                    0x11c532a2eda5ce33133e0447c312a3020153008888a8ed05b58dddf5aca9a81d
                  created_at: '2026-10-31T12:27:46.518000'
                total_count: null
                execution_time_ms: null
                next_cursor: null
                has_more: null
        '404':
          description: Unknown trade_id
          content:
            application/json:
              example:
                detail: Completed trade 'trade_BTC_00000000' not found
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your Hypedexer API key. Create one in the console at
        https://app.hypedexer.com. `Authorization: Bearer <key>` and the
        `api_key` query parameter are accepted as well.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.