Step 1: To access Bitcoin, use the following native access endpoints:
- Network: Bitcoin Mainnet
- Request Type: POST
https://svc.blockdaemon.com/bitcoin/mainnet/native
- Network: Bitcoin Testnet
- Request Type: POST
https://svc.blockdaemon.com/bitcoin/testnet/native
Step 2: You should authorize your request. Learn more: Authentication Guide
Step 3: Specify a Bitcoin method in the request body:
{
"jsonrpc": "2.0",
"id": 1,
"method": "YOUR_METHOD",
"params": []
}
Example Request
Using Bitcoin Custom Method
See the list of custom methods here.
Here’s a cURL example that shows how to use the bd_listtransactions method to retrieve native transactions for a particular Bitcoin address or transaction IDs.
curl -X POST \
https://svc.blockdaemon.com/bitcoin/mainnet/native \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "1.0",
"id": "curltest",
"method": "bd_listtransactions",
"params": [
"bc1q84e0f2qswgzth4tavedrv35f6fv9669ljww2ww",
{
"block_start": 850000,
"block_end": 862810,
"type": "all",
"verbose": false,
"page_size": 20,
"page_token": "OTIyMzM3MjAzNjg1MzkxMzY5NCM1YmIyZWY3MjExYTgyNjE0ODkxZDAyNzQzYzUzYjZkNzU5ZTE2MmU2MTFiNGQxZjljMDYyOTM3YzdjMzdkNjA3",
"order": "asc"
}
]
}'
From the request above, you will get the response below:
{
"id": "curltest",
"result": {
"transactions": [
"74980dd4049324587471e266ff144f0d75d81f0f44767deaf6babdc9b8703c57",
"08ba4c433016377851f2e5b4fdad14aa715cab8b2d6393828e1539775e5aabb2",
"f594f9fbd52014308544030cdf154236b65f24b5ab832e5447fff1509decca9d"
],
"page_token": "OTIyMzM3MjAzNjg1MzkxNzA2NSNmNTk0ZjlmYmQ1MjAxNDMwODU0NDAzMGNkZjE1NDIzNmI2NWYyNGI1YWI4MzJlNTQ0N2ZmZjE1MDlkZWNjYTlk"
}
}
Using Bitcoin RPC Method
Here is a cURL example for using getblockcount to get the height of the most-work fully-validated chain in Bitcoin Mainnet:
curl -X POST \
https://svc.blockdaemon.com/bitcoin/mainnet/native \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getblockcount",
"params": []
}'
The following is a typical response you will get:
{
"result": 748958,
"error": null,
"id": 1
}
👋 Need Help?
Contact us through email or our support page for any issues, bugs, or assistance you may need.