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

# blockSubscribe WebSocket Method

> Subscribe to Solana blocks matching an account filter at the commitment level you choose, over WebSocket.

Subscribe to blocks matching the account filter at the requested commitment. Save the subscription ID returned in result and match it against params.subscription in notifications. Use blockUnsubscribe on the same connection to stop the stream.


## AsyncAPI

````yaml solana-rpc/websocket/asyncapi.json blockSubscribe
id: blockSubscribe
title: Block subscribe
description: >-
  Subscribe to blocks matching the account filter at the requested commitment.
  Save the subscription ID returned in result and match it against
  params.subscription in notifications. Use blockUnsubscribe on the same
  connection to stop the stream.
servers:
  - id: production
    protocol: wss
    host: rpc-mainnet.solanatracker.io
    bindings: []
    variables: []
address: /
parameters: []
bindings: []
operations:
  - &ref_0
    id: subscribeToBlocks
    title: Subscribe to blocks
    type: send
    messages:
      - &ref_1
        id: blockSubscribe
        payload:
          - name: blockSubscribe
            description: Subscribe to block notifications
            type: object
            properties:
              - name: jsonrpc
                type: string
                description: '2.0'
                required: false
              - name: id
                type: integer
                required: false
              - name: method
                type: string
                description: blockSubscribe
                required: false
              - name: params
                type: array
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            jsonrpc:
              type: string
              const: '2.0'
              default: '2.0'
              x-parser-schema-id: <anonymous-schema-31>
            id:
              type: integer
              default: 1
              x-parser-schema-id: <anonymous-schema-32>
            method:
              type: string
              const: blockSubscribe
              default: blockSubscribe
              x-parser-schema-id: <anonymous-schema-33>
            params:
              type: array
              items:
                - oneOf:
                    - type: string
                      const: all
                      description: Subscribe to all blocks
                      default: all
                      x-parser-schema-id: <anonymous-schema-36>
                    - type: object
                      properties:
                        mentionsAccountOrProgram:
                          type: string
                          description: Filter by account or program
                          x-parser-schema-id: <anonymous-schema-38>
                      x-parser-schema-id: <anonymous-schema-37>
                  x-parser-schema-id: <anonymous-schema-35>
                - type: object
                  description: Configuration options
                  properties:
                    commitment:
                      type: string
                      enum:
                        - finalized
                        - confirmed
                      default: finalized
                      x-parser-schema-id: <anonymous-schema-40>
                    encoding:
                      type: string
                      enum:
                        - json
                        - jsonParsed
                        - base64
                        - base58
                      default: json
                      x-parser-schema-id: <anonymous-schema-41>
                    transactionDetails:
                      type: string
                      enum:
                        - full
                        - signatures
                        - accounts
                        - none
                      default: full
                      x-parser-schema-id: <anonymous-schema-42>
                    showRewards:
                      type: boolean
                      default: false
                      x-parser-schema-id: <anonymous-schema-43>
                    maxSupportedTransactionVersion:
                      type: integer
                      default: 0
                      x-parser-schema-id: <anonymous-schema-44>
                  x-parser-schema-id: <anonymous-schema-39>
              x-parser-schema-id: <anonymous-schema-34>
          examples:
            - jsonrpc: '2.0'
              id: 1
              method: blockSubscribe
              params:
                - all
            - jsonrpc: '2.0'
              id: 1
              method: blockSubscribe
              params:
                - all
                - commitment: confirmed
                  encoding: json
                  transactionDetails: full
                  showRewards: true
                  maxSupportedTransactionVersion: 0
          x-parser-schema-id: <anonymous-schema-30>
        title: Block subscribe
        description: Subscribe to block notifications
        example: |-
          {
            "jsonrpc": "2.0",
            "id": 1,
            "method": "blockSubscribe",
            "params": [
              "all"
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: blockSubscribe
          - id: x-parser-message-name
            value: blockSubscribe
    bindings: []
    extensions:
      - id: x-parser-unique-object-id
        value: blockSubscribe
sendOperations: []
receiveOperations:
  - *ref_0
sendMessages: []
receiveMessages:
  - *ref_1
extensions:
  - id: x-parser-unique-object-id
    value: blockSubscribe
securitySchemes:
  - id: apiKeyAuth
    name: api_key
    type: httpApiKey
    description: >-
      API key for authentication. Provide your Solana Tracker API key as a query
      parameter.
    in: query
    extensions: []

````

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