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

# Get block heights

> Commonly used to get all the block heights within a particular date range. Useful for rendering a display where you sort blocks by day.

<CardGroup cols={2}>
  <Card title="Credit Cost"> 1 per call</Card>
  <Card title="Processing"> Realtime</Card>
</CardGroup>

<Tip>
  Estimate your monthly cost for this API using the [Pricing Calculator](/pricing-calculator?endpoint=%2Fapi-reference%2Ffoundational-api%2Futility%2Fget-block-heights).
</Tip>


## OpenAPI

````yaml GET /v1/{chainName}/block_v2/{startDate}/{endDate}/
openapi: 3.1.0
info:
  title: GoldRush Multichain Data APIs
  version: 1.0.0
  description: Covalent's GoldRush Multichain Data APIs OpenAPI Schema.
servers:
  - url: https://api.covalenthq.com
security:
  - bearerAuth: []
paths:
  /v1/{chainName}/block_v2/{startDate}/{endDate}/:
    get:
      tags:
        - get-block-heights
      description: >-
        Commonly used to get all the block heights within a particular date
        range. Useful for rendering a display where you sort blocks by day.
      operationId: getBlockHeights
      parameters:
        - name: chainName
          in: path
          description: 'The chain name eg: `eth-mainnet`.'
          required: true
          schema:
            type: string
        - name: startDate
          in: path
          description: The start date in YYYY-MM-DD format.
          required: true
          schema:
            type: string
        - name: endDate
          in: path
          description: >-
            The end date in YYYY-MM-DD format or `latest` for the latest block
            available.
          required: true
          schema:
            type: string
        - name: page-size
          in: query
          description: Number of items per page. Omitting this parameter defaults to 100.
          required: false
          schema:
            type: integer
        - name: page-number
          in: query
          description: 0-indexed page number to begin pagination.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  updated_at:
                    type: string
                    format: date-time
                    description: >-
                      The timestamp when the response was generated. Useful to
                      show data staleness to users.
                  chain_id:
                    type: integer
                    description: 'The requested chain ID eg: `1`.'
                  chain_name:
                    type: string
                    description: 'The requested chain name eg: `eth-mainnet`.'
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        block_hash:
                          type: string
                          description: The hash of the block.
                        signed_at:
                          type: string
                          format: date-time
                          description: The block signed timestamp in UTC.
                        height:
                          type: integer
                          description: The block height.
                        block_parent_hash:
                          type: string
                          description: The parent block hash.
                        extra_data:
                          type: string
                          description: Extra data written to the block.
                        miner_address:
                          type: string
                          description: The address of the miner.
                        mining_cost:
                          type: integer
                          format: int64
                          description: The associated mining cost.
                        gas_used:
                          type: integer
                          format: int64
                          description: The associated gas used.
                        gas_limit:
                          type: integer
                          format: int64
                          description: The associated gas limit.
                        transactions_link:
                          type: string
                          description: The link to the related tx by block endpoint.
                    description: List of response items.
                  pagination:
                    type: object
                    properties:
                      has_more:
                        type: boolean
                        description: True if there is another page.
                      page_number:
                        type: integer
                        description: The requested page number.
                      page_size:
                        type: integer
                        description: The requested number of items on the current page.
                      total_count:
                        type: integer
                        description: >-
                          The total number of items across all pages for this
                          request.
                    description: Pagination metadata.
      x-codeSamples:
        - lang: TypeScript
          label: GoldRush SDK
          source: |-
            import { GoldRushClient } from "@covalenthq/client-sdk";

            const ApiServices = async () => {
                const client = new GoldRushClient("<GOLDRUSH_API_KEY>");
                const resp = await client.BaseService.getBlockHeights({chainName: "chainName", walletAddress: "walletAddress"});
                console.log(resp.data);
            };

            ApiServices();
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form: `Bearer <token>`, where
        `<token>` is your GoldRush API Key.

````