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

# Get recent trades

> Returns the most recent public trades for an instrument, newest first. Requires MARKET_DATA permission.



## OpenAPI

````yaml /api-reference/derivatives-predictions-api/rest-api/cpm-spec.json get /api/trades/{instrument_id}
openapi: 3.0.3
info:
  title: CPM Public REST API
  version: 0.1.0
servers:
  - url: https://api.example.com
    variables: {}
security:
  - auth_api_key: []
  - auth_timestamp: []
  - auth_passphrase: []
  - auth_signature: []
paths:
  /api/trades/{instrument_id}:
    get:
      tags:
        - MarketData
      summary: Get recent trades
      description: >-
        Returns the most recent public trades for an instrument, newest first.
        Requires MARKET_DATA permission.
      operationId: getTrades
      parameters:
        - name: instrument_id
          in: path
          description: Instrument ID.
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            Maximum number of trades to return. Default 100. For your own fills,
            use GET /api/fills.
          required: false
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: Recent trades
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TradeResponse'
      deprecated: false
      security: []
components:
  schemas:
    TradeResponse:
      type: object
      additionalProperties: false
      properties:
        trade_id:
          type: string
          description: Trade id, as a canonical decimal string.
          example: '798471892349'
        instrument_id:
          type: string
          description: Instrument id, as a canonical decimal string.
          example: '598471892347'
        price:
          type: string
          description: Trade price per YES contract in USDC, as a decimal string.
          example: '0.590000'
        quantity:
          type: string
          description: Traded quantity in contracts, as a decimal string.
          example: '10.00'
        side:
          type: string
          description: >-
            Side of the order that took liquidity: BUY or SELL of the YES
            contract.
          example: BUY
        timestamp_ns:
          type: integer
          format: int64
          description: Trade time in nanoseconds since the Unix epoch.
          example: 1795812345678000000
      required:
        - timestamp_ns
  securitySchemes:
    auth_api_key:
      name: CB-ACCESS-KEY
      description: The API key string for the request
      in: header
      type: apiKey
    auth_timestamp:
      name: CB-ACCESS-TIMESTAMP
      description: The request timestamp (epoch seconds)
      in: header
      type: apiKey
    auth_passphrase:
      name: CB-ACCESS-PASSPHRASE
      description: The passphrase for the API key
      in: header
      type: apiKey
    auth_signature:
      name: CB-ACCESS-SIGN
      description: HMAC SHA-256 signature over TIMESTAMP + METHOD + REQUEST_PATH + BODY
      in: header
      type: apiKey

````