ForceX

Chain

Get Block

Block detail by height or block hash.

Page Sections

GET

/chain/block/{height_or_hash}

Full URL: https://forcex.com/xtract/v1/litecoin/chain/block/{height_or_hash}

Credit cost: 1 credit by default. Include expansions add cost.

curl -H "Authorization: Bearer fx_live_************" \
  "https://forcex.com/xtract/v1/litecoin/chain/block/3118767?include=stats"

Parameters

NameLocationRequiredTypeDescription
height_or_hashpathyesstring
includequerynostring | nullComma-separated expansions: `classification`, `mweb`, `stats`, `transactions`, `transactions.inputs`, `transactions.outputs`. `all` expands to every token. `classification` requires `transactions` (auto-added); `transactions.inputs` requires `transactions` (auto-added); `transactions.outputs` requires `transactions` (auto-added). `classification` attaches `Classification` records (see components) — the analytics-registry rows the handler returns, one per active methodology, an empty array when none exist. `transactions` is capped (see `transactions_limit` / `transactions_truncated` in `included`) and is withheld with 503 `data_unavailable` when the block's transaction list cannot be certified against its header. unknown tokens return 400 `invalid_include`; the expansions actually served are listed in `meta.included_expansions`.

Request Body

No request body.

Example Response

Representative trimmed response. Use the OpenAPI schema for the exhaustive field contract.

{
  "data": {
    "height": 3118767,
    "hash": "000000000000207bb6f3f5c94745014a3db9402ce22ef7f83ede043b1ed7d19f",
    "block_time": "2026-06-03T17:22:51Z",
    "tx_count": 179
  },
  "included": {
    "stats": {
      "size_bytes": 137020,
      "weight": 399220
    }
  },
  "meta": {
    "served_from": "indexed_store",
    "included_expansions": [
      "stats"
    ],
    "credit_cost": 2
  }
}

Documented Responses

StatusDescription
200Successful Response
400Bad request. The `error.code` field identifies the specific cause: `bad_request` (general validation failure, including malformed dates, out-of-order ranges, and request-body validation), `range_too_large` (date range exceeds the per-grain cap), `ambiguous_time_range` (legacy `from`/`to` and new `start`/`end` supplied with differing values), or `invalid_include` (unsupported expansion in `?include=`).
401Authentication required, or the supplied Bearer token is invalid or revoked. `error.code` = `auth_required`.
402Payment-tier gate. `error.code` identifies which gate fired: `subscription_required` (no active subscription on the account), `subscription_inactive` (subscription exists but is not active), `include_all_requires_paid_tier` (Free-tier keys cannot request `?include=all`), `include_set_requires_paid_tier` (the requested include set exceeds the per-request cost cap for Free-tier keys), `historical_scan_requires_paid_tier` (legacy test keys cannot scan outside the recent window), or `deep_pagination_requires_paid_tier` (Free-tier keys cannot page beyond the depth cap).
403Authenticated but the key lacks the required scope. `error.code` = `scope_insufficient`.
404Entity not found. `error.code` = `not_found`. Returned on direct entity GETs only — the `/chain/search` endpoint returns 200 with an empty/`not_found`-shaped body instead.
422Defense-in-depth: the runtime maps standard request-shape validation errors to 400, so partners normally see 400 instead of 422. This status is declared so any edge-case validation path that bypasses the override is still typed.
429Rate limit or credit budget exceeded. `error.code` identifies the window: `rate_limit_exceeded` (per-second or per-minute), `quota_exceeded_daily` (Free-tier per-day budget), or `quota_exceeded` (per-subscription-period). The body carries a `window` field (`second`, `minute`, `day`, or `month`) naming the failing limit. Responses include the standard `Retry-After` header.
500Internal server error. `error.code` = `internal_error`. Reference `meta.request_id` when contacting support.
503Service or downstream data store is temporarily unavailable, or the endpoint is not implemented in this API version. `error.code` identifies the cause: `data_unavailable` (chain tip not yet populated), `audit_unavailable` (request completed but audit could not be acknowledged — safe to retry), `plan_misconfigured` (operational issue on the API side; not a tier problem), or `endpoint_not_available` (the route is reserved and not yet served in this version).

Integration Notes

  • `height_or_hash` accepts a block height or a 64-character block hash.
  • Heavy include sets may be blocked on Free-tier keys by the per-request cost cap.
  • `include=stats` now carries the complete canonical, unit-explicit block-statistics set (counts, values, fee percentiles p10-p90, sizes/weights, UTXO deltas). Prefer the canonical `subsidy_value_atomic_units` field; the legacy `subsidy_atomic_units` key is retained for compatibility only.
  • `include=classification` attaches `Classification` records to each returned transaction (`methodology_id`, `methodology_name`, `classification_value`, `version` — the component published in the OpenAPI document), one per active methodology, an empty array when none exist; `classification_scope` states that only the returned transactions carry them.
  • `include=transactions` is certified against the served block header before it is returned (membership by block hash, `tx_count`, transaction order and merkle root). A list that cannot be certified is withheld with `503 data_unavailable` rather than served incomplete.
  • Spend state is read deletion-safely: the winning version of each output and of each spend record is selected before deletion markers are applied, so a reversed spend reads as unspent and a later re-spend reads at its new height; reads are narrowed to the output's parent block (no maximum spend age — an output can be spent at any later height). `spent` is true only when a live spend record exists (previously an unspent output could report `spent: true`).