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_KEY

Alkanes Queries

CommandDescription
get-alkanesGet all alkanes tokens
get-alkanes-by-addressGet alkanes for an address
get-alkane-detailsGet details for a specific alkane

Pool & AMM

CommandDescription
get-poolsGet all liquidity pools
get-pool-by-idGet pool details by ID
get-pool-historyGet historical pool data
get-swap-historyGet swap history

Balances

CommandDescription
get-address-balancesGet alkane balances for an address (with UTXO tracking)
get-outpoint-balancesGet alkane balances for a specific outpoint
get-holdersGet holders of an alkane token
get-holder-countGet holder count for an alkane

Market Data

CommandDescription
get-bitcoin-priceGet current Bitcoin price
get-market-chartGet Bitcoin market chart

Indexer Status

CommandDescription
get-block-heightGet latest processed block height
get-block-hashGet latest processed block hash
get-indexer-positionGet indexer position (height + hash)
healthHealth 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: 25

dataapi 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 query

dataapi 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 pools

dataapi 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 ID

dataapi 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 ID

dataapi get-bitcoin-price

Get the current Bitcoin price.

alkanes-cli -p mainnet \
  --data-api https://mainnet.subfrost.io/v4/api \
  dataapi get-bitcoin-price

dataapi 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:
# OK

REST 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