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

# Get Block

> Returns full Bitcoin block data including transactions, inputs, outputs, and UTXO-level detail.

export const EndpointMeta = ({premium, cus, cusUnit, mainnetOnly}) => {
  const items = [];
  const planName = typeof premium === "string" ? premium : "Pro";
  if (premium) {
    items.push({
      icon: "\u26a0\ufe0f",
      label: "Premium endpoint",
      text: <>
          Requires the <strong>{planName} plan</strong> or above.{" "}
          <a href="/data-api/introduction/resources/premium-endpoints">
            View all
          </a>
          .
        </>
    });
  }
  if (cus) {
    const isDynamic = !!cusUnit;
    items.push({
      icon: "\u26a1",
      label: isDynamic ? "Dynamic cost" : "Endpoint cost",
      text: isDynamic ? <>
          {cus} CUs per {cusUnit}.{" "}
          <a href="/get-started/pricing#dynamic-endpoints">Learn more</a>.
        </> : <>
          {cus} CUs.{" "}
          <a href="/get-started/pricing">Learn more</a>.
        </>
    });
  }
  if (mainnetOnly) {
    items.push({
      icon: "\ud83d\udd17",
      label: "Mainnet only",
      text: <>Testnet chains are not supported.</>
    });
  }
  if (items.length === 0) return null;
  return <div className="endpoint-meta" style={{
    border: "1px solid var(--border-color, #e2e8f0)",
    borderRadius: "8px",
    overflow: "hidden",
    marginBottom: "16px",
    fontSize: "14px",
    lineHeight: "1.6",
    maxWidth: "100%"
  }}>
      <style dangerouslySetInnerHTML={{
    __html: `
            .endpoint-meta {
              --border-color: #e2e8f0;
              --row-bg: #f8fafc;
              --label-color: #0f172a;
              --text-color: #1f2937;
            }
            .endpoint-meta a {
              color: #0f7fff !important;
              text-decoration: underline;
            }
            @media (prefers-color-scheme: dark) {
              .endpoint-meta {
                --border-color: #374151 !important;
                --row-bg: #1e293b !important;
                --label-color: #f9fafb !important;
                --text-color: #e5e7eb !important;
              }
              .endpoint-meta a {
                color: #60a5fa !important;
              }
            }
            html.dark .endpoint-meta,
            [data-theme="dark"] .endpoint-meta {
              --border-color: #374151 !important;
              --row-bg: #1e293b !important;
              --label-color: #f9fafb !important;
              --text-color: #e5e7eb !important;
            }
            html.dark .endpoint-meta a,
            [data-theme="dark"] .endpoint-meta a {
              color: #60a5fa !important;
            }
          `
  }} />
      {items.map((item, i) => <div key={i} style={{
    display: "flex",
    alignItems: "baseline",
    gap: "8px",
    padding: "10px 14px",
    borderBottom: i < items.length - 1 ? "1px solid var(--border-color, #e2e8f0)" : "none",
    backgroundColor: "var(--row-bg, #f8fafc)"
  }}>
          <span style={{
    flexShrink: 0
  }}>{item.icon}</span>
          <span style={{
    wordBreak: "break-word",
    color: "var(--text-color, #1f2937)"
  }}>
            <strong style={{
    color: "var(--label-color, #0f172a)"
  }}>
              {item.label}:
            </strong>{" "}
            {item.text}
          </span>
        </div>)}
    </div>;
};

<EndpointMeta cus={100} />

<Note>
  For Bitcoin, pass `bitcoin` (or `bitcoin-mainnet`) as `chainAlias`. The `blockIdentifier` accepts either a Bitcoin block height (all-digit values are treated as heights) or a block hash (any other value is forwarded as a hash).
</Note>


## OpenAPI

````yaml /openapi-files/data-api/bitcoin-api-v1.json GET /v1/chains/{chainAlias}/blocks/{blockIdentifier}
openapi: 3.0.0
info:
  title: Moralis Bitcoin Data API
  description: >-
    Bitcoin-scoped view of the Moralis Universal API. Every endpoint below is a
    Universal endpoint with chain inputs restricted to Bitcoin for clarity.
  version: '1.0'
servers:
  - url: https://api.moralis.com
security: []
externalDocs:
  description: Moralis API Docs
  url: https://docs.moralis.com
