LegendTrade Info API

Hyperliquid-compatible market and account info queries.

OpenAPI Specification

legendtrade-info-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Legend Health Info API
  version: 0.1.0
  summary: Hyperliquid-compatible info API with local processing, operated by Legend (legend.trade).
  description: 'The public read surface of Legend''s trading platform, served at https://api.legend.trade. The service self-identifies as `@legend/hl-node` v0.1.0 — "Hyperliquid-compatible info API with local processing" — and mirrors the Hyperliquid `POST /info` request-type convention while adding Legend-specific endpoints (`/sparklines`) and an operator-authenticated wallet registration surface used for fill tracking.

    This description was GENERATED by the API Evangelist enrichment pipeline from the API''s own self-describing root document (GET https://api.legend.trade) and from live probes of each endpoint on 2026-07-19. Legend publishes an `openapi.json` at docs.legend.trade/api-reference/openapi.json, but as of this run that file is the unmodified Mintlify "OpenAPI Plant Store" scaffold and does not describe the Legend API — it was deliberately NOT harvested. Request/response schemas below are typed only where a live response was observed; unobserved shapes are left open rather than invented.'
  contact:
    name: Legend
    url: https://docs.legend.trade
  x-api-evangelist:
    method: generated
    generated: '2026-07-19'
    source: https://api.legend.trade (self-describing root document) + live endpoint probes
    upstream: https://hyperliquid.xyz
servers:
- url: https://api.legend.trade
  description: Production
security:
- bearerAuth: []
tags:
- name: Info
  description: Hyperliquid-compatible market and account info queries.
paths:
  /info:
    post:
      operationId: postInfo
      tags:
      - Info
      summary: Hyperliquid-compatible info query
      description: Single multiplexed read endpoint. The `type` field in the request body selects the query; the response shape varies by type. Unknown types return HTTP 400 with an `error` envelope. GET on this path returns 404 — the endpoint is POST-only.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InfoRequest'
            examples:
              meta:
                summary: Perpetuals universe metadata
                value:
                  type: meta
              candleSnapshot:
                summary: Historical candles
                value:
                  type: candleSnapshot
              clearinghouseState:
                summary: Account state
                value:
                  type: clearinghouseState
      responses:
        '200':
          description: Query result. Shape depends on the requested `type`; for `meta` the response carries a `universe` array of tradable assets.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              example:
                universe:
                - name: BTC
                  szDecimals: 5
                  maxLeverage: 40
                  marginTableId: 56
                - name: ETH
                  szDecimals: 4
                  maxLeverage: 25
                  marginTableId: 55
        '400':
          description: Unknown or malformed request type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 'Unknown request type: bogusType'
components:
  schemas:
    Error:
      type: object
      description: Legend's error envelope — a single `error` string.
      properties:
        error:
          type: string
      required:
      - error
    InfoRequest:
      type: object
      description: Hyperliquid-compatible info request. Additional per-type fields are permitted.
      properties:
        type:
          type: string
          description: The info query to run.
          enum:
          - candleSnapshot
          - recentTrades
          - meta
          - metaAndAssetCtxs
          - openOrders
          - frontendOpenOrders
          - clearinghouseState
          - userFills
      required:
      - type
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: The `/wallets/*` endpoints are authenticated — unauthenticated requests return `401 {"error":"Unauthorized"}`. Legend does not publish the credential format for this operator surface; `bearer` is recorded as the observed-unauthenticated default and is NOT a documented provider claim.