Binance · Capability

Binance Spot Trading API — User Data Stream

Binance Spot Trading API — User Data Stream. 3 operations. Lead operation: Create a listen key. Self-contained Naftiko capability covering one Binance business surface.

Run with Naftiko BinanceUser Data Stream

What You Can Do

POST
Createlistenkey — Create a listen key
/v1/api/v3/userdatastream
PUT
Keepalivelistenkey — Ping/Keep-alive a listen key
/v1/api/v3/userdatastream
DELETE
Closelistenkey — Close a listen key
/v1/api/v3/userdatastream

MCP Tools

create-listen-key

Create a listen key

ping-keep-alive-listen-key

Ping/Keep-alive a listen key

idempotent
close-listen-key

Close a listen key

idempotent

Capability Spec

spot-trading-user-data-stream.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Binance Spot Trading API — User Data Stream
  description: 'Binance Spot Trading API — User Data Stream. 3 operations. Lead operation: Create a listen key. Self-contained
    Naftiko capability covering one Binance business surface.'
  tags:
  - Binance
  - User Data Stream
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    BINANCE_API_KEY: BINANCE_API_KEY
capability:
  consumes:
  - type: http
    namespace: spot-trading-user-data-stream
    baseUri: https://api.binance.com
    description: Binance Spot Trading API — User Data Stream business capability. Self-contained, no shared references.
    resources:
    - name: api-v3-userDataStream
      path: /api/v3/userDataStream
      operations:
      - name: createlistenkey
        method: POST
        description: Create a listen key
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: keepalivelistenkey
        method: PUT
        description: Ping/Keep-alive a listen key
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: listenKey
          in: query
          type: string
          description: The listen key to keep alive.
          required: true
      - name: closelistenkey
        method: DELETE
        description: Close a listen key
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: listenKey
          in: query
          type: string
          description: The listen key to close.
          required: true
    authentication:
      type: apikey
      key: X-MBX-APIKEY
      value: '{{env.BINANCE_API_KEY}}'
      placement: header
  exposes:
  - type: rest
    namespace: spot-trading-user-data-stream-rest
    port: 8080
    description: REST adapter for Binance Spot Trading API — User Data Stream. One Spectral-compliant resource per consumed
      operation, prefixed with /v1.
    resources:
    - path: /v1/api/v3/userdatastream
      name: api-v3-userdatastream
      description: REST surface for api-v3-userDataStream.
      operations:
      - method: POST
        name: createlistenkey
        description: Create a listen key
        call: spot-trading-user-data-stream.createlistenkey
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: keepalivelistenkey
        description: Ping/Keep-alive a listen key
        call: spot-trading-user-data-stream.keepalivelistenkey
        with:
          listenKey: rest.listenKey
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: closelistenkey
        description: Close a listen key
        call: spot-trading-user-data-stream.closelistenkey
        with:
          listenKey: rest.listenKey
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: spot-trading-user-data-stream-mcp
    port: 9090
    transport: http
    description: MCP adapter for Binance Spot Trading API — User Data Stream. One tool per consumed operation, routed inline
      through this capability's consumes block.
    tools:
    - name: create-listen-key
      description: Create a listen key
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: spot-trading-user-data-stream.createlistenkey
      outputParameters:
      - type: object
        mapping: $.
    - name: ping-keep-alive-listen-key
      description: Ping/Keep-alive a listen key
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: spot-trading-user-data-stream.keepalivelistenkey
      with:
        listenKey: tools.listenKey
      outputParameters:
      - type: object
        mapping: $.
    - name: close-listen-key
      description: Close a listen key
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: spot-trading-user-data-stream.closelistenkey
      with:
        listenKey: tools.listenKey
      outputParameters:
      - type: object
        mapping: $.