paths:
  /v1/chains/{chainAlias}/blocks/{blockIdentifier}:
    get:
      tags:
        - Blocks
      summary: Get a Bitcoin block by height or hash
      description: >-
        Returns full Bitcoin block data including transactions, inputs, outputs,
        and UTXO-level detail.
      operationId: getBlockByNumberOrHash
      parameters:
        - name: blockIdentifier
          required: true
          in: path
          description: >-
            Bitcoin block identifier. Accepts either a block height (all-digit
            values) or a block hash.
          examples:
            byHeight:
              value: '800000'
            byHash:
              value: 0000000000000000000010ec03ff89b4ed4a8d50aaa3e2e29c5b15dcf8a26ddc
          schema:
            type: string
        - name: enrich
          required: false
          in: query
          description: >-
            Master switch for ABI decoding enrichment (method labels, decoded
            logs, decoded input). Defaults to false.
          schema:
            default: false
            type: boolean
        - name: includeMethodLabel
          required: false
          in: query
          description: Include method labels on transactions (overrides enrich).
          schema:
            type: boolean
        - name: decodeInput
          required: false
          in: query
          description: Decode transaction input data (overrides enrich).
          schema:
            type: boolean
        - name: decodeLogs
          required: false
          in: query
          description: Decode log events (overrides enrich).
          schema:
            type: boolean
        - name: includedTopicZeros
          required: false
          in: query
          description: Whitelist logs by topic0 (comma-separated hex values).
          schema:
            type: string
        - name: excludeFields
          required: false
          in: query
          description: >-
            Fields to exclude from response (comma-separated: logs,
            internalTransactions, tokenTransfers, etc.).
          schema:
            type: string
        - name: chainAlias
          required: true
          in: path
          description: Bitcoin chain alias. Pass `bitcoin` or `bitcoin-mainnet`.
          schema:
            type: string
            enum:
              - bitcoin
              - bitcoin-mainnet
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BitcoinBlockDto'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    BitcoinBlockDto:
      type: object
      properties:
        page:
          type: number
          description: Page number (always 1, no pagination)
        totalPages:
          type: number
          description: Total pages (always 1)
        itemsOnPage:
          type: number
          description: Number of transactions on this page (equals txCount)
        hash:
          type: string
          description: Block hash
        previousBlockHash:
          type: string
          description: Parent block hash
        height:
          type: number
          description: Block height (block number as integer)
        size:
          type: number
          description: Block size in bytes
        time:
          type: number
          description: Block timestamp as Unix seconds
        txCount:
          type: number
          description: Number of transactions
        chainFamily:
          type: string
          enum:
            - Bitcoin
          description: Chain family discriminator used to identify the response variant
        txs:
          description: Full transaction list
          type: array
          items:
            $ref: '#/components/schemas/BitcoinTransactionDto'
        bitcoinSpecific:
          description: Bitcoin-specific block fields
          allOf:
            - $ref: '#/components/schemas/BitcoinBlockSpecificDto'
        meta:
          $ref: '#/components/schemas/SingleChainResponseMetaDto'
      required:
        - page
        - totalPages
        - itemsOnPage
        - hash
        - previousBlockHash
        - height
        - size
        - time
        - txCount
        - chainFamily
        - txs
        - bitcoinSpecific
        - meta
    BitcoinTransactionDto:
      type: object
      properties:
        txid:
          type: string
          description: Transaction hash
        vin:
          description: Transaction inputs
          type: array
          items:
            $ref: '#/components/schemas/VinDto'
        vout:
          description: Transaction outputs
          type: array
          items:
            $ref: '#/components/schemas/VoutDto'
        blockHash:
          type: string
          nullable: true
          description: Block hash (null for unconfirmed/mempool transactions)
        blockHeight:
          type: number
          description: Block height
        blockTime:
          type: number
          description: Block timestamp as Unix seconds
        value:
          type: string
          description: Value transferred
        fees:
          type: string
          description: Transaction fee
        tokenTransfers:
          nullable: true
          description: Token transfers
          type: array
          items:
            $ref: '#/components/schemas/SimpleTokenTransferDto'
        chainFamily:
          type: string
          enum:
            - Bitcoin
          description: Chain family discriminator used to identify the response variant
        bitcoinSpecific:
          description: Bitcoin-specific transaction fields
          allOf:
            - $ref: '#/components/schemas/BitcoinTransactionSpecificDto'
        meta:
          $ref: '#/components/schemas/SingleChainResponseMetaDto'
      required:
        - txid
        - vin
        - vout
        - blockHash
        - blockHeight
        - blockTime
        - value
        - fees
        - tokenTransfers
        - chainFamily
        - bitcoinSpecific
        - meta
    BitcoinBlockSpecificDto:
      type: object
      properties:
        bits:
          type: string
          nullable: true
          description: Target difficulty bits in compact representation
        chainwork:
          type: string
          nullable: true
          description: Cumulative chain work — total proof-of-work
        difficulty:
          type: string
          nullable: true
          description: Block difficulty
        merkleRoot:
          type: string
          nullable: true
          description: Merkle root of all transactions
        miner:
          type: string
          nullable: true
          description: Coinbase/miner address
        nonce:
          type: string
          nullable: true
          description: Block nonce
        weight:
          type: string
          nullable: true
          description: Block weight — SegWit metric
        witnessCommitment:
          type: string
          nullable: true
          description: SegWit witness commitment (BIP 141)
      required:
        - bits
        - chainwork
        - difficulty
        - merkleRoot
        - miner
        - nonce
        - weight
        - witnessCommitment
    SingleChainResponseMetaDto:
      type: object
      properties:
        syncedAt:
          type: object
          description: Last ingested block number per chain ID
          additionalProperties:
            type: number
          example:
            bitcoin: latest
      required:
        - syncedAt
    VinDto:
      type: object
      properties:
        txid:
          type: string
          nullable: true
          description: UTXO input transaction ID (Bitcoin only)
        vout:
          type: number
          nullable: true
          description: UTXO output index spent by this input (Bitcoin only)
        sequence:
          type: number
          nullable: true
          description: UTXO input sequence number (Bitcoin only)
        'n':
          type: number
          description: Input index (always 0 for account-model chains)
        addresses:
          description: Sender addresses
          type: array
          items:
            type: string
        isAddress:
          type: boolean
          description: Whether addresses are valid
        value:
          type: string
          nullable: true
          description: Input value (UTXO inputs)
        hex:
          type: string
          nullable: true
          description: Script hex (Bitcoin only)
      required:
        - txid
        - vout
        - sequence
        - 'n'
        - addresses
        - isAddress
        - value
        - hex
    VoutDto:
      type: object
      properties:
        'n':
          type: number
          description: Output index
        value:
          type: string
          description: Output value
        addresses:
          description: Recipient addresses
          type: array
          items:
            type: string
        isAddress:
          type: boolean
          description: Whether addresses are valid
        spent:
          type: boolean
          nullable: true
          description: Whether output is spent (UTXO only)
        hex:
          type: string
          nullable: true
          description: Script hex (Bitcoin only)
      required:
        - 'n'
        - value
        - addresses
        - isAddress
        - spent
        - hex
    SimpleTokenTransferDto:
      type: object
      properties:
        type:
          type: string
          description: Token type (ERC20, ERC721, etc.)
        from:
          type: string
          description: Sender address
        to:
          type: string
          description: Recipient address
        token:
          type: string
          description: Token contract address
        name:
          type: string
          description: Token name
        symbol:
          type: string
          description: Token symbol
        decimals:
          type: number
          description: Token decimals
        value:
          type: string
          description: Amount transferred
      required:
        - type
        - from
        - to
        - token
        - name
        - symbol
        - decimals
        - value
    BitcoinTransactionSpecificDto:
      type: object
      properties:
        version:
          type: number
          nullable: true
          description: Transaction version
        locktime:
          type: number
          nullable: true
          description: Transaction locktime
        weight:
          type: number
          nullable: true
          description: Transaction weight (SegWit)
        vsize:
          type: number
          nullable: true
          description: Virtual size in vbytes
        valueIn:
          type: string
          nullable: true
          description: Total input value in satoshis
        hex:
          type: string
          nullable: true
          description: Raw transaction hex
        miscJson:
          type: string
          nullable: true
          description: >-
            Raw Blockbook miscJson. Null when successfully parsed into
            structured fields (vin/vout, version, locktime, etc.)
      required:
        - version
        - locktime
        - weight
        - vsize
        - valueIn
        - hex
        - miscJson
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````