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

# Get Blockchain Masterchain Blocks

> Get all blocks in all shards and workchains between target and previous masterchain block according to shards last blocks snapshot in masterchain.  We don't recommend to build your app around this method because it has problem with scalability and will work very slow in the future.



## OpenAPI

````yaml GET /v2/blockchain/masterchain/{masterchain_seqno}/blocks
openapi: 3.0.0
info:
  title: REST api to TON blockchain explorer
  version: 2.0.0
  description: Provide access to indexed TON blockchain
  contact:
    name: Support
    email: support@tonkeeper.com
servers:
  - url: https://tonapi.io
  - url: https://testnet.tonapi.io
  - url: http://localhost:8081
security: []
tags:
  - name: Accounts
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/accounts
  - name: NFT
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/nft
  - name: Jettons
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/jettons
  - name: DNS
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/dns
  - name: Wallet
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/wallet
  - name: Rates
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/rates
  - name: Staking
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/staking
  - name: Traces
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/traces
  - name: Events
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/events
  - name: Storage
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/storage
  - name: Connect
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/connect
  - name: Gasless
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/gasless
  - name: Multisig
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/multisig
  - name: Blockchain
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/blockchain
  - name: Lite Server
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/lite-server
  - name: Emulation
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/emulation
  - name: Utilities
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/utilities
  - name: ExtraCurrency
    externalDocs:
      description: Additional documentation
      url: https://docs.tonconsole.com/tonapi/rest-api/extra-currency
  - name: Purchases
paths:
  /v2/blockchain/masterchain/{masterchain_seqno}/blocks:
    get:
      tags:
        - Blockchain
      description: >-
        Get all blocks in all shards and workchains between target and previous
        masterchain block according to shards last blocks snapshot in
        masterchain.  We don't recommend to build your app around this method
        because it has problem with scalability and will work very slow in the
        future.
      operationId: getBlockchainMasterchainBlocks
      parameters:
        - $ref: '#/components/parameters/masterchainSeqno'
      responses:
        '200':
          description: blockchain blocks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlockchainBlocks'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    masterchainSeqno:
      in: path
      name: masterchain_seqno
      required: true
      description: masterchain block seqno
      schema:
        type: integer
        example: 123456
        format: int32
  schemas:
    BlockchainBlocks:
      type: object
      required:
        - blocks
      properties:
        blocks:
          type: array
          items:
            $ref: '#/components/schemas/BlockchainBlock'
    BlockchainBlock:
      type: object
      required:
        - workchain_id
        - shard
        - seqno
        - root_hash
        - file_hash
        - global_id
        - value_flow
        - version
        - after_merge
        - before_split
        - after_split
        - want_split
        - want_merge
        - key_block
        - gen_utime
        - start_lt
        - end_lt
        - vert_seqno
        - gen_catchain_seqno
        - min_ref_mc_seqno
        - prev_key_block_seqno
        - prev_refs
        - in_msg_descr_length
        - out_msg_descr_length
        - rand_seed
        - created_by
        - tx_quantity
      properties:
        tx_quantity:
          type: integer
          example: 130
        value_flow:
          $ref: '#/components/schemas/BlockValueFlow'
        workchain_id:
          type: integer
          example: 0
          format: int32
        shard:
          type: string
          example: '8000000000000000'
        seqno:
          type: integer
          example: 21734019
          format: int32
        root_hash:
          type: string
          example: 131D0C65055F04E9C19D687B51BC70F952FD9CA6F02C2801D3B89964A779DF85
        file_hash:
          type: string
          example: A6A0BD6608672B11B79538A50B2204E748305C12AA0DED9C16CF0006CE3AF8DB
        global_id:
          type: integer
          example: -239
          format: int32
        version:
          type: integer
          example: 0
          format: int32
        after_merge:
          type: boolean
          example: true
        before_split:
          type: boolean
          example: true
        after_split:
          type: boolean
          example: true
        want_split:
          type: boolean
          example: true
        want_merge:
          type: boolean
          example: true
        key_block:
          type: boolean
          example: true
        gen_utime:
          type: integer
          format: int64
          example: 1674826775
        start_lt:
          type: integer
          format: int64
          example: 23814011000000
          x-js-format: bigint
        end_lt:
          type: integer
          format: int64
          example: 23814011000001
          x-js-format: bigint
        vert_seqno:
          type: integer
          example: 0
          format: int32
        gen_catchain_seqno:
          type: integer
          example: 0
          format: int32
        min_ref_mc_seqno:
          type: integer
          example: 0
          format: int32
        prev_key_block_seqno:
          type: integer
          example: 0
          format: int32
        gen_software_version:
          type: integer
          example: 0
          format: int32
        gen_software_capabilities:
          type: integer
          format: int64
          example: 0
        master_ref:
          type: string
          example: (-1,4234234,8000000000000000)
        prev_refs:
          type: array
          items:
            type: string
            example:
              - (-1
              - 4234235
              - 8000000000000000)
        in_msg_descr_length:
          type: integer
          format: int64
          example: 0
        out_msg_descr_length:
          type: integer
          format: int64
          example: 0
        rand_seed:
          type: string
          example: 131D0C65055F04E9C19D687B51BC70F952FD9CA6F02C2801D3B89964A779DF85
        created_by:
          type: string
          example: A6A0BD6608672B11B79538A50B2204E748305C12AA0DED9C16CF0006CE3AF8DB
    BlockValueFlow:
      type: object
      required:
        - from_prev_blk
        - to_next_blk
        - imported
        - exported
        - fees_collected
        - fees_imported
        - recovered
        - created
        - minted
      properties:
        from_prev_blk:
          $ref: '#/components/schemas/BlockCurrencyCollection'
        to_next_blk:
          $ref: '#/components/schemas/BlockCurrencyCollection'
        imported:
          $ref: '#/components/schemas/BlockCurrencyCollection'
        exported:
          $ref: '#/components/schemas/BlockCurrencyCollection'
        fees_collected:
          $ref: '#/components/schemas/BlockCurrencyCollection'
        burned:
          $ref: '#/components/schemas/BlockCurrencyCollection'
        fees_imported:
          $ref: '#/components/schemas/BlockCurrencyCollection'
        recovered:
          $ref: '#/components/schemas/BlockCurrencyCollection'
        created:
          $ref: '#/components/schemas/BlockCurrencyCollection'
        minted:
          $ref: '#/components/schemas/BlockCurrencyCollection'
    BlockCurrencyCollection:
      type: object
      required:
        - grams
        - other
      properties:
        grams:
          type: integer
          format: int64
          example: 10000000000
          x-js-format: bigint
        other:
          type: array
          items:
            type: object
            required:
              - id
              - value
            properties:
              id:
                type: integer
                format: int64
                example: 13
              value:
                type: string
                x-js-format: bigint
                example: '10000000000'
  responses:
    Error:
      description: Some error during request processing
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
              error_code:
                type: integer
                format: int64

````