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

# Get Masterchain Info

> Get up-to-date masterchain state.



## OpenAPI

````yaml get /getMasterchainInfo
openapi: 3.1.0
info:
  title: TON HTTP API
  description: >

    This API enables HTTP access to TON blockchain - getting accounts and
    wallets information, looking up blocks and transactions, sending messages to
    the blockchain, calling get methods of smart contracts, and more.


    In addition to REST API, all methods are available through [JSON-RPC
    endpoint](#json%20rpc)  with `method` equal to method name and `params`
    passed as a dictionary.


    The response contains a JSON object, which always has a boolean field `ok`
    and either `error` or `result`. If `ok` equals true, the request was
    successful and the result of the query can be found in the `result` field.
    In case of an unsuccessful request, `ok` equals false and the error is
    explained in the `error`.


    API Key should be sent either as `api_key` query parameter or `X-API-Key`
    header.
  version: 2.0.0
servers:
  - url: https://toncenter.com/api/v2
  - url: https://testnet.toncenter.com/api/v2
security: []
tags:
  - name: accounts
    description: Information about accounts.
  - name: blocks
    description: Information about blocks.
  - name: transactions
    description: Fetching and locating transactions.
  - name: get config
    description: Get blockchain config
  - name: run method
    description: Run get method of smart contract.
  - name: send
    description: Send data to blockchain.
  - name: json rpc
    description: JSON-RPC endpoint.
paths:
  /getMasterchainInfo:
    get:
      tags:
        - blocks
      summary: Get Masterchain Info
      description: Get up-to-date masterchain state.
      operationId: get_masterchain_info_getMasterchainInfo_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMasterchainInfoResponse'
              examples:
                sample1:
                  summary: Example 1
                  value:
                    ok: true
                    result:
                      '@type': blocks.masterchainInfo
                      last:
                        '@type': ton.blockIdExt
                        workchain: -1
                        shard: '-9223372036854775808'
                        seqno: 51148696
                        root_hash: pdEYB4jzhoEFdOMdCgfXJ0z4vylDW27ETqVaSJEDyqs=
                        file_hash: l3sF5XbGapYGFnma+6dIk0fuZYdJYO4yAkNsjDkyxcc=
                      state_root_hash: qJ2FQ7fySAnOvgIKI9laL5Mgk8rQWT+Tc/O2xUFzwWs=
                      init:
                        '@type': ton.blockIdExt
                        workchain: -1
                        shard: '0'
                        seqno: 0
                        root_hash: F6OpKZKqvqeFp6CQmFomXNMfMj2EnaUSOXN+Mh+wVWk=
                        file_hash: XplPz01CXAps5qeSWUtxcyBfdAo5zVb1N979KLSKD24=
                      '@extra': 1755812855.1928415:3:0.47373957740114636
                sample2:
                  summary: Example 2
                  value:
                    ok: true
                    result:
                      '@type': blocks.masterchainInfo
                      last:
                        '@type': ton.blockIdExt
                        workchain: -1
                        shard: '-9223372036854775808'
                        seqno: 34539805
                        root_hash: z1gmtb/KbcNwHDVLOHphfDcYMfDtRyW5sTDLuNbPd2E=
                        file_hash: /3zsB+Lr0mONcRGZ+tx2jNC1VkOHCXfmjJ9Wai2iUlQ=
                      state_root_hash: /WR0k35BrgggvPUVglES3I4wt3SrHvU39T5YQQ0Dd2w=
                      init:
                        '@type': ton.blockIdExt
                        workchain: -1
                        shard: '0'
                        seqno: 0
                        root_hash: gj+B8wb/AmlPk1z1AhVI484rhrUpgSr2oSFIh56VoSg=
                        file_hash: Z+IKwYS54DmmJmesw/nAD5DzWadnOCMzee+kdgSYDOg=
                    '@extra': '1755812953:0:0.712'
        '422':
          description: Validation Error
        '504':
          description: Lite Server Timeout
      security: []
components:
  schemas:
    GetMasterchainInfoResponse:
      allOf:
        - $ref: '#/components/schemas/TonResponse'
        - type: object
          properties:
            result:
              $ref: '#/components/schemas/BlocksMasterchainInfo'
              description: Information about the latest masterchain block.
    TonResponse:
      properties:
        ok:
          type: boolean
          title: Ok
        result:
          anyOf:
            - type: string
            - items: {}
              type: array
            - type: object
          title: Result
        error:
          type: string
          title: Error
        code:
          type: integer
          title: Code
      type: object
      required:
        - ok
      title: TonResponse
    BlocksMasterchainInfo:
      type: object
      description: Information about the latest masterchain block.
      properties:
        '@type':
          type: string
          example: blocks.masterchainInfo
        last:
          $ref: '#/components/schemas/TonBlockIdExt'
        state_root_hash:
          type: string
        init:
          $ref: '#/components/schemas/TonBlockIdExt'
        '@extra':
          type: string
      required:
        - last
        - state_root_hash
        - init
    TonBlockIdExt:
      type: object
      properties:
        '@type':
          type: string
          example: ton.blockIdExt
        workchain:
          type: integer
        shard:
          type: string
          description: 64-bit signed integer as string
        seqno:
          type: integer
        root_hash:
          type: string
        file_hash:
          type: string
      required:
        - workchain
        - shard
        - seqno
        - root_hash
        - file_hash
      description: Extended block identifier.

````