---
title: "Get block dates"
method: GET
path: "/when"
tags: ["Chain Data"]
---

# Get block dates

`GET /when`

Find block(s) based on date, blockNum, timestamp, or 'special'. Corresponds to the <a href="/chifra/chaindata/#chifra-when">chifra when</a> command line.

## Query parameters

- `blocks` string[]
- `list` boolean
- `timestamps` boolean
- `count` boolean
- `repair` boolean
- `check` boolean
- `update` boolean
- `deep` number
- `chain` string
- `noHeader` boolean
- `cache` boolean
- `decache` boolean
- `fmt` string

## Response `200`

returns the requested data

- object
  - `data` union[] — Produces <a href="/data-model/other/#count">Count</a>, <a href="/data-model/other/#message">Message</a>, <a href="/data-model/chaindata/#namedblock">NamedBlock</a> or <a href="/data-model/chaindata/#timestamp">Timestamp</a> data. Corresponds to the <a href="/chifra/chaindata/#chifra-when">chifra when</a> command line.
    - union
      - Count — the number of items in the given database
        - `count` number — the number of items in the given database
      - Message — used for various responses when no real data is generated
        - `msg` string, string — the message
        - `num` number — a number if needed
      - NamedBlock — a block that has been given a particular name such as `first` or `latest`
        - `blockNumber` number — the number of the block
        - `timestamp` number — the Unix timestamp of the block
        - `date` string, datetime — the timestamp as a date (calculated)
        - `name` string, string — an optional name for the block
        - `description` string, string — an optional description of the block
      - Timestamp — the timestamp, date and difference in timestamp of previous block produced by chifra when
        - `blockNumber` number — the number of the block
        - `timestamp` number — the Unix timestamp of the block
        - `date` string, datetime — the timestamp as a date (calculated)
        - `diff` number — the number of seconds since the last block

## Other responses

- `400` — bad input parameter

---

[API](https://skmtc.net/trueblocks/apis/trueblocks-api.md) · [All operations](https://skmtc.net/trueblocks/apis/trueblocks-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trueblocks/trueblocks-api/versions/2a176f1485a9/schema)
