Stacks Blockchain API

Interacting with the Stacks 2.0 Blockchain via API

Introduction

The Stacks 2.0 Blockchain API allows you to query the Stacks 2.0 blockchain and interact with smart contracts. It was built to maintain pageable materialized views of the Stacks 2.0 Blockchain.

The RESTful JSON API can be used without any authorization. The basepath for the API is:

# for mainnet, replace `testnet` with `mainnet` https://stacks-node-api.testnet.stacks.co/# for mainnet, replace `testnet` with `mainnet`https://stacks-node-api.testnet.stacks.co/

Stacks Node RPC API

The stacks-node implementation exposes JSON RPC endpoints.

All /v2/ routes a proxied to a Hiro-hosted Stacks Node. For a trustless architecture, you should make these requests to a self-hosted node.

Proxied Stacks Node RPC API endpoints

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:

Previous
Technical Specifications
Next
Running a mainnet node
Powered by