Phemex Account API

The Account API from Phemex — 10 operation(s) for account.

Operations 10

GET /accounts/accountPositions Get account and positions #
GET /accounts/positions Get positions with PNL #
GET /api-data/futures/funding-fees Get funding fee history #
GET /api-data/futures/trading-fees Get trading fee history #
GET /g-accounts/accountPositions Get hedged account positions #
GET /g-accounts/positions Get hedged positions with PNL #
GET /api-data/g-futures/funding-fees Get funding fee history #
GET /api-data/g-futures/trading-fees Get trading fee history #
GET /api-data/spots/funds Get funds history #
GET /api-data/spots/pnls Get profit and loss records #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/phemex-account-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

phemex-account-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Phemex Contract Trading Account API
  description: REST API for trading perpetual contracts on Phemex, including order placement, position management, account queries, and market data.
  version: 1.0.0
  contact:
    name: Phemex Support
    url: https://phemex.com/help-center
servers:
- url: https://api.phemex.com
  description: Production
- url: https://testnet-api.phemex.com
  description: Testnet
security:
- HmacAuth: []
tags:
- name: Account
paths:
  /accounts/accountPositions:
    get:
      summary: Get account and positions
      description: Query trading account and positions.
      operationId: getContractAccountPositions
      tags:
      - Account
      parameters:
      - name: currency
        in: query
        required: true
        schema:
          type: string
        description: Settlement currency (e.g. BTC, USD)
      responses:
        '200':
          description: Account and positions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountPositionsResponse'
  /accounts/positions:
    get:
      summary: Get positions with PNL
      description: Query positions with unrealized PNL at mark price.
      operationId: getContractPositions
      tags:
      - Account
      parameters:
      - name: currency
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Positions with PNL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PositionsResponse'
  /api-data/futures/funding-fees:
    get:
      summary: Get funding fee history
      description: Query historical funding fee records.
      operationId: getContractFundingFees
      tags:
      - Account
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: offset
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Funding fee history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /api-data/futures/trading-fees:
    get:
      summary: Get trading fee history
      description: Retrieve trading fee history.
      operationId: getFuturesTradingFees
      tags:
      - Account
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: offset
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Trading fee history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /g-accounts/accountPositions:
    get:
      summary: Get hedged account positions
      description: Query account positions and balances for hedged perpetuals.
      operationId: getHedgedAccountPositions
      tags:
      - Account
      parameters:
      - name: currency
        in: query
        required: true
        schema:
          type: string
      - name: symbol
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Account and positions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountPositionsResponse_2'
  /g-accounts/positions:
    get:
      summary: Get hedged positions with PNL
      description: Query positions with unrealized PNL at mark price.
      operationId: getHedgedPositions
      tags:
      - Account
      parameters:
      - name: currency
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Positions with PNL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /api-data/g-futures/funding-fees:
    get:
      summary: Get funding fee history
      description: Query historical funding fees for hedged perpetuals.
      operationId: getHedgedFundingFees
      tags:
      - Account
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: offset
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Funding fee history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /api-data/g-futures/trading-fees:
    get:
      summary: Get trading fee history
      description: Query trading fees history for hedged perpetuals.
      operationId: getHedgedTradingFees
      tags:
      - Account
      parameters:
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: offset
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Trading fees
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /api-data/spots/funds:
    get:
      summary: Get funds history
      description: Query funds history for a currency.
      operationId: getSpotFundsHistory
      tags:
      - Account
      parameters:
      - name: currency
        in: query
        required: true
        schema:
          type: string
      - name: start
        in: query
        schema:
          type: integer
      - name: end
        in: query
        schema:
          type: integer
      - name: offset
        in: query
        schema:
          type: integer
      - name: limit
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: Funds history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
  /api-data/spots/pnls:
    get:
      summary: Get profit and loss records
      description: Query spot profit/loss records.
      operationId: getSpotPnls
      tags:
      - Account
      parameters:
      - name: start
        in: query
        schema:
          type: integer
      - name: end
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: PNL records
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
components:
  schemas:
    AccountPositionsResponse_2:
      type: object
      properties:
        code:
          type: integer
        data:
          type: object
          properties:
            account:
              type: object
              properties:
                accountBalanceRv:
                  type: string
                totalUsedBalanceRv:
                  type: string
            positions:
              type: array
              items:
                type: object
                properties:
                  symbol:
                    type: string
                  posSide:
                    type: string
                  size:
                    type: string
                  avgEntryPriceRp:
                    type: string
                  leverageRr:
                    type: string
                  unRealisedPnlRv:
                    type: string
    PositionsResponse:
      type: object
      properties:
        code:
          type: integer
        data:
          type: object
          properties:
            positions:
              type: array
              items:
                type: object
                properties:
                  symbol:
                    type: string
                  side:
                    type: string
                  size:
                    type: integer
                  unRealisedPnlEv:
                    type: integer
                  markPriceEp:
                    type: integer
    AccountPositionsResponse:
      type: object
      properties:
        code:
          type: integer
        msg:
          type: string
        data:
          type: object
          properties:
            account:
              type: object
              properties:
                accountId:
                  type: integer
                accountBalanceEv:
                  type: integer
                totalUsedBalanceEv:
                  type: integer
            positions:
              type: array
              items:
                type: object
                properties:
                  symbol:
                    type: string
                  side:
                    type: string
                  size:
                    type: integer
                  avgEntryPriceEp:
                    type: integer
                  leverageEr:
                    type: integer
                  liquidationPriceEp:
                    type: integer
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
        msg:
          type: string
        data:
          type: object
  securitySchemes:
    HmacAuth:
      type: apiKey
      in: header
      name: x-phemex-access-token
      description: HMAC SHA256 signed request. Also requires x-phemex-request-expiry and x-phemex-request-signature headers.