> For the complete documentation index, see [llms.txt](https://gitbook.humanode.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.humanode.io/docs/tools-and-services/substrate-api-sidecar.md).

# Substrate API Sidecar

## About

The [Substrate API Sidecar](https://github.com/paritytech/substrate-api-sidecar) is an external application that provides a more convenient HTTP API on top of the low-level JSON-RPC API that node exposes.

Humanode network can be used with Substrate API Sidecar, although some of the Humanode specific APIs are not exposed.

If you are an app developer, and you need a quick way to do some common blockchain operations (e.g. balance transfer), consider using the Substrate API Sidecar.

## Usage

{% tabs %}
{% tab title="Node.js" %}

1. Install Node.js.
2. Install the Substrate API Sidecar.

   ```shell
   npm install -g @substrate/api-sidecar
   ```
3. Run the sidecar process and connect to Humanode network.

   ```shell
   SAS_SUBSTRATE_URL=<URL> substrate-api-sidecar
   ```

   Replace `<URL>` with the right JSON-RPC URL from the [chains](/docs/chains.md) page, or use your own.
   {% endtab %}

{% tab title="Docker" %}

1. Install Docker.
2. Run the Substrate API Sidecar image.

   ```shell
   docker run --rm -it \
     -p 8080:8080 \
     -e "SAS_SUBSTRATE_URL=<URL>" \
     parity/substrate-api-sidecar:latest
   ```

   Replace `<URL>` with the right JSON-RPC URL from the [chains](/docs/chains.md) page, or use your own.
   {% endtab %}
   {% endtabs %}

You can now send the simple HTTP requests and get simple JSON responses instead of dealing with the Substrate JSON-RPC protocol specifics.

```shell
$ curl -sS 'http://127.0.0.1:8080/accounts/hmpwhPbL5XJTYPWd3Gw9dUzdWrPwx2nbMFK7CmCQTrYNSfrW4/balance-info' | jq .
{
  "at": {
    "hash": "0x50c54161a09a127324de2e7a5c10d01458b896a4eef4905243c23c5c35f17827",
    "height": "796175"
  },
  "nonce": "0",
  "tokenSymbol": "HMND",
  "free": "353780945734999999999999000",
  "reserved": "0",
  "miscFrozen": "0",
  "feeFrozen": "0",
  "locks": []
}
```
