DataAPI Commands
The dataapi namespace provides high-level queries for Alkanes tokens, AMM pools, balances, and market data via the SUBFROST Data API.
Configuration
The Data API uses a separate endpoint from JSON-RPC:
# Using the data API endpoint
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi get-alkanes
# Or with your API key for higher rate limits:
--data-api https://mainnet.subfrost.io/v4/YOUR_API_KEYAlkanes Queries
| Command | Description |
|---|---|
| get-alkanes | Get all alkanes tokens |
| get-alkanes-by-address | Get alkanes for an address |
| get-alkane-details | Get details for a specific alkane |
Pool & AMM
| Command | Description |
|---|---|
| get-pools | Get all liquidity pools |
| get-pool-by-id | Get pool details by ID |
| get-pool-history | Get historical pool data |
| get-swap-history | Get swap history |
Balances
| Command | Description |
|---|---|
| get-address-balances | Get alkane balances for an address (with UTXO tracking) |
| get-outpoint-balances | Get alkane balances for a specific outpoint |
| get-holders | Get holders of an alkane token |
| get-holder-count | Get holder count for an alkane |
Market Data
| Command | Description |
|---|---|
| get-bitcoin-price | Get current Bitcoin price |
| get-market-chart | Get Bitcoin market chart |
Indexer Status
| Command | Description |
|---|---|
| get-block-height | Get latest processed block height |
| get-block-hash | Get latest processed block hash |
| get-indexer-position | Get indexer position (height + hash) |
| health | Health check |
dataapi get-alkanes
Get all alkanes tokens indexed by the system.
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi get-alkanes
# Example Output:
# Alkanes Tokens
# ═══════════════════════════════════
#
# 1. 2:0
# 2. 32:0
# 3. 4:65522
# ...
#
# Total: 25dataapi get-alkanes-by-address
Get alkanes tokens held by a specific address.
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi get-alkanes-by-address bc1p...
# Arguments:
# <ADDRESS> Bitcoin address to querydataapi get-pools
Get all liquidity pools from the AMM factory.
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi get-pools
# Example Output:
# Liquidity Pools
# ═══════════════════════════════════
#
# 1. DIESEL / frBTC LP
# Pool ID: 2:3
# Pair: 2:0 → 32:0
# Reserves: 300000000 × 50000
# LP Supply: 3872983
# Creator: bc1p...
#
# Total: 1 poolsdataapi get-pool-by-id
Get details for a specific liquidity pool.
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi get-pool-by-id 2:3
# Arguments:
# <POOL_ID> Pool ID (format: block:tx)dataapi get-address-balances
Get alkane balances for an address with UTXO tracking.
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi get-address-balances bc1p...
# Arguments:
# <ADDRESS> Bitcoin address to query
# Returns balances broken down by UTXO for accurate tracking.dataapi get-holders
Get all holders of a specific alkane token.
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi get-holders 2:0
# Arguments:
# <ALKANE_ID> Alkane IDdataapi get-holder-count
Get the number of unique holders for an alkane token.
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi get-holder-count 2:0
# Arguments:
# <ALKANE_ID> Alkane IDdataapi get-bitcoin-price
Get the current Bitcoin price.
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi get-bitcoin-pricedataapi get-block-height
Get the latest block height processed by the indexer.
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi get-block-height
# Example Output:
# {
# "height": 850123
# }dataapi health
Check if the Data API is healthy.
alkanes-cli -p mainnet \
--data-api https://mainnet.subfrost.io/v4/api \
dataapi health
# Output:
# OKREST API Equivalent
These DataAPI commands correspond to REST endpoints:
# CLI → REST endpoint mapping:
# get-alkanes → GET /alkanes
# get-pools → GET /pools
# get-address-balances → GET /address/{address}/balances
# get-block-height → GET /indexer/height
# health → GET /health