Stacks Blockchain API

Interacting with the Stacks 2.0 Blockchain via API


The Stacks 2.0 Blockchain API was built to maintain pageable materialized views of the Stacks 2.0 Blockchain. It is a server that exposes a RESTful JSON API and WebSockets, hosted by PBC. It introduces aidditonal functionality (e.g. get all transactions), as well as proxies calls directly to Stacks Node. You can find the OpenAPI specification and documentation here.

Client library

A generated JS Client is available for consumption of this API. The client library enables typesafe REST and WebSocket communication. Please review the client documentation for more details.

Stacks Node RPC API

The Stacks 2.0 Blockchain API is centrally-hosted. However, every running Stacks node exposes an RPC API, which allows you to interact with the underlying blockchain. Instead of using a centrally-hosted API, you can directly access the RPC API of a locally-hosted Node.

While the Node RPC API doesn't give the same functionality as the hosted Stacks 2.0 Blockchain API, you get similar functionality in a way that is scoped to that specific node. The RPC API includes the following endpoints:

Legacy API

If you are looking for the Stacks 1.0 RPC endpoint references, please follow this link.

Stacking Contract
Stacks Node Configuration