REST API Overview
The Subfrost REST API provides high-level endpoints for alkanes, AMM pools, and blockchain data. These endpoints are part of the alkanes-data-api service.
Base URLs
Choose the network for your application:
Mainnet:
https://mainnet.subfrost.io/v4/apiSignet:
https://signet.subfrost.io/v4/apiRegtest:
https://regtest.subfrost.io/v4/apiAuthentication
- Public endpoint - /v4/api/{route} (with CORS from registered domain)
- API key in path - /v4/{api_key}/{route}
- API key header - /v4/api/{route} with x-subfrost-api-key header
Request Format
All endpoints accept POST requests with JSON bodies.
curl -X POST https://mainnet.subfrost.io/v4/api/get-bitcoin-price \
-H "Content-Type: application/json" \
-d '{}'
# Or with API key:
curl -X POST https://mainnet.subfrost.io/v4/YOUR_API_KEY/get-bitcoin-price \
-H "Content-Type: application/json" \
-d '{}'Response Format
All responses follow this structure:
// Success
{
"statusCode": 200,
"data": { /* response data */ }
}
// Error
{
"statusCode": 400,
"error": "Invalid request parameters"
}Endpoint Categories
Alkanes
Query alkane tokens and contracts.
| Endpoint | Description |
|---|---|
| POST /get-alkanes | List all alkanes |
| POST /get-alkanes-by-address | Alkanes for an address |
| POST /get-alkane-details | Specific alkane info |
| POST /global-alkanes-search | Search alkanes |
Pools & AMM
Liquidity pools and AMM operations.
| Endpoint | Description |
|---|---|
| POST /get-pools | List all pools |
| POST /get-pool-details | Pool details |
| POST /get-all-pools-details | All pool details |
| POST /address-positions | Liquidity positions |
Bitcoin/UTXOs
Bitcoin balance and UTXO queries.
| Endpoint | Description |
|---|---|
| POST /get-address-balance | Address balance |
| POST /get-taproot-balance | Taproot balance |
| POST /get-address-utxos | Address UTXOs |
| POST /get-account-utxos | Account UTXOs |
History
Transaction history for AMM operations.
| Endpoint | Description |
|---|---|
| POST /get-pool-swap-history | Pool swap history |
| POST /get-token-swap-history | Token swap history |
| POST /get-pool-mint-history | Liquidity adds |
| POST /get-pool-burn-history | Liquidity removes |
Bitcoin Price
Real-time BTC price from Uniswap V3 WBTC/USDC pool.
| Endpoint | Description |
|---|---|
| POST /get-bitcoin-price | Current BTC price in USD |
| POST /get-bitcoin-market-chart | Historical price data |
| POST /get-bitcoin-market-weekly | 52-week high/low |
Health Check
GET https://mainnet.subfrost.io/v4/api/health
// Response:
{
"status": "ok",
"timestamp": 1699123456
}JavaScript Example
const API_BASE = 'https://mainnet.subfrost.io/v4/api';
async function getAlkanesByAddress(address) {
const response = await fetch(`${API_BASE}/get-alkanes-by-address`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ address })
});
const data = await response.json();
if (data.statusCode !== 200) {
throw new Error(data.error);
}
return data.data;
}
const alkanes = await getAlkanesByAddress('bc1p...');
console.log('Alkane holdings:', alkanes);