Introduction
This quickstart walks you through your first request to the Bitcoin Data API. Under the hood it’s the Moralis Universal API — every endpoint is the same one EVM and Solana developers already use, just withbitcoin as the chain.
You’ll fetch BTC balances and a page of wallet history, then call the xpub utility. The interesting part: the wallet endpoints accept either an address or an xpub as input, so you can drop the API into whichever shape your app already has.
Prerequisites
- Node.js v18+ installed
- A Moralis API key (get one free)
Step 1: Set up your project
Step 2: Fetch a BTC balance — by address
Create a file calledbalance-by-address.js:
Step 3: Fetch the same kind of balance — by xpub
The same endpoint accepts an xpub. Createbalance-by-xpub.js:
Step 4: Pull wallet transaction history
cursor to paginate.
Step 5: Get the current BTC price (with sparkline)
Step 6: Enumerate the addresses derived from an xpub
If your UI needs to display every address controlled by an xpub (not just query against it), call the utility endpoint:What’s next
- Bitcoin Wallet API — balances and history
- Bitcoin Price API — current price, history, sparklines
- Bitcoin Blockchain API — raw blocks and transactions
- Xpub Utility — enumerate derived addresses

