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

# Get block by number

> Get the detail of a block by the given block number.



## OpenAPI

````yaml get /v1/block/detail
openapi: 3.0.2
info:
  title: 🛠️ Basic API
  version: v1.0.0
servers:
  - url: https://api.chainbase.online
    description: production server
security: []
paths:
  /v1/block/detail:
    get:
      tags:
        - Block
      summary: Get block by number
      description: Get the detail of a block by the given block number.
      operationId: GetBlockDetail
      parameters:
        - description: >-
            chain network id, see [list of
            details](/platform/features/api/web3-api)
          required: true
          schema:
            title: Chain Id
            type: integer
            description: >-
              chain network id, see [list of
              details](/platform/features/api/web3-api)
          example: '1'
          name: chain_id
          in: query
        - description: Block number
          required: true
          schema:
            title: Number
            type: string
            description: Block number
          name: number
          in: query
        - required: true
          schema:
            title: X-Api-Key
            type: string
            example: demo
          example: demo
          name: x-api-key
          in: header
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseGetBlockDetail'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    ResponseGetBlockDetail:
      title: ResponseGetBlockDetail
      required:
        - data
      type: object
      properties:
        code:
          title: Code
          type: integer
          default: 0
        message:
          title: Message
          type: string
          default: ok
        data:
          $ref: '#/components/schemas/BlockDetail'
    ErrorMessage:
      title: ErrorMessage
      required:
        - code
        - message
      type: object
      properties:
        code:
          title: Code
          type: integer
        message:
          title: Message
          type: string
    BlockDetail:
      title: BlockDetail
      required:
        - number
        - hash
        - parent_hash
        - timestamp
        - difficulty
        - extra_data
        - gas_limit
        - gas_used
        - base_fee_per_gas
        - miner
        - mix_hash
        - nonce
        - receipts_root
        - sha3_uncles
        - size
        - state_root
        - transactions_root
        - transactions_count
        - uncles_count
        - withdrawals_count
      type: object
      properties:
        number:
          title: Number
          type: integer
        hash:
          title: Hash
          type: string
        parent_hash:
          title: Parent Hash
          type: string
        timestamp:
          title: Timestamp
          type: string
        difficulty:
          title: Difficulty
          type: string
        extra_data:
          title: Extra Data
          type: string
        gas_limit:
          title: Gas Limit
          type: integer
        gas_used:
          title: Gas Used
          type: integer
        base_fee_per_gas:
          title: Base Fee Per Gas
          type: integer
        miner:
          title: Miner
          type: string
        mix_hash:
          title: Mix Hash
          type: string
        nonce:
          title: Nonce
          type: string
        receipts_root:
          title: Receipts Root
          type: string
        sha3_uncles:
          title: Sha3 Uncles
          type: string
        size:
          title: Size
          type: integer
        state_root:
          title: State Root
          type: string
        transactions_root:
          title: Transactions Root
          type: string
        transactions_count:
          title: Transactions Count
          type: integer
        uncles_count:
          title: Uncles Count
          type: integer
        withdrawals_count:
          title: Withdrawals Count
          type: integer

````