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

# Get paginated trading activity history

> Returns closed trade deals and money transactions (deposits and withdrawals) for the authenticated user in reverse chronological order.

Pagination pattern: start with `to=Date.now()` to fetch the most recent activity. If `hasMore` is `true` in the response, pass the returned `nextTo` value as `to` in the next request to continue walking back through history. When `hasMore` is `false`, you have reached the beginning of the account history — no further pages exist.

This endpoint does NOT return open/pending positions or orders. It only reflects settled activity.



## OpenAPI

````yaml /openapi-readme.json get /trading/activity
openapi: 3.1.0
info:
  title: Amana API
  version: 1.0.0
  description: API documentation for Amana platform
servers:
  - url: https://gateway.amana.io
    description: Amana app
security: []
tags:
  - name: onboarding
    description: Endpoints related to user onboarding, KYC processes, and account setup.
  - name: auth
    description: Endpoints for user authentication, token management, and session handling.
  - name: trading
    description: >-
      Endpoints related to trading operations, account management, and market
      data retrieval.
  - name: charting
    description: >-
      Endpoints for retrieving historical price data, technical indicators, and
      other charting-related information.
  - name: uaepass
    description: Endpoints for UAE Pass authentication and identity verification.
  - name: alerts
  - name: cms
  - name: dw
  - name: events
  - name: geo-location
  - name: high-leverage
  - name: kyc
  - name: mt
  - name: nafath
  - name: payments
  - name: promo-codes
  - name: smart-money
  - name: support
  - name: symbols
  - name: trading-accounts
  - name: transactions
  - name: user
  - name: watchlists
paths:
  /trading/activity:
    get:
      tags:
        - trading
      summary: Get paginated trading activity history
      description: >-
        Returns closed trade deals and money transactions (deposits and
        withdrawals) for the authenticated user in reverse chronological order.


        Pagination pattern: start with `to=Date.now()` to fetch the most recent
        activity. If `hasMore` is `true` in the response, pass the returned
        `nextTo` value as `to` in the next request to continue walking back
        through history. When `hasMore` is `false`, you have reached the
        beginning of the account history — no further pages exist.


        This endpoint does NOT return open/pending positions or orders. It only
        reflects settled activity.
      operationId: getActivityHistory
      parameters:
        - schema:
            type: number
          in: query
          name: to
          required: true
          description: >-
            Unix timestamp in milliseconds marking the end of the time window.
            Use Date.now() for the most recent activity.
        - schema:
            type: number
            default: 3
          in: query
          name: count
          required: false
          description: >-
            Number of days to look back from the `to` timestamp. Clamped between
            1 and 31. Default is 3.
        - schema:
            type: string
          in: query
          name: before_id
          required: false
          description: >-
            Optional deal ID cursor. Only returns deals with ID less than this
            value, for client-side deduplication.
        - schema:
            type: string
          in: query
          name: symbol
          required: false
          description: >-
            Optional trading symbol filter, for example XAUUSD or EURUSD. Omit
            to return all symbols.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  deals:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            reason:
                              type: string
                              enum:
                                - money
                            id:
                              type: string
                            time:
                              type: number
                            type:
                              type: string
                            profit:
                              type: number
                            digits:
                              default: 2
                              type: number
                            comment:
                              type: string
                            symbol:
                              type: string
                            logo:
                              type: string
                            friendlyName:
                              type: string
                            delayed:
                              type: boolean
                            sharia:
                              type: boolean
                          required:
                            - reason
                            - id
                            - time
                            - type
                            - profit
                            - digits
                            - comment
                          additionalProperties: false
                        - type: object
                          properties:
                            reason:
                              type: string
                            id:
                              type: string
                            login:
                              type: string
                            symbol:
                              type: string
                              minLength: 1
                            logo:
                              type: string
                            friendlyName:
                              type: string
                            delayed:
                              type: boolean
                            sharia:
                              type: boolean
                            leverage:
                              type: number
                            order:
                              type: string
                            position:
                              type: string
                            time:
                              type: number
                            type:
                              type: string
                            dir:
                              type: string
                            digits:
                              type: number
                            units:
                              type: number
                            invested:
                              type: number
                            sl:
                              type: number
                            tp:
                              type: number
                            priceOpen:
                              type: number
                            profit:
                              type: number
                            commission:
                              type: number
                            storage:
                              type: number
                            fee:
                              type: number
                            comment:
                              default: ''
                              type: string
                          required:
                            - reason
                            - id
                            - login
                            - symbol
                            - logo
                            - friendlyName
                            - delayed
                            - sharia
                            - leverage
                            - time
                            - type
                            - dir
                            - digits
                            - units
                            - invested
                            - sl
                            - tp
                            - priceOpen
                            - profit
                            - commission
                            - storage
                            - fee
                            - comment
                          additionalProperties: false
                    description: Array of deals (money or trade), orders from desc
                  nextTo:
                    type: number
                    description: >-
                      Cursor for the next page — pass this as `to` in the next
                      request
                  hasMore:
                    type: boolean
                    description: >-
                      False when the window has reached the account registration
                      date (no more history)
                required:
                  - deals
                  - hasMore
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties: true
                required:
                  - error
                additionalProperties: false
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token obtained from authentication endpoints

````

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