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

# getBlockHeight

> Runs the Solana RPC `getBlockHeight` method.



## OpenAPI

````yaml getblockheight 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 `getBlockHeight`
      description: Runs the Solana RPC `getBlockHeight` method.
      operationId: getblockheight
      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:
                        - getBlockHeight
                      description: The name of the RPC method to invoke.
                      default: getBlockHeight
                params:
                  allOf:
                    - type: array
                      description: Parameters for the request.
                      items:
                        type: object
                        description: Configuration options for the request.
                        properties:
                          commitment:
                            type: string
                            description: The commitment level for the request.
                            enum:
                              - processed
                              - confirmed
                              - finalized
                            example: finalized
                          minContextSlot:
                            type: integer
                            description: >-
                              The minimum slot at which the request can be
                              evaluated.
                            example: 1
              required:
                - jsonrpc
                - id
                - method
                - params
            examples:
              example:
                value:
                  jsonrpc: '2.0'
                  id: db16f277-1a22-41ff-9f85-f37e2cd77900
                  method: getBlockHeight
                  params:
                    - commitment: finalized
                      minContextSlot: 1
      responses:
        '200':
          description: Successfully retrieved current block height.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                  id:
                    allOf:
                      - type: string
                  result:
                    allOf:
                      - type: integer
                        description: Current block height as `u64`.
                        example: 1233
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    id: <string>
                    result: 1233
        '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

````