> ## 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.

# getBlock

> Runs the Solana RPC `getBlock` method.



## OpenAPI

````yaml getblock post /
openapi: 3.1.0
info:
  title: Solana RPC
  version: 1.0.0
  description: Solana RPC HTTP method reference.
servers:
  - url: https://rpc-mainnet.solanatracker.io
    description: Mainnet RPC endpoint
security: []
paths:
  /:
    post:
      summary: Run `getBlock`
      description: Runs the Solana RPC `getBlock` method.
      operationId: getblock
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  allOf:
                    - type: string
                      enum:
                        - '2.0'
                      description: The JSON-RPC protocol version.
                      default: '2.0'
                id:
                  allOf:
                    - type: string
                      description: A unique identifier for the request.
                      example: '1'
                      default: '1'
                method:
                  allOf:
                    - type: string
                      enum:
                        - getBlock
                      description: The name of the RPC method to invoke.
                      default: getBlock
                params:
                  allOf:
                    - type: array
                      description: Parameters for the request.
                      default:
                        - 335157111
                      items:
                        oneOf:
                          - type: integer
                            description: Slot number as a `u64` integer.
                            example: 335157111
                          - type: object
                            description: Additional configuration options for the request.
                            properties:
                              commitment:
                                type: string
                                description: The commitment level for the request.
                                enum:
                                  - finalized
                                default: finalized
                              encoding:
                                type: string
                                description: >-
                                  The encoding format for each returned
                                  transaction.
                                enum:
                                  - json
                                  - jsonParsed
                                  - base58
                                  - base64
                                default: json
                              transactionDetails:
                                type: string
                                description: >-
                                  Level of transaction detail to return. If
                                  accounts are requested,  transaction details
                                  only include signatures and an annotated list 
                                  of accounts in each transaction. Transaction
                                  metadata includes only:  fee, err,
                                  pre_balances, post_balances,
                                  pre_token_balances, and post_token_balances.
                                enum:
                                  - full
                                  - accounts
                                  - signatures
                                  - none
                                default: full
                              maxSupportedTransactionVersion:
                                type: integer
                                description: >-
                                  Maximum transaction version to return in
                                  responses. If the requested block  contains a
                                  transaction with a higher version, an error
                                  will be returned.  If omitted, only legacy
                                  transactions will be returned.
                              rewards:
                                type: boolean
                                description: Whether to populate the rewards array.
                                default: true
              required:
                - jsonrpc
                - id
                - method
                - params
            examples:
              example:
                value:
                  jsonrpc: '2.0'
                  id: db16f277-1a22-41ff-9f85-f37e2cd77900
                  method: getBlock
                  params:
                    - 335157111
      responses:
        '200':
          description: Successfully retrieved block details.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                  id:
                    allOf:
                      - type: string
                  result:
                    allOf:
                      - type: object
                        properties:
                          blockhash:
                            type: string
                            description: >-
                              The blockhash of this block (base-58 encoded
                              string).
                            example: DUCT8VSgk2BXkMhQfxKVYfikEZCQf4dZ4ioPdGdaVxMN
                          previousBlockhash:
                            type: string
                            description: The blockhash of the block's parent.
                            example: HA2fJgGqmQezCXJRVNZAWPbRMXCPjUyo7VjRF47JGdYs
                          parentSlot:
                            type: integer
                            description: The slot index of this block's parent.
                            example: 429
                          transactions:
                            type: array
                            description: Array of transaction details.
                            items:
                              type: object
                              properties:
                                meta:
                                  type: object
                                  nullable: true
                                  description: Metadata associated with the transaction.
                                transaction:
                                  type: object
                                  description: Transaction details.
                                  properties:
                                    message:
                                      type: object
                                      properties:
                                        accountKeys:
                                          type: array
                                          description: >-
                                            Array of account public keys used in
                                            this transaction.
                                          items:
                                            type: string
                                        header:
                                          type: object
                                          properties:
                                            numReadonlySignedAccounts:
                                              type: integer
                                              description: Number of readonly signed accounts.
                                            numReadonlyUnsignedAccounts:
                                              type: integer
                                              description: Number of readonly unsigned accounts.
                                            numRequiredSignatures:
                                              type: integer
                                              description: Number of required signatures.
                                        instructions:
                                          type: array
                                          description: Array of program instructions.
                                          items:
                                            type: object
                                            properties:
                                              accounts:
                                                type: array
                                                description: Array of account indexes.
                                                items:
                                                  type: integer
                                              data:
                                                type: string
                                                description: Program input data encoded in base58.
                                              programIdIndex:
                                                type: integer
                                                description: >-
                                                  Index of the program ID in the
                                                  accountKeys array.
                                              stackHeight:
                                                type: integer
                                                nullable: true
                                                description: Stack height.
                                        recentBlockhash:
                                          type: string
                                          description: >-
                                            Recent blockhash used in this
                                            transaction.
                                    signatures:
                                      type: array
                                      description: >-
                                        Array of signatures for this transaction
                                        (base-58 encoded).
                                      items:
                                        type: string
                          blockTime:
                            type: integer
                            nullable: true
                            description: Estimated production time as Unix timestamp.
                            example: null
                          blockHeight:
                            type: integer
                            nullable: true
                            description: Number of blocks beneath this block.
                            example: null
                          rewards:
                            type: array
                            description: Rewards for the block.
                            items:
                              type: object
                              properties:
                                pubkey:
                                  type: string
                                  description: >-
                                    The public key of the account that received
                                    the reward.
                                lamports:
                                  type: integer
                                  description: >-
                                    Number of reward lamports credited or
                                    debited.
                                rewardType:
                                  type: string
                                  nullable: true
                                  description: Type of reward (e.g., "fee", "rent").
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    id: <string>
                    result:
                      blockhash: DUCT8VSgk2BXkMhQfxKVYfikEZCQf4dZ4ioPdGdaVxMN
                      previousBlockhash: HA2fJgGqmQezCXJRVNZAWPbRMXCPjUyo7VjRF47JGdYs
                      parentSlot: 429
                      transactions:
                        - meta: {}
                          transaction:
                            message:
                              accountKeys:
                                - <string>
                              header:
                                numReadonlySignedAccounts: 123
                                numReadonlyUnsignedAccounts: 123
                                numRequiredSignatures: 123
                              instructions:
                                - accounts:
                                    - 123
                                  data: <string>
                                  programIdIndex: 123
                                  stackHeight: 123
                              recentBlockhash: <string>
                            signatures:
                              - <string>
                      blockTime: null
                      blockHeight: null
                      rewards:
                        - pubkey: <string>
                          lamports: 123
                          rewardType: <string>
        '400':
          description: Bad Request - Invalid request parameters or malformed request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                          message:
                            type: string
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32602
                      message: Invalid params
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                          message:
                            type: string
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32001
                      message: Unauthorized
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                          message:
                            type: string
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32005
                      message: Too many requests
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
        '500':
          description: Internal Server Error - An error occurred on the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                          message:
                            type: string
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32603
                      message: Internal error
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
        '503':
          description: Service Unavailable - The service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                          message:
                            type: string
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32002
                      message: Service unavailable
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
        '504':
          description: Gateway Timeout - The request timed out.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                          message:
                            type: string
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32003
                      message: Gateway timeout
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
      security:
        - ApiKeyQuery: []
components:
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key

````