Get account STX balance

Retrieves the STX token balance for a specified address or contract identifier.

GET
/extended/v1/address/{principal}/stx

Path Parameters

principalSTX Address & Smart Contract ID

Query Parameters

unanchored?boolean

Include data from unanchored (i.e. unconfirmed) microblocks

Defaultfalse
until_block?string

Block hash or block height. Return data representing the state up until that point in time, rather than the current block. Note - Use either of the query parameters but not both at a time.

Response Body

GET request that returns address balances

TypeScript Definitions

Use the response body type in TypeScript.

balancestring
estimated_balance?string

Total STX balance considering pending mempool transactions

pending_balance_inbound?string

Inbound STX balance from pending mempool transactions

pending_balance_outbound?string

Outbound STX balance from pending mempool transactions

total_sent?string
total_received?string
total_fees_sent?string
total_miner_rewards_receivedstring
lock_tx_idstring

The transaction where the lock event occurred. Empty if no tokens are locked.

lockedstring

The amount of locked STX, as string quoted micro-STX. Zero if no tokens are locked.

lock_heightinteger

The STX chain block height of when the lock event occurred. Zero if no tokens are locked.

burnchain_lock_heightinteger

The burnchain block height of when the lock event occurred. Zero if no tokens are locked.

burnchain_unlock_heightinteger

The burnchain block height of when the tokens unlock. Zero if no tokens are locked.

token_offering_locked?AddressTokenOfferingLocked

Token Offering Locked

Default Response

TypeScript Definitions

Use the response body type in TypeScript.

errorstring
message?string
[key: string]any
curl -X GET "https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/stx?unanchored=true&until_block=string"
fetch("https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/stx?unanchored=true&until_block=string")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/stx?unanchored=true&until_block=string"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/stx?unanchored=true&until_block=string"

response = requests.request("GET", url)

print(response.text)
{
  "balance": "string",
  "estimated_balance": "string",
  "pending_balance_inbound": "string",
  "pending_balance_outbound": "string",
  "total_sent": "string",
  "total_received": "string",
  "total_fees_sent": "string",
  "total_miner_rewards_received": "string",
  "lock_tx_id": "string",
  "locked": "string",
  "lock_height": 0,
  "burnchain_lock_height": 0,
  "burnchain_unlock_height": 0,
  "token_offering_locked": {
    "total_locked": "string",
    "total_unlocked": "string",
    "unlock_schedule": [
      {
        "amount": "string",
        "block_height": 0
      }
    ]
  }
}
{
  "error": "string",
  "message": "string"
}