Stacks Blockchain API (v1.0.7)

Download OpenAPI specification:Download

Welcome to the API reference overview for the Stacks Blockchain API.

Download Postman collection

Accounts

Read-only endpoints to obtain Stacks account details

Get account balances

Retrieves total account balance information for a given Address or Contract Identifier. This includes the balances of STX Tokens, Fungible Tokens and Non-Fungible Tokens for the account.

path Parameters
principal
required
string

Stacks address or a Contract identifier (e.g. SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info)

query Parameters
unanchored
boolean
Default: false

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

until_block
string

returned data representing the state up until that point in time, rather than the current block.

Responses

Response samples

Content type
application/json
{
  • "stx": {
    },
  • "fungible_tokens": { },
  • "non_fungible_tokens": { }
}

Get account STX balance

Retrieves STX token balance for a given Address or Contract Identifier.

path Parameters
principal
required
string

Stacks address or a Contract identifier (e.g. SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info)

query Parameters
unanchored
boolean
Default: false

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

until_block
string

returned data representing the state up until that point in time, rather than the current block.

Responses

Response samples

Content type
application/json
{
  • "balance": "1000000",
  • "total_sent": "0",
  • "total_received": "1000000",
  • "lock_tx_id": "0xec94e7d20af8979b44d17a0520c126bf742b999a0fc7ddbcbe0ab21b228ecc8c",
  • "locked": "50000",
  • "lock_height": 100,
  • "burnchain_lock_height": 100,
  • "burnchain_unlock_height": 200
}

Get account transactions

Retrieves a list of all Transactions for a given Address or Contract Identifier. More information on Transaction types can be found here.

path Parameters
principal
required
string

Stacks address or a Contract identifier (e.g. SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info)

query Parameters
limit
integer

max number of account transactions to fetch

offset
integer

index of first account transaction to fetch

height
number

Filter for transactions only at this given block height

unanchored
boolean
Default: false

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

until_block
string

returned data representing the state up until that point in time, rather than the current block.

Responses

Response samples

Content type
application/json
{
  • "limit": 20,
  • "offset": 0,
  • "total": 4989,
  • "results": [
    ]
}

Get account transaction information for specific transaction

Retrieves transaction details for a given Transcation Id tx_id, for a given account or contract Identifier.

path Parameters
principal
required
string

Stacks address or a contract identifier

tx_id
required
string

Transaction id

Responses

Response samples