For the complete documentation index, see llms.txt. This page is also available as Markdown.

Stacks

GetBlock provides fast and reliable access to Stacks nodes via the REST API. Connect to the Stacks network without running your own infrastructure.

Stacks is a Bitcoin Layer-2 that brings smart contracts and decentralized apps to Bitcoin: its Clarity contracts can read Bitcoin state, and through the Nakamoto release and sBTC, Stacks transactions settle with Bitcoin finality. The native token is STX, denominated in microSTX (1 STX = 1,000,000 microSTX). GetBlock exposes Stacks through its node RPC API: a path-addressed HTTP + JSON interface under /v2 where reads use GET and transaction broadcast, read-only contract calls, and fee estimation use POST.

Key Features

  • Bitcoin Layer-2: Clarity smart contracts that can read Bitcoin state; transactions anchor to Bitcoin

  • Node RPC API: A path-addressed /v2 HTTP + JSON interface — not a JSON-RPC envelope and not eth_*; the resource is chosen by the URL path

  • STX / microSTX: Balances and fees are denominated in microSTX (1 STX = 1,000,000 microSTX); account balances are returned hex-encoded

  • Clarity Contracts: Read contract interfaces and source, call read-only functions, and read maps, variables, and constants

  • Decidable Language: Clarity is interpreted and decidable — no compiler, and contract source is readable on-chain

  • Build-Sign-Broadcast: Estimate fees, sign client-side, then broadcast the serialized transaction

TECHNICAL DISCLAIMER: AUTHORITATIVE REST API SPECIFICATION.

GetBlock's API reference documentation is provided exclusively for informational purposes and to optimize the developer experience. Stacks' node RPC is documented by the Stacks project; the canonical specification is the stacks-core node RPC at docs.stacks.co, and developer guidance is published by Hiro at docs.hiro.so. This reference documents the node's developer-facing /v2 read and broadcast surface; internal P2P, consensus, and StackerDB routes are omitted.

Network Information

Property
Value

Network Name

Stacks Mainnet

Native Currency

STX (1 STX = 1,000,000 microSTX)

Settlement Layer

Bitcoin

Contract Language

Clarity

API

Node RPC API (HTTP + JSON) under /v2

Base URL

Supported Networks

Network
API
Frankfurt, Germany
New York, USA
Singapore, Singapore

Mainnet

REST (/v2)

✅

✅

✅

Quickstart

1

Setup project

2

Install dependency

3

Add code

4

Run the script

5

Response

1

Setup project

2

Install dependency

3

Add code

4

Run the script

Available REST Endpoints

Node & Network

Endpoint
Method
Description

info

GET

Returns core node information: peer and server version, network ID, the current burnchain (Bitcoin) block height, the Stacks chain tip height and hash, tenure height, and sync status.

pox

GET

Returns Proof-of-Transfer (PoX) details: the active PoX contract, cycle lengths, total liquid supply, and the current and next reward cycles with their stacking thresholds.

Accounts & Fees

Endpoint
Method
Description

accounts

GET

Returns an account's STX balance, locked (stacked) balance, unlock height, and next nonce. Balances are hex-encoded microSTX. A principal is a standard address or a contract principal (address.contract-name).

fees-transfer

GET

Returns the estimated fee rate for a standard STX token-transfer transaction, in microSTX per byte.

fees-transaction

POST

Returns approximate fees for a given transaction payload, as low/middle/high estimations, based on the serialized payload and its estimated length.

Transactions

Endpoint
Method
Description

transactions

POST

Broadcasts a signed, serialized transaction to the network. The body is the raw transaction bytes (hex string with application/json, or raw bytes with application/octet-stream). On acceptance the node returns the transaction ID.

Contracts

Endpoint
Method
Description

contract-interface

GET

Returns the interface (ABI) of a deployed Clarity contract: its public and read-only functions, data variables, maps, fungible and non-fungible tokens, and the Clarity version.

contract-source

GET

Returns the Clarity source code of a deployed contract, the block height at which it was published, and (optionally) a MARF proof.

call-read

POST

Calls a read-only Clarity function and returns its result, without creating a transaction. Arguments are hex-encoded Clarity values; the result is a hex-encoded Clarity value.

Contract State

Endpoint
Method
Description

map-entry

POST

Returns the value stored at a key in a contract's data map. The request body is the hex-encoded Clarity value of the key; the response is the hex-encoded Clarity value and an optional MARF proof.

constant-val

GET

Returns the value of a constant defined in a contract, as a hex-encoded Clarity value.

data-var

GET

Returns the current value of a contract data variable, as a hex-encoded Clarity value, with an optional MARF proof.

traits

GET

Reports whether a contract implements a given trait, identified by the trait's deployer, contract, and trait name.

Support

For technical support and questions:

See Also

Last updated

Was this helpful?