# Stacks Node RPC

{% hint style="info" %}
For the complete OpenAPI spec, navigate [here](https://raw.githubusercontent.com/stacks-network/stacks-core/master/docs/rpc/openapi.yaml).
{% endhint %}

The Stacks Node RPC API is exposed by every running Stacks node. It allows you to query the Stacks blockchain and interact with smart contracts. It was built to maintain pageable materialized views of the Stacks network.

<details>

<summary>Who is this API for?</summary>

The Stacks Node RPC API is designed for developers who want to self-host their own Stacks node and API to achieve a more decentralized setup. It is ideal for those seeking greater control over their connection to the Stacks network, allowing them to run their own infrastructure. These RPC API endpoints, by default, are available when running your own Stacks node.

</details>

{% hint style="warning" %}
If you run a local Stacks node, it exposes an HTTP server on port `20443`. The info endpoint would be `localhost:20443/v2/info`.
{% endhint %}

{% hint style="info" %}
Looking for the indexed Stacks Blockchain API? See the [Stacks Blockchain API reference](https://docs.stacks.co/reference/api/stacks-blockchain-api).
{% endhint %}

Note that the [Stacks Node RPC API](https://github.com/stacks-network/stacks-blockchain/) and the [Hiro Stacks Blockchain API](https://www.hiro.so/stacks-api) are two different things. The Hiro API is a centralized service run by Hiro, a developer tooling company, that makes it easy to get onboarded and begin interacting with the Stacks blockchain in a RESTful way. The Hiro API is a proxy for the Stacks Node RPC API that makes it a bit easier to work with by providing additional functionality.

The Stacks Node RPC API is generated by every Stacks node and allows developers to self-host their own node and API for a more decentralized architecture.

The RPC API can be used without any authorization. The basepath for the hosted API is:

```bash
# for mainnet, replace `testnet` with `mainnet`
https://api.testnet.hiro.so/
```
