---
title: "List Past Trades"
method: POST
path: "/v1/mytrades"
tags: ["Orders"]
---

# List Past Trades

`POST /v1/mytrades`

## Request

- Base URL: `https://api.gemini.com`
- URL: `https://api.gemini.com/v1/mytrades`
- Auth: API key in header `X-GEMINI-APIKEY` and API key in header `X-GEMINI-SIGNATURE` and API key in header `X-GEMINI-PAYLOAD`

<div class="p-4 text-sm section-icon section-info rounded-sm" role="alert">
  <div class="flex">
     <svg
        view-box="0 0 24 24"
      >
        <path
          fill-rule="evenodd"
          clip-rule="evenodd"
          d="M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM11 17V11H13V17H11ZM11 9V7H13V9H11Z"
        />
      </svg>
     <div>Gemini recommends using our <a href="/websocket/order-events/about">WebSocket Order Events</a> API to be notified when a trade executes on your account instead of polling this endpoint.</div>
  </div>
    <p>Under the terms of the <a href="https://www.gemini.com/legal/api-agreement">Gemini API Agreement</a>, polling this endpoint may be subject to <a href="/rate-limit">rate limiting</a>.</p>
    <p>Enabled for perpetuals accounts from July 10th, 0100hrs ET onwards. Trade info for all perpetuals orders submitted prior to this timing, will not be available through this API.</p>
</div>

### Roles
The API key you use to access this endpoint must have the Trader or Auditor role assigned. See [Roles](/roles#roles) for more information.

The OAuth scope must have `history:read` assigned to access this endpoint. See [OAuth Scopes](/authentication/oauth#oauth-scopes) for more information.

### How to retrieve your trade history

To retrieve your full trade history walking backwards,

1. Initial request: `POST` to https://api.gemini.com/v1/mytrades with a JSON payload including a `timestamp` key with value 0 and a `limit_trades` key with value `500`
2. When you receive the list of trades, it will be sorted by `timestamp` descending - so the first element in the list will have the highest `timestamp` value. For this example, say that value is `X`.
3. Create a second `POST` request with a JSON payload including a `timestamp` key with value `X+1` and a `limit_trades` key with value `500`.
4. Take the first element of the list returned with highest `timestamp` value `Y` and create a third `POST` request with a JSON payload including a `timestamp` key with value `Y+1` and a `limit_trades` key with value `500`.
5. Continue creating `POST` requests and retrieving trades until an empty list is returned.

### Break Types

In the rare event that a trade has been reversed (broken), the trade that is broken will have this flag set. The field will contain one of these values

|Value|Description|
|--- |--- |
|manual|The trade was reversed manually.  This means that all fees, proceeds, and debits associated with the trade have been credited or debited to the account seperately.  That means that this reported trade must be included for order for the account balance to be correct.|
|full|The trade was fully broken.  The reported trade should not be accounted for.  It will be as though the transfer of fund associated with the trade had simply not happened.|

## Headers

- `X-GEMINI-APIKEY` string, required
- `X-GEMINI-SIGNATURE` string, required
- `X-GEMINI-PAYLOAD` string, required
- `Content-Type` string
- `Content-Length` string
- `Cache-Control` string

## Request body

- MyTradesRequest
  - `request` string, required: The API endpoint path
  - `nonce` union, required: timestamp
    - string: Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------|-----------------------|------------------------| | string (seconds) | `1495127793` | `POST` only | | string (milliseconds) | `1495127793000` | `POST` only |
    - integer: Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------------|---------------------------|------------------------| | whole number (seconds) | `1495127793` | `GET`, `POST` | | whole number (milliseconds) | `1495127793000` | `GET`, `POST` |
  - `account` string: Required for Master API keys as described in [Private API Invocation](/authentication/api-key#private-api-invocation). The name of the account within the subaccount group. Specifies the account on which you intend to place the order. Only available for exchange accounts.
  - `symbol` string: The [symbol](/market-data/symbols-and-minimums) to retrieve trades for
  - `limit_trades` integer: The maximum number of trades to return. Default is 50, max is 500.
  - `timestamp` union: timestamp
    - string: Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------|-----------------------|------------------------| | string (seconds) | `1495127793` | `POST` only | | string (milliseconds) | `1495127793000` | `POST` only |
    - integer: Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------------|---------------------------|------------------------| | whole number (seconds) | `1495127793` | `GET`, `POST` | | whole number (milliseconds) | `1495127793000` | `GET`, `POST` |

## Response `200`

The past trades

- MyTrade[]
  - `price` string
  - `amount` string
  - `timestamp` union: timestamp
    - string: Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------|-----------------------|------------------------| | string (seconds) | `1495127793` | `POST` only | | string (milliseconds) | `1495127793000` | `POST` only |
    - integer: Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------------|---------------------------|------------------------| | whole number (seconds) | `1495127793` | `GET`, `POST` | | whole number (milliseconds) | `1495127793000` | `GET`, `POST` |
  - `timestampms` union: timestamp
    - string: Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------|-----------------------|------------------------| | string (seconds) | `1495127793` | `POST` only | | string (milliseconds) | `1495127793000` | `POST` only |
    - integer: Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------------|---------------------------|------------------------| | whole number (seconds) | `1495127793` | `GET`, `POST` | | whole number (milliseconds) | `1495127793000` | `GET`, `POST` |
  - `type` 'Buy' | 'Sell'
  - `aggressor` boolean
  - `fee_currency` string
  - `fee_amount` string
  - `tid` integer
  - `order_id` string
  - `client_order_id` string
  - `exchange` string
  - `is_auction_fill` boolean
  - `break` '' | 'trade correct'

## Other responses

- `400`: Bad request - malformed request or invalid parameters
- `401`: Unauthorized - missing or invalid authentication
- `403`: ApiKey fails IP Filtering Check
- `404`: Resource not found
- `429`: Too many requests - you have exceeded the rate limit
- `500`: Internal server error

---

[API](https://skmtc.dev/gemini/apis/rest-api.md) - [All operations](https://skmtc.dev/gemini/apis/rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gemini/apis/rest-api/revisions/24979792d748?raw)
