Stacks Blockchain API
vv8.11.4https://stacks.nownodes.iohttps://stacks.nownodes.ioLocalAuthentication
api-keyAuthapiKeyAPI Key: api-key in header
Node
Accounts
Read-only endpoints to obtain Stacks account details
Get account assets
Retrieves a list of all assets events associated with an account or a Contract Identifier. This includes Transfers, Mints.
Parameters
limitinteger[0, 100]20queryResults per page
offsetinteger>= 00queryResult offset
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
until_blockstringqueryBlock 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.
principalstring | stringrequiredpathResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet inbound STX transfers
Retrieves a list of STX transfers with memos to the given principal. This includes regular transfers from a stx-transfer transaction type,
and transfers from contract-call transactions a the send-many-memo bulk sending contract.
Parameters
limitinteger[0, 50]20queryResults per page
offsetinteger>= 00queryResult offset
heightintegerqueryFilter for transactions only at this given block height
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
until_blockstringqueryBlock 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.
principalstring | stringrequiredpathResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet the latest nonce used by an account
Retrieves the latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions.
Parameters
block_heightinteger>= 1queryOptionally get the nonce at a given block height.
block_hashstringqueryOptionally get the nonce at a given block hash. Note - Use either of the query parameters but not both at a time.
principalstring | stringrequiredpathResponse
The latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions
Error Response
Authorization
api-keyAuthapiKey in headerGet principal STX balance
Retrieves STX account balance information for a given Address or Contract Identifier.
Parameters
include_mempoolbooleanfalsequeryInclude pending mempool transactions in the balance calculation
principalstring | stringrequiredpathResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet principal FT balances
Retrieves Fungible-token account balance information for a given Address or Contract Identifier.
Parameters
limitinteger[0, 200]100queryResults per page
offsetinteger>= 00queryResult offset
principalstring | stringrequiredpathResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet principal FT balance
Retrieves a specific fungible-token balance for a given principal.
Parameters
principalstring | stringrequiredpathtokenstringrequiredpathfungible token identifier
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerBlocks
Read-only endpoints to obtain Stacks block details
Get blocks
Retrieves a list of recently mined blocks
Parameters
limitinteger[0, 30]20queryResults per page
offsetinteger[-300, 300]0queryResult offset
cursorstringqueryCursor for block pagination
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet average block times
Retrieves average block times (in seconds)
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet block
Retrieves a single block
Parameters
height_or_hashstring | string | integerrequiredpathResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet signer signatures for block
Retrieves the signer signatures (an array of signature byte strings) in a single block
Parameters
limitinteger[0, 1000]500queryResults per page
offsetinteger>= 00queryResult offset
height_or_hashstring | string | integerrequiredpathResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet blocks by tenure
Retrieves blocks confirmed in a block tenure
Parameters
limitinteger[0, 30]20queryResults per page
offsetinteger[-300, 300]0queryResult offset
cursorstringqueryCursor for block pagination
tenure_heightinteger>= 0requiredpathBlock tenure height
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerBurn Blocks
Read-only endpoints to obtain burn block details
Get burn blocks
Retrieves a list of recent burn blocks
Parameters
limitinteger[0, 30]20queryResults per page
offsetinteger>= 00queryResult offset
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet burn block
Retrieves a single burn block
Parameters
height_or_hashstring | string | integerrequiredpathResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet blocks by burn block
Retrieves a list of blocks confirmed by a specific burn block
Parameters
limitinteger[0, 30]20queryResults per page
offsetinteger>= 00queryResult offset
height_or_hashstring | string | integerrequiredpathResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerFaucets
Endpoints to request STX or BTC tokens (not possible on Mainnet)
Add regtest BTC tokens to address
Add 0.01 BTC token to the specified regtest BTC address.
The endpoint returns the transaction ID, which you can use to view the transaction in a regtest Bitcoin block
explorer. The tokens are delivered once the transaction has been included in a block.
**Note:** This is a Bitcoin regtest-only endpoint. This endpoint will not work on the Bitcoin mainnet.Body
addressstringA valid regtest BTC address
Parameters
addressstringqueryA valid regtest BTC address
largebooleanfalsequeryRequest a large amount of regtest BTC than the default
xlargebooleanfalsequeryRequest an extra large amount of regtest BTC than the default
Response
POST request that initiates a transfer of tokens to a specified Bitcoin regtest address
Error Response
Authorization
api-keyAuthapiKey in headerGet BTC balance for address
Parameters
addressstringrequiredpathA valid regtest BTC address
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet STX testnet tokens
Add 500 STX tokens to the specified testnet address. Testnet STX addresses begin with ST. If the stacking
parameter is set to true, the faucet will add the required number of tokens for individual stacking to the
specified testnet address.
The endpoint returns the transaction ID, which you can use to view the transaction in the
[Stacks Explorer](https://explorer.hiro.so/?chain=testnet). The tokens are delivered once the transaction has
been included in an anchor block.
A common reason for failed faucet transactions is that the faucet has run out of tokens. If you are experiencing
failed faucet transactions to a testnet address, you can get help in [Discord](https://stacks.chat).
**Note:** This is a testnet only endpoint. This endpoint will not work on the mainnet.Body
addressstring[Deprecated -- use query param rather than POST body] A valid testnet STX address
Parameters
addressstringqueryA valid testnet STX address
stackingbooleanfalsequeryRequest the amount of STX tokens needed for individual address stacking
Response
POST request that initiates a transfer of tokens to a specified testnet address
Error Response
Authorization
api-keyAuthapiKey in headerInfo
Read-only endpoints to obtain network, Proof-of-Transfer, Stacking, STX token, and node information
API status
Retrieves the running status of the Stacks Blockchain API, including the server version and current chain tip information.
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet total and unlocked STX supply
Retrieves the total and unlocked STX supply. More information on Stacking can be found [here] (https://docs.stacks.co/understand-stacks/stacking).
Parameters
heightinteger>= 0querySupply details are queried from specified block height. If the block height is not specified, the latest block height is taken as default value. Note that the block height is referred to the stacks blockchain.
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
Response
GET request that returns network target block times
Error Response
Authorization
api-keyAuthapiKey in headerGet the network target block time
Retrieves the target block times for mainnet and testnet. The block time is hardcoded and will change throughout the implementation phases of the testnet.
Response
GET request that returns network target block times
Error Response
Authorization
api-keyAuthapiKey in headerGet a given network's target block time
Retrieves the target block time for a given network. The network can be mainnet or testnet. The block time is hardcoded and will change throughout the implementation phases of the testnet.
Parameters
networkstring | stringrequiredpathResponse
GET request that target block time for a given network
Error Response
Authorization
api-keyAuthapiKey in headerMicroblocks
Read-only endpoints to obtain microblocks details
Get recent microblocks
Retrieves a list of microblocks.
If you need to actively monitor new microblocks, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.Parameters
limitinteger[0, 200]20queryMax number of microblocks to fetch
offsetinteger>= 00queryResult offset
Response
GET request that returns microblocks
Error Response
Authorization
api-keyAuthapiKey in headerGet microblock
Retrieves a specific microblock by hash
Parameters
hashstringrequiredpathHash of the microblock
Response
A microblock
Error Response
Authorization
api-keyAuthapiKey in headerGet the list of current transactions that belong to unanchored microblocks
Retrieves transactions that have been streamed in microblocks but not yet accepted or rejected in an anchor block
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerNames
Read-only endpoints realted to the Blockchain Naming System on Stacks
Get Historical Zone File
Retrieves the historical zonefile specified by the username and zone hash.
Parameters
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
namestringrequiredpathfully-qualified name
zoneFileHashstringrequiredpathzone file hash
Response
Fetches the historical zonefile specified by the username and zone hash.
Error
Authorization
api-keyAuthapiKey in headerGet Name Subdomains
Retrieves the list of subdomains for a specific name
Parameters
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
namestringrequiredpathfully-qualified name
Response
Fetch a list of subdomains in a name.
Error Response
Authorization
api-keyAuthapiKey in headerGet Zone File
Retrieves a user's raw zone file. This only works for RFC-compliant zone files. This method returns an error for names that have non-standard zone files.
Parameters
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
namestringrequiredpathfully-qualified name
Response
Fetch a user's raw zone file. This only works for RFC-compliant zone files. This method returns an error for names that have non-standard zone files.
Error
Authorization
api-keyAuthapiKey in headerGet All Names
Retrieves a list of all names known to the node.
Parameters
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
pageinteger>= 00querynames are defaulted to page 1 with 100 results. You can query specific page results by using the 'page' query parameter.
Response
Fetch a list of all names known to the node.
Error
Authorization
api-keyAuthapiKey in headerGet Name Details
Retrieves details of a given name including the address, status and last transaction id - last_txid.
Parameters
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
namestringrequiredpathfully-qualified name
Response
Get name details
Error Response
Authorization
api-keyAuthapiKey in headerGet All Namespaces
Retrieves a list of all namespaces known to the node.
Parameters
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet Namespace Names
Retrieves a list of names within a given namespace.
Parameters
pagenumberquerynamespace values are defaulted to page 1 with 100 results. You can query specific page results by using the 'page' query parameter.
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
tldstringrequiredpaththe namespace to fetch names from.
Response
Fetch a list of names from the namespace.
Error Response
Authorization
api-keyAuthapiKey in headerGet Names Owned by Address
Retrieves a list of names owned by the address provided.
Parameters
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
blockchainstringrequiredpaththe layer-1 blockchain for the address
addressstringrequiredpaththe address to lookup
Response
Retrieves a list of names owned by the address provided.
Error Response
Authorization
api-keyAuthapiKey in headerGet Namespace Price
Retrieves the price of a namespace. The amount given will be in the smallest possible units of the currency.
Parameters
tldstringrequiredpaththe namespace to fetch price for
Response
Fetch price for namespace.
Error Response
Authorization
api-keyAuthapiKey in headerGet Name Price
Retrieves the price of a name. The amount given will be in the smallest possible units of the currency.
Parameters
namestringrequiredpaththe name to query price information for
Response
Fetch price for name.
Error Response
Authorization
api-keyAuthapiKey in headerNon-Fungible Tokens
Read-only endpoints to obtain non-fungible token details
Non-Fungible Token holdings
Retrieves the list of Non-Fungible Tokens owned by the given principal (STX address or Smart Contract ID). Results can be filtered by one or more asset identifiers and can include metadata about the transaction that made the principal own each token.
More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).Parameters
principalstring | stringrequiredqueryasset_identifiersArray<string>querylimitinteger[0, 200]50querymax number of tokens to fetch
offsetinteger>= 00queryindex of first tokens to fetch
tx_metadatabooleanfalserequiredquerywhether or not to include the complete transaction metadata instead of just tx_id. Enabling this option can affect performance and response times.
Response
List of Non-Fungible Token holdings
Error Response
Authorization
api-keyAuthapiKey in headerNon-Fungible Token history
Retrieves all events relevant to a Non-Fungible Token. Useful to determine the ownership history of a particular asset.
More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).Parameters
asset_identifierstringrequiredqueryasset class identifier
valuestringrequiredqueryhex representation of the token's unique value
limitinteger[0, 200]50querymax number of events to fetch
offsetinteger>= 00queryindex of first event to fetch
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
tx_metadatabooleanfalserequiredquerywhether or not to include the complete transaction metadata instead of just tx_id. Enabling this option can affect performance and response times.
Response
List of Non-Fungible Token history events
Error Response
Authorization
api-keyAuthapiKey in headerNon-Fungible Token mints
Retrieves all mint events for a Non-Fungible Token asset class. Useful to determine which NFTs of a particular collection have been claimed.
More information on Non-Fungible Tokens on the Stacks blockchain can be found [here](https://docs.stacks.co/write-smart-contracts/tokens#non-fungible-tokens-nfts).Parameters
asset_identifierstringrequiredqueryasset class identifier
limitinteger[0, 200]50querymax number of events to fetch
offsetinteger>= 00queryindex of first event to fetch
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
tx_metadatabooleanfalserequiredquerywhether or not to include the complete transaction metadata instead of just tx_id. Enabling this option can affect performance and response times.
Response
List of Non-Fungible Token mint events for an asset identifier
Error Response
Authorization
api-keyAuthapiKey in headerSearch
Read-only endpoints to search for accounts, blocks, smart contracts, and transactions
Search
Search blocks, transactions, contracts, or accounts by hash/ID
Parameters
include_metadatabooleanfalsequeryThis includes the detailed data for purticular hash in the response
idstringrequiredpathThe hex hash string for a block or transaction, account address, or contract address
Response
Default Response
Error Response
Default Response
Authorization
api-keyAuthapiKey in headerSmart Contracts
Read-only endpoints to obtain Clarity smart contract details
Get contracts by trait
Retrieves a list of contracts based on the following traits listed in JSON format - functions, variables, maps, fungible tokens and non-fungible tokens
Parameters
trait_abistringrequiredqueryJSON abi of the trait.
limitinteger[0, 50]20querymax number of contracts fetch
offsetinteger>= 00queryindex of first contract event to fetch
Response
GET list of contracts
Error Response
Authorization
api-keyAuthapiKey in headerGet contract info
Retrieves details of a contract with a given contract_id
Parameters
contract_idstringrequiredpathContract identifier formatted as <contract_address>.<contract_name>
Response
A Smart Contract Detail
Error Response
Authorization
api-keyAuthapiKey in headerGet contract events
Retrieves a list of events that have been triggered by a given contract_id
Parameters
limitinteger[0, 50]20querymax number of events to fetch
offsetinteger>= 00queryResult offset
contract_idstringrequiredpathContract identifier formatted as <contract_address>.<contract_name>
Response
List of events
Error Response
Authorization
api-keyAuthapiKey in headerGet smart contracts status
Retrieves the deployment status of multiple smart contracts.
Parameters
contract_idArray<string> | stringrequiredqueryResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerStacking Rewards
Read-only endpoints to obtain Stacking reward details
Get recent reward slot holders
Retrieves a list of the Bitcoin addresses that would validly receive Proof-of-Transfer commitments.
Parameters
limitinteger[0, 250]96querymax number of items to fetch
offsetinteger>= 00queryResult offset
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet recent reward slot holder entries for the given address
Retrieves a list of the Bitcoin addresses that would validly receive Proof-of-Transfer commitments for a given reward slot holder recipient address.
Parameters
limitinteger[0, 250]96queryResults per page
offsetinteger>= 00queryResult offset
addressstringrequiredpathReward slot holder recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format
Response
List of burnchain reward recipients and amounts
Error Response
Authorization
api-keyAuthapiKey in headerGet recent burnchain reward recipients
Retrieves a list of recent burnchain (e.g. Bitcoin) reward recipients with the associated amounts and block info
Parameters
limitinteger[0, 250]96queryResults per page
offsetinteger>= 00queryResult offset
Response
List of burnchain reward recipients and amounts
Error Response
Authorization
api-keyAuthapiKey in headerGet recent burnchain reward for the given recipient
Retrieves a list of recent burnchain (e.g. Bitcoin) rewards for the given recipient with the associated amounts and block info
Parameters
limitinteger[0, 250]96queryResults per page
offsetinteger>= 00queryResult offset
addressstringrequiredpathReward recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format
Response
List of burnchain reward recipients and amounts
Error Response
Authorization
api-keyAuthapiKey in headerGet total burnchain rewards for the given recipient
Retrieves the total burnchain (e.g. Bitcoin) rewards for a given recipient address
Parameters
addressstringrequiredpathReward recipient address. Should either be in the native burnchain's format (e.g. B58 for Bitcoin), or if a STX principal address is provided it will be encoded as into the equivalent burnchain format
Response
Total burnchain rewards made to a recipient
Error Response
Authorization
api-keyAuthapiKey in headerTransactions
Endpoints to obtain transaction details and to broadcast transactions to the network
Get recent transactions
Retrieves all recently mined transactions
Parameters
offsetinteger>= 00queryResult offset
limitinteger[0, 50]20queryResults per page
typeArray<string | string | string | string | string | string>queryunanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
orderstring | stringquerysort_bystring | string | stringblock_heightqueryOption to sort results by block height, timestamp, or fee
from_addressstringqueryOption to filter results by sender address
to_addressstringqueryOption to filter results by recipient address
start_timeintegerqueryFilter by transactions after this timestamp (unix timestamp in seconds)
end_timeintegerqueryFilter by transactions before this timestamp (unix timestamp in seconds)
contract_idstringqueryOption to filter results by contract ID
function_namestringqueryFilter by contract call transactions involving this function name
nonceinteger[0, 9007199254740991]queryFilter by transactions with this nonce
Response
List of transactions
Error Response
Authorization
api-keyAuthapiKey in headerGet list of details for transactions
Retrieves a list of transactions for a given list of transaction IDs
Parameters
tx_idArray<string>requiredqueryevent_limitinteger[0, 100]20queryResults per page
event_offsetinteger>= 00queryResult offset
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet mempool transactions
Retrieves all transactions that have been recently broadcast to the mempool. These are pending transactions awaiting confirmation.
If you need to monitor new transactions, we highly recommend subscribing to [WebSockets or Socket.io](https://github.com/hirosystems/stacks-blockchain-api/tree/master/client) for real-time updates.Parameters
sender_addressstringquerySTX Address
recipient_addressstringquerySTX Address
addressstringquerySTX Address
order_bystring | string | stringqueryOption to sort results by transaction age, size, or fee rate.
orderstring | stringqueryResults order
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
offsetinteger>= 00queryResult offset
limitinteger[0, 50]20queryResults per page
Response
List of mempool transactions
Error Response
Authorization
api-keyAuthapiKey in headerGet statistics for mempool transactions
Queries for transactions counts, age (by block height), fees (simple average), and size. All results broken down by transaction type and percentiles (p25, p50, p75, p95).
Response
GET request that returns stats on mempool transactions
Error Response
Authorization
api-keyAuthapiKey in headerTransaction Events
Retrieves the list of events filtered by principal (STX address or Smart Contract ID), transaction id or event types. The list of event types is ('smart_contract_log', 'stx_lock', 'stx_asset', 'fungible_token_asset', 'non_fungible_token_asset').
Parameters
tx_idstringqueryTransaction ID
addressstring | stringquerytypeArray<string | string | string | string | string>queryoffsetinteger>= 00queryResult offset
limitinteger[0, 100]20queryResults per page
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet transaction
Retrieves transaction details for a given transaction ID
Parameters
event_limitinteger[0, 100]20queryResults per page
event_offsetinteger>= 00queryResult offset
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
tx_idstringrequiredpathTransaction ID
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet raw transaction
Retrieves a hex encoded serialized transaction for a given ID
Parameters
event_limitinteger[0, 100]20queryResults per page
event_offsetinteger>= 00queryResult offset
tx_idstringrequiredpathTransaction ID
Response
GET raw transaction
Error Response
Authorization
api-keyAuthapiKey in headerTransactions for address
Retrieves all transactions for a given address that are currently in mempool
Parameters
limitinteger[0, 50]20queryResults per page
offsetinteger>= 00queryResult offset
unanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
principalstring | stringrequiredpathResponse
List of mempool transactions
Error Response
Authorization
api-keyAuthapiKey in headerGet transactions by block
Retrieves transactions confirmed in a single block
Parameters
limitinteger[0, 50]20queryResults per page
offsetinteger>= 00queryResult offset
height_or_hashstring | string | integerrequiredpathResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet address transactions
Retrieves a paginated list of confirmed transactions sent or received by a STX address or Smart Contract ID, alongside the total amount of STX sent or received and the number of STX, FT and NFT transfers contained within each transaction.
More information on Transaction types can be found [here](https://docs.stacks.co/understand-stacks/transactions#types).Parameters
limitinteger[0, 50]20queryResults per page
offsetinteger>= 00queryResult offset
addressstring | stringrequiredpathResponse
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet events for an address transaction
Retrieves a paginated list of all STX, FT and NFT events concerning a STX address or Smart Contract ID within a specific transaction.
Parameters
limitinteger[0, 50]20queryResults per page
offsetinteger>= 00queryResult offset
addressstring | stringrequiredpathtx_idstringrequiredpathTransaction ID
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerMempool
Endpoints to obtain Mempool information
Get mempool transaction fee priorities
Returns estimated fee priorities (in micro-STX) for all transactions that are currently in the mempool. Also returns priorities separated by transaction type.
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerProof of Transfer
Endpoints to get information about the Proof of Transfer consensus mechanism
Get PoX cycles
Retrieves a list of PoX cycles
Parameters
limitinteger[0, 60]20queryResults per page
offsetinteger>= 00queryResult offset
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet PoX cycle
Retrieves details for a PoX cycle
Parameters
cycle_numberintegerrequiredpathPoX cycle number
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet signers in PoX cycle
Retrieves a list of signers in a PoX cycle
Parameters
limitinteger[0, 250]100queryResults per page
offsetinteger>= 00queryResult offset
cycle_numberintegerrequiredpathPoX cycle number
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet signer in PoX cycle
Retrieves details for a signer in a PoX cycle
Parameters
cycle_numberintegerrequiredpathPoX cycle number
signer_keystringrequiredpathSigner key
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerGet stackers for signer in PoX cycle
Retrieves a list of stackers for a signer in a PoX cycle
Parameters
limitinteger[0, 200]100queryResults per page
offsetinteger>= 00queryResult offset
cycle_numberintegerrequiredpathPoX cycle number
signer_keystringrequiredpathSigner key
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerFungible Tokens
Fungible token holders
Retrieves the list of Fungible Token holders for a given token ID. Specify stx for the token parameter to get the list of STX holders.
Parameters
limitinteger[0, 200]100querymax number of holders to fetch
offsetinteger>= 00queryindex of first holder to fetch
tokenstringrequiredpathfungible token identifier
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerStacking
Get latest PoX events
Parameters
limitinteger[0, 200]96queryResults per page
offsetinteger>= 00queryResult offset
poxstring | string | stringrequiredpathResponse
Default Response
Authorization
api-keyAuthapiKey in headerGet PoX events for a transaction
Parameters
poxstring | string | stringrequiredpathtx_idstringrequiredpathResponse
Default Response
Authorization
api-keyAuthapiKey in headerGet events for a stacking address
Parameters
poxstring | string | stringrequiredpathprincipalstring | stringrequiredpathResponse
Default Response
Authorization
api-keyAuthapiKey in headerStacking pool members
Retrieves the list of stacking pool members for a given delegator principal.
Parameters
limitinteger[0, 200]100queryResults per page
offsetinteger>= 00queryResult offset
after_blockinteger>= 1queryIf specified, only delegation events after the given block will be included
heightinteger>= 1queryunanchoredbooleanfalsequeryInclude data from unanchored (i.e. unconfirmed) microblocks
poxstring | string | stringrequiredpathpool_principalstringrequiredpathAddress principal of the stacking pool delegator
Response
Default Response
Error Response
Authorization
api-keyAuthapiKey in headerStacks
Accounts
Read-only endpoints to obtain Stacks account details
Get account info
Get the account data for the provided principal
Where balance is the hex encoding of a unsigned 128-bit integer (big-endian), nonce is a unsigned 64-bit integer, and the proofs are provided as hex strings.
For non-existent accounts, this does not 404, rather it returns an object with balance and nonce of 0.
Parameters
principalstringrequiredpathStacks address or a Contract identifier (e.g. SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info)
proofintegerqueryReturns object without the proof field if set to 0
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Authorization
api-keyAuthapiKey in headerBlocks
Read-only endpoints to obtain Stacks block details
Fetch a Nakamoto block
Fetch a Nakamoto block by its index block hash.
Parameters
block_idstringrequiredpathThe block's ID hash
Response
The raw SIP-003-encoded block will be returned.
The block could not be found
Authorization
api-keyAuthapiKey in headerFetch a Nakamoto block by its height and optional tip
Fetch a Nakamoto block by its height and optional tip.
Parameters
block_heightintegerrequiredpathThe block's height
tipstringqueryThe Stacks chain tip to query from. If tip == latest or empty, the query will be run from the latest known tip.
Response
The raw SIP-003-encoded block will be returned.
The block could not be found
Authorization
api-keyAuthapiKey in headerSimulate a block
Simulates the processing of a block identified by its hash. The node will apply the block's transactions to the current chain state in a temporary context and return the resulting block information, including the expected state changes and fees, without persisting anything to the actual chain.
Parameters
block_hashstringrequiredpathThe hex-encoded hash of the block to simulate (as typically returned by the miner or proposer).
Response
Successful simulation response containing the simulated block details.
Authorization
api-keyAuthapiKey in headerFetch metadata about the ongoing Nakamoto tenure
Fetch metadata about the ongoing Nakamoto tenure. This information is sufficient to obtain and authenticate the highest complete tenure, as well as obtain new tenure blocks.
Response
Metadata about the ongoing tenure
Authorization
api-keyAuthapiKey in headerFetch a sequence of Nakamoto blocks in a tenure
Fetch a sequence of Nakamoto blocks in a tenure. The blocks will be served in order from highest to lowest. The blocks will be encoded in their SIP-003 wire format, and concatenated together.
Parameters
block_idstringrequiredpathThe tenure-start block ID of the tenure to query
stopstringqueryThe block ID hash of the highest block in this tenure that is already known to the caller. Neither the corresponding block nor any of its ancestors will be served. This is used to fetch tenure blocks that the caller does not have.
Response
SIP-003-encoded Nakamoto blocks, concatenated together
Authorization
api-keyAuthapiKey in headerFetch information about evaluated burnchain blocks (i.e., sortitions).
Fetch sortition information about a burnchain block. If the lookup_kind and lookup parameters are empty, it will return information about the latest burn block.
Parameters
lookup_kindstringpathThe style of lookup that should be performed. If not given, the most recent burn block processed will be returned.
Otherwise, the lookup_kind should be one of the following strings:
consensus- find the burn block using the consensus hash supplied in thelookupfield.burn_height- find the burn block using the burn block height supplied in thelookupfield.burn- find the burn block using the burn block hash supplied in thelookupfield.latest_and_last- return information about the latest burn block with a winning miner and the previous such burn block
lookupstringpathThe value to use for the lookup if lookup_kind is consensus, burn_height, or burn
Response
Information for the burn block or in the case of latest_and_last, multiple burn blocks
Authorization
api-keyAuthapiKey in headerGet number of blocks signed by signer during a given reward cycle
Get number of blocks signed by signer during a given reward cycle
Parameters
signerstringrequiredpathHex-encoded compressed Secp256k1 public key of signer
cycle_numberintegerrequiredpathReward cycle number
Response
Number of blocks signed
Authorization
api-keyAuthapiKey in headerGet tenure blocks by burn block hash
Returns information about Stacks blocks that correspond to a specific Bitcoin burn block hash. Tenures represent the relationship between Stacks blocks and Bitcoin blocks in the Proof of Transfer (PoX) consensus.
Parameters
hashstringrequiredpathBitcoin burn block hash in hex format. This is the hash of the Bitcoin block that mined the Stacks blocks.
Response
Successful response with tenure blocks information
Bad request - invalid burn block hash format
Tenure not found for the specified burn block hash
Internal server error
Authorization
api-keyAuthapiKey in headerGet tenure blocks by burn block height
Returns information about Stacks blocks that correspond to a specific Bitcoin burn block height. Tenures represent the relationship between Stacks blocks and Bitcoin blocks in the Proof of Transfer (PoX) consensus.
Parameters
heightinteger>= 0requiredpathBitcoin burn block height (block number in the Bitcoin blockchain). This specifies the position of the Bitcoin block in the chain.
Response
Successful response with tenure blocks information
Bad request - invalid burn block height
Tenure not found for the specified burn block height
Internal server error
Authorization
api-keyAuthapiKey in headerGet tip metadata for a specific consensus hash
Returns the anchored header and burn view for the specified consensus hash.
Parameters
consensus_hashstringrequiredpathConsensus hash identifying the block
Response
Successful response
Authorization
api-keyAuthapiKey in headerInfo
Read-only endpoints to obtain network, Proof-of-Transfer, Stacking, STX token, and node information
Get Core API info
Get Core API information
Response
Success
Authorization
api-keyAuthapiKey in headerGet PoX details
Get Proof of Transfer (PoX) information. Can be used for Stacking.
Parameters
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Authorization
api-keyAuthapiKey in headerSmart Contracts
Read-only endpoints to obtain Clarity smart contract details
Get contract interface
Get contract interface using a contract_address and contract name
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Contract interface
Authorization
api-keyAuthapiKey in headerGet specific data-map inside a contract
Attempt to fetch data from a contract data map. The contract is identified with [Stacks Address] and [Contract Name] in the URL path. The map is identified with [Map Name].
The key to lookup in the map is supplied via the POST body. This should be supplied as the hex string serialization of the key (which should be a Clarity value). Note, this is a JSON string atom.
In the response, data is the hex serialization of the map response. Note that map responses are Clarity option types, for non-existent values, this is a serialized none, and for all other responses, it is a serialized (some ...) object.
Body
Hex string serialization of the lookup key (which should be a Clarity value)
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
map_namestringrequiredpathMap name
proofintegerqueryReturns object without the proof field when set to 0
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Failed loading data map
Authorization
api-keyAuthapiKey in headerGet contract source
Returns the Clarity source code of a given contract, along with the block height it was published in, and the MARF proof for the data
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
proofintegerqueryReturns object without the proof field if set to 0
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Authorization
api-keyAuthapiKey in headerCall read-only function
Call a read-only public function on a given smart contract.
The smart contract and function are specified using the URL path. The arguments and the simulated tx-sender are supplied via the POST body in the following JSON format:
Body
map of arguments and the simulated tx-sender where sender is either a Contract identifier or a normal Stacks address, and arguments is an array of hex serialized Clarity values.
Describes representation of a Type-0 Stacks 2.0 transaction. https://github.com/stacksgov/sips/blob/main/sips/sip-005/sip-005-blocks-and-transactions.md#type-0-transferring-an-asset
senderstringrequiredThe simulated tx-sender
argumentsArray<string>requiredAn array of hex serialized Clarity values
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
function_namestringrequiredpathFunction name
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Authorization
api-keyAuthapiKey in headerGet trait implementation details
Determine whether or not a specified trait is implemented (either explicitly or implicitly) within a given contract.
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
trait_contract_addressstringrequiredpathTrait Stacks address
trait_contract_namestringrequiredpathTrait contract name
trait_namestringrequiredpathTrait name
tipstringqueryThe Stacks chain tip to query from. If tip == "latest", the query will be run from the latest known tip (includes unconfirmed state). If the tip is left unspecified, the stacks chain tip will be selected (only includes confirmed state).
Response
Success
Authorization
api-keyAuthapiKey in headerGet the MARF value for a given key
Attempt to fetch the value of a MARF key.
In the response, data is the hex serialization of the value.
Parameters
clarity_marf_keystringrequiredpathMARF key
proofintegerqueryReturns object without the proof field when set to 0
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Failed to retrieve MARF key
Authorization
api-keyAuthapiKey in headerGet the contract metadata for the metadata key
Attempt to fetch the metadata of a contract. The contract is identified with [Contract Address] and [Contract Name] in the URL path. The metadata key is identified with [Clarity Metadata Key].
In the response, data is formatted as JSON.
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
clarity_metadata_keystringrequiredpathMetadata key
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Failed to retrieve constant value from contract
Authorization
api-keyAuthapiKey in headerGet the value of a constant inside a contract
Attempt to fetch the value of a constant inside a contract. The contract is identified with [Stacks Address] and [Contract Name] in the URL path. The constant is identified with [Constant Name].
In the response, data is the hex serialization of the constant value.
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
constant_namestringrequiredpathConstant name
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Failed to retrieve constant value from contract
Authorization
api-keyAuthapiKey in headerTransactions
Endpoints to obtain transaction details and to broadcast transactions to the network
Broadcast raw transaction
Broadcast raw transactions on the network. You can use the @stacks/transactions project to generate a raw transaction payload.
Body
Response
Transaction ID of successful post of a raw tx to the node's mempool
Rejections result in a 400 error
Authorization
api-keyAuthapiKey in headerRetrieve transaction details by TXID
Returns detailed information about a specific Stacks transaction, including the raw transaction bytes, execution result, and block metadata.
Parameters
tx_idstringrequiredpathThe transaction ID (hash) identifying the Stacks transaction.
Response
Transaction successfully retrieved
Authorization
api-keyAuthapiKey in headerFees
Read-only endpoints to obtain fee details
Get approximate fees for the given transaction
Get an estimated fee for the supplied transaction. This estimates the execution cost of the transaction, the current fee rate of the network, and returns estimates for fee amounts.
transaction_payloadis a hex-encoded serialization of the TransactionPayload for the transaction.estimated_lenis an optional argument that provides the endpoint with an estimation of the final length (in bytes) of the transaction, including any post-conditions and signatures
If the node cannot provide an estimate for the transaction
(e.g., if the node has never seen a contract-call for the
given contract and function) or if estimation is not
configured on this node, a 400 response is returned.
The 400 response will be a JSON error containing a reason
field which can be one of the following:
DatabaseError- this Stacks node has had an internal database error while trying to estimate the costs of the supplied transaction.NoEstimateAvailable- this Stacks node has not seen this kind of contract-call before, and it cannot provide an estimate yet.CostEstimationDisabled- this Stacks node does not perform fee or cost estimation, and it cannot respond on this endpoint.
The 200 response contains the following data:
estimated_cost- the estimated multi-dimensional cost of executing the Clarity VM on the provided transaction.estimated_cost_scalar- a unitless integer that the Stacks node uses to compare how much of the block limit is consumed by different transactions. This value incorporates the estimated length of the transaction and the estimated execution cost of the transaction. The range of this integer may vary between different Stacks nodes. In order to compute an estimate of total fee amount for the transaction, this value is multiplied by the same Stacks node's estimated fee rate.cost_scalar_change_by_byte- a float value that indicates how much theestimated_cost_scalarvalue would increase for every additional byte in the final transaction.estimations- an array of estimated fee rates and total fees to pay in microSTX for the transaction. This array provides a range of estimates (default: 3) that may be used. Each element of the array contains the following fields:fee_rate- the estimated value for the current fee rates in the networkfee- the estimated value for the total fee in microSTX that the given transaction should pay. These values are the result of computing:fee_ratexestimated_cost_scalar. If the estimated fees are less than the minimum relay fee(1 ustx x estimated_len), then that minimum relay fee will be returned here instead.
Note: If the final transaction's byte size is larger than
supplied to estimated_len, then applications should increase
this fee amount by:
fee_rate x cost_scalar_change_by_byte x (final_size - estimated_size)
Body
POST request for estimated fee
transaction_payloadstringrequiredestimated_lenintegerResponse
Estimated fees for the transaction
Authorization
api-keyAuthapiKey in headerGet estimated fee
Get an estimated fee rate for STX transfer transactions. This a a fee rate / byte, and is returned as a JSON integer
Response
Success
Authorization
api-keyAuthapiKey in headerMining
Validate a proposed Stacks block
Used by stackers to validate a proposed Stacks block from a miner.
This API endpoint requires a basic Authorization header.
Body
Response
Block proposal has been accepted for processing. The result will be returned via the event observer.
Endpoint not enabled.
Unauthorized.
There is an ongoing proposal validation being processed, the new request cannot be accepted until the prior request has been processed.
Authorization
api-keyAuthapiKey in headerFetch the stacker and signer set information for a given cycle.
Used to get stacker and signer set information for a given cycle.
This will only return information for cycles started in Epoch-2.5 where PoX-4 was active and subsequent cycles.
Parameters
cycle_numberintegerrequiredpathreward cycle number
Response
Information for the given reward cycle
Could not fetch the given reward set
Authorization
api-keyAuthapiKey in headerSigners
Get number of blocks signed by signer during a given reward cycle
Get number of blocks signed by signer during a given reward cycle
Parameters
signerstringrequiredpathHex-encoded compressed Secp256k1 public key of signer
cycle_numberintegerrequiredpathReward cycle number
Response
Number of blocks signed
Authorization
api-keyAuthapiKey in headerSTX
Accounts
Read-only endpoints to obtain Stacks account details
Get account info
Get the account data for the provided principal
Where balance is the hex encoding of a unsigned 128-bit integer (big-endian), nonce is a unsigned 64-bit integer, and the proofs are provided as hex strings.
For non-existent accounts, this does not 404, rather it returns an object with balance and nonce of 0.
Parameters
principalstringrequiredpathStacks address or a Contract identifier (e.g. SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info)
proofintegerqueryReturns object without the proof field if set to 0
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Authorization
api-keyAuthapiKey in headerBlocks
Read-only endpoints to obtain Stacks block details
Fetch a Nakamoto block
Fetch a Nakamoto block by its index block hash.
Parameters
block_idstringrequiredpathThe block's ID hash
Response
The raw SIP-003-encoded block will be returned.
The block could not be found
Authorization
api-keyAuthapiKey in headerFetch a Nakamoto block by its height and optional tip
Fetch a Nakamoto block by its height and optional tip.
Parameters
block_heightintegerrequiredpathThe block's height
tipstringqueryThe Stacks chain tip to query from. If tip == latest or empty, the query will be run from the latest known tip.
Response
The raw SIP-003-encoded block will be returned.
The block could not be found
Authorization
api-keyAuthapiKey in headerFetch metadata about the ongoing Nakamoto tenure
Fetch metadata about the ongoing Nakamoto tenure. This information is sufficient to obtain and authenticate the highest complete tenure, as well as obtain new tenure blocks.
Response
Metadata about the ongoing tenure
Authorization
api-keyAuthapiKey in headerFetch a sequence of Nakamoto blocks in a tenure
Fetch a sequence of Nakamoto blocks in a tenure. The blocks will be served in order from highest to lowest. The blocks will be encoded in their SIP-003 wire format, and concatenated together.
Parameters
block_idstringrequiredpathThe tenure-start block ID of the tenure to query
stopstringqueryThe block ID hash of the highest block in this tenure that is already known to the caller. Neither the corresponding block nor any of its ancestors will be served. This is used to fetch tenure blocks that the caller does not have.
Response
SIP-003-encoded Nakamoto blocks, concatenated together
Authorization
api-keyAuthapiKey in headerFetch information about evaluated burnchain blocks (i.e., sortitions).
Fetch sortition information about a burnchain block. If the lookup_kind and lookup parameters are empty, it will return information about the latest burn block.
Parameters
lookup_kindstringpathThe style of lookup that should be performed. If not given, the most recent burn block processed will be returned.
Otherwise, the lookup_kind should be one of the following strings:
consensus- find the burn block using the consensus hash supplied in thelookupfield.burn_height- find the burn block using the burn block height supplied in thelookupfield.burn- find the burn block using the burn block hash supplied in thelookupfield.latest_and_last- return information about the latest burn block with a winning miner and the previous such burn block
lookupstringpathThe value to use for the lookup if lookup_kind is consensus, burn_height, or burn
Response
Information for the burn block or in the case of latest_and_last, multiple burn blocks
Authorization
api-keyAuthapiKey in headerGet number of blocks signed by signer during a given reward cycle
Get number of blocks signed by signer during a given reward cycle
Parameters
signerstringrequiredpathHex-encoded compressed Secp256k1 public key of signer
cycle_numberintegerrequiredpathReward cycle number
Response
Number of blocks signed
Authorization
api-keyAuthapiKey in headerInfo
Read-only endpoints to obtain network, Proof-of-Transfer, Stacking, STX token, and node information
Get Core API info
Get Core API information
Response
Success
Authorization
api-keyAuthapiKey in headerGet PoX details
Get Proof of Transfer (PoX) information. Can be used for Stacking.
Parameters
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Authorization
api-keyAuthapiKey in headerSmart Contracts
Read-only endpoints to obtain Clarity smart contract details
Get contract interface
Get contract interface using a contract_address and contract name
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Contract interface
Authorization
api-keyAuthapiKey in headerGet specific data-map inside a contract
Attempt to fetch data from a contract data map. The contract is identified with [Stacks Address] and [Contract Name] in the URL path. The map is identified with [Map Name].
The key to lookup in the map is supplied via the POST body. This should be supplied as the hex string serialization of the key (which should be a Clarity value). Note, this is a JSON string atom.
In the response, data is the hex serialization of the map response. Note that map responses are Clarity option types, for non-existent values, this is a serialized none, and for all other responses, it is a serialized (some ...) object.
Body
Hex string serialization of the lookup key (which should be a Clarity value)
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
map_namestringrequiredpathMap name
proofintegerqueryReturns object without the proof field when set to 0
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Failed loading data map
Authorization
api-keyAuthapiKey in headerGet contract source
Returns the Clarity source code of a given contract, along with the block height it was published in, and the MARF proof for the data
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
proofintegerqueryReturns object without the proof field if set to 0
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Authorization
api-keyAuthapiKey in headerCall read-only function
Call a read-only public function on a given smart contract.
The smart contract and function are specified using the URL path. The arguments and the simulated tx-sender are supplied via the POST body in the following JSON format:
Body
map of arguments and the simulated tx-sender where sender is either a Contract identifier or a normal Stacks address, and arguments is an array of hex serialized Clarity values.
Describes representation of a Type-0 Stacks 2.0 transaction. https://github.com/stacksgov/sips/blob/main/sips/sip-005/sip-005-blocks-and-transactions.md#type-0-transferring-an-asset
senderstringrequiredThe simulated tx-sender
argumentsArray<string>requiredAn array of hex serialized Clarity values
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
function_namestringrequiredpathFunction name
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Authorization
api-keyAuthapiKey in headerGet trait implementation details
Determine whether or not a specified trait is implemented (either explicitly or implicitly) within a given contract.
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
trait_contract_addressstringrequiredpathTrait Stacks address
trait_contract_namestringrequiredpathTrait contract name
trait_namestringrequiredpathTrait name
tipstringqueryThe Stacks chain tip to query from. If tip == "latest", the query will be run from the latest known tip (includes unconfirmed state). If the tip is left unspecified, the stacks chain tip will be selected (only includes confirmed state).
Response
Success
Authorization
api-keyAuthapiKey in headerGet the MARF value for a given key
Attempt to fetch the value of a MARF key.
In the response, data is the hex serialization of the value.
Parameters
clarity_marf_keystringrequiredpathMARF key
proofintegerqueryReturns object without the proof field when set to 0
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Failed to retrieve MARF key
Authorization
api-keyAuthapiKey in headerGet the contract metadata for the metadata key
Attempt to fetch the metadata of a contract. The contract is identified with [Contract Address] and [Contract Name] in the URL path. The metadata key is identified with [Clarity Metadata Key].
In the response, data is formatted as JSON.
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
clarity_metadata_keystringrequiredpathMetadata key
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Failed to retrieve constant value from contract
Authorization
api-keyAuthapiKey in headerGet the value of a constant inside a contract
Attempt to fetch the value of a constant inside a contract. The contract is identified with [Stacks Address] and [Contract Name] in the URL path. The constant is identified with [Constant Name].
In the response, data is the hex serialization of the constant value.
Parameters
contract_addressstringrequiredpathStacks address
contract_namestringrequiredpathContract name
constant_namestringrequiredpathConstant name
tipstringqueryThe Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).
Response
Success
Failed to retrieve constant value from contract
Authorization
api-keyAuthapiKey in headerTransactions
Endpoints to obtain transaction details and to broadcast transactions to the network
Broadcast raw transaction
Broadcast raw transactions on the network. You can use the @stacks/transactions project to generate a raw transaction payload.
Body
Response
Transaction ID of successful post of a raw tx to the node's mempool
Rejections result in a 400 error
Authorization
api-keyAuthapiKey in headerRetrieve transaction details by TXID
Get a JSON with the transaction details including the index_block_hash, the hex-encoded transaction body, and the result.
Parameters
txidstringrequiredpathTransaction ID
Response
Transaction JSON with index_block_hash, transaction body and result
Transaction not found
Transaction indexing not enabled
Authorization
api-keyAuthapiKey in headerFees
Read-only endpoints to obtain fee details
Get approximate fees for the given transaction
Get an estimated fee for the supplied transaction. This estimates the execution cost of the transaction, the current fee rate of the network, and returns estimates for fee amounts.
transaction_payloadis a hex-encoded serialization of the TransactionPayload for the transaction.estimated_lenis an optional argument that provides the endpoint with an estimation of the final length (in bytes) of the transaction, including any post-conditions and signatures
If the node cannot provide an estimate for the transaction
(e.g., if the node has never seen a contract-call for the
given contract and function) or if estimation is not
configured on this node, a 400 response is returned.
The 400 response will be a JSON error containing a reason
field which can be one of the following:
DatabaseError- this Stacks node has had an internal database error while trying to estimate the costs of the supplied transaction.NoEstimateAvailable- this Stacks node has not seen this kind of contract-call before, and it cannot provide an estimate yet.CostEstimationDisabled- this Stacks node does not perform fee or cost estimation, and it cannot respond on this endpoint.
The 200 response contains the following data:
estimated_cost- the estimated multi-dimensional cost of executing the Clarity VM on the provided transaction.estimated_cost_scalar- a unitless integer that the Stacks node uses to compare how much of the block limit is consumed by different transactions. This value incorporates the estimated length of the transaction and the estimated execution cost of the transaction. The range of this integer may vary between different Stacks nodes. In order to compute an estimate of total fee amount for the transaction, this value is multiplied by the same Stacks node's estimated fee rate.cost_scalar_change_by_byte- a float value that indicates how much theestimated_cost_scalarvalue would increase for every additional byte in the final transaction.estimations- an array of estimated fee rates and total fees to pay in microSTX for the transaction. This array provides a range of estimates (default: 3) that may be used. Each element of the array contains the following fields:fee_rate- the estimated value for the current fee rates in the networkfee- the estimated value for the total fee in microSTX that the given transaction should pay. These values are the result of computing:fee_ratexestimated_cost_scalar. If the estimated fees are less than the minimum relay fee(1 ustx x estimated_len), then that minimum relay fee will be returned here instead.
Note: If the final transaction's byte size is larger than
supplied to estimated_len, then applications should increase
this fee amount by:
fee_rate x cost_scalar_change_by_byte x (final_size - estimated_size)
Body
POST request for estimated fee
transaction_payloadstringrequiredestimated_lenintegerResponse
Estimated fees for the transaction
Authorization
api-keyAuthapiKey in headerGet estimated fee
Get an estimated fee rate for STX transfer transactions. This a a fee rate / byte, and is returned as a JSON integer
Response
Success
Authorization
api-keyAuthapiKey in headerMining
Validate a proposed Stacks block
Used by stackers to validate a proposed Stacks block from a miner.
This API endpoint requires a basic Authorization header.
Body
Response
Block proposal has been accepted for processing. The result will be returned via the event observer.
Endpoint not enabled.
Unauthorized.
There is an ongoing proposal validation being processed, the new request cannot be accepted until the prior request has been processed.
Authorization
api-keyAuthapiKey in headerFetch the stacker and signer set information for a given cycle.
Used to get stacker and signer set information for a given cycle.
This will only return information for cycles started in Epoch-2.5 where PoX-4 was active and subsequent cycles.
Parameters
cycle_numberintegerrequiredpathreward cycle number
Response
Information for the given reward cycle
Could not fetch the given reward set
Authorization
api-keyAuthapiKey in headerSigners
Get number of blocks signed by signer during a given reward cycle
Get number of blocks signed by signer during a given reward cycle
Parameters
signerstringrequiredpathHex-encoded compressed Secp256k1 public key of signer
cycle_numberintegerrequiredpathReward cycle number
Response
Number of blocks signed
Authorization
api-keyAuthapiKey in header