Get Started with Bitmessa
This page will help you get started with Bitmessa. You'll be up and running in no time!
API Overview
The Bitmessa API provides enterprise-grade programmatic access to sell Bitcoin and USDT for Nigerian Naira through a robust REST API with real-time rates and secure payment processing. Our comprehensive platform includes advanced Bitcoin Core RPC integration, bank account management, and complete transaction lifecycle support, designed specifically for developers, businesses, and financial institutions.
AI Endpoint Finder
Describe your project, and we'll recommend the right endpoints for you.
Base URL
https://api2.bitmessa.com/
Authentication
All API requests require an API key. Contact us at api@bitmessa.com to get your API key.
your_api_key
Get Rates
Retrieve current exchange rates for BTC and USDT to NGN
/get/rate
Fetch current exchange rates and market information for cryptocurrency conversions.
curl -X GET https://api2.bitmessa.com/get/rate \
-F 'secretkey=your_api_key'
const formData = new FormData();
formData.append('secretkey', 'your_api_key');
fetch('https://api2.bitmessa.com/get/rate', {
method: 'GET',
body: formData
})
.then(response => response.json())
.then(data => {
console.log('Exchange rates:', data.result);
console.log('Bitmessa rate:', data.result.bitmessa);
console.log('USDT rate:', data.result.usdt);
})
.catch(error => {
console.error('Error fetching rates:', error);
});
import requests
url = 'https://api2.bitmessa.com/get/rate'
data = {
'secretkey': 'your_api_key'
}
try:
response = requests.get(url, data=data)
response.raise_for_status()
result = response.json()
print(f"Success: {result['success']}")
print(f"Bitmessa rate: {result['result']['bitmessa']}")
print(f"USDT rate: {result['result']['usdt']}")
print(f"NGN amount: {result['result']['ngn']}")
except requests.exceptions.RequestException as e:
print(f"Error fetching rates: {e}")
'your_api_key'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$result = json_decode($response, true);
echo "Success: " . ($result['success'] ? 'true' : 'false') . "\n";
echo "Bitmessa rate: " . $result['result']['bitmessa'] . "\n";
echo "USDT rate: " . $result['result']['usdt'] . "\n";
echo "NGN amount: " . $result['result']['ngn'] . "\n";
} else {
echo "Error: HTTP $httpCode\n";
}
?>
{
"success": true,
"message": "rate fetched",
"code": null,
"result": {
"bitmessa": 1323,
"usdt": 0.998294,
"message": "Max deposit: $19,999. For higher amounts, DM on WhatsApp. Thank you.",
"bot": true,
"site": true,
"ngn": 36576320,
"usd": 40417
},
"result_info": {},
"errors": {}
}
{
"success": false,
"message": "Invalid API key",
"code": "AUTH_ERROR",
"result": null,
"result_info": {},
"errors": {
"secretkey": "API key is required and must be valid"
}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your API key for authentication |
Response Fields
bitmessa
Current Bitmessa rate
usdt
USDT exchange rate
ngn
Nigerian Naira amount
usd
US Dollar amount
Request Payment ID
Create a new payment request and get a unique payment ID
/payment
Create a new payment request to receive a unique payment ID and cryptocurrency address for the transaction.
curl -X POST https://api2.bitmessa.com/payment \
-F 'secretkey=your_api_key' \
-F 'coin=TRON-USDT'
const formData = new FormData();
formData.append('secretkey', 'your_api_key');
formData.append('coin', 'TRON-USDT');
fetch('https://api2.bitmessa.com/payment', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data.success) {
console.log('Payment ID:', data.result.payment._id);
console.log('Address:', data.result.payment.address);
console.log('Coin:', data.result.payment.coin);
} else {
console.error('Error:', data.message);
}
})
.catch(error => {
console.error('Request failed:', error);
});
import requests
url = 'https://api2.bitmessa.com/payment'
data = {
'secretkey': 'your_api_key',
'coin': 'TRON-USDT'
}
try:
response = requests.post(url, data=data)
response.raise_for_status()
result = response.json()
if result['success']:
payment = result['result']['payment']
print(f"Payment ID: {payment['_id']}")
print(f"Address: {payment['address']}")
print(f"Coin: {payment['coin']}")
print(f"Gateway: {payment['gateway']}")
else:
print(f"Error: {result['message']}")
except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")
'your_api_key',
'coin' => 'TRON-USDT'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$result = json_decode($response, true);
if ($result['success']) {
$payment = $result['result']['payment'];
echo "Payment ID: " . $payment['_id'] . "\n";
echo "Address: " . $payment['address'] . "\n";
echo "Coin: " . $payment['coin'] . "\n";
echo "Gateway: " . $payment['gateway'] . "\n";
} else {
echo "Error: " . $result['message'] . "\n";
}
} else {
echo "HTTP Error: $httpCode\n";
}
?>
{
"success": true,
"message": "found payment",
"code": 200,
"result": {
"payment": {
"_id": "65a98b4082fafe4091fa9684",
"address": "TFxjVC8X4FFXyM94BxMgf2x8odySZXxKAp",
"user_id": "63afe34d5d9508186fa03e3b",
"gateway": "BITMESSA",
"phone_number": 0000000000000,
"coin": "TRON-USDT",
"coin_amount": 0,
"ngn_rate": 0,
"coin_usdt_rate": 0,
"ngn_amount": 0,
"usd_amount": 0,
"txid": "",
"bank_txid": "",
"block": 0,
"close": false,
"ready": false,
"funded": false,
"imported": true,
"processed": false,
"memepool": false,
"error": false,
"date": 1705610048358,
"confirmation_date": 0,
"index": 1561,
"__v": 0
},
"account": {}
},
"result_info": {}
}
{
"success": false,
"message": "Invalid coin type",
"code": "INVALID_COIN",
"result": null,
"result_info": {},
"errors": {
"coin": "Coin type must be one of: TRON-USDT, BTC, ETH"
}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your API key for authentication |
coin |
string | Yes | Cryptocurrency type: TRON-USDT or BTC |
Request Payment Data
Retrieve detailed information about a specific payment request
/payment/{payment_id}
Fetch detailed information about a payment request using its unique ID.
cURL Example
curl -X GET https://api2.bitmessa.com/payment/{payment_id} \
-F 'secretkey=your_api_key'
Response Example
{
"success": true,
"message": "found payment",
"code": 200,
"result": {
"payment": {
"_id": "65a98b4082fafe4091fa9684",
"address": "TFxjVC8X4FFXyM94BxMgf2x8odySZXxKAp",
"user_id": "63afe34d5d9508186fa03e3b",
"gateway": "BITMESSA",
"phone_number": 0000000000000,
"coin": "TRON-USDT",
"coin_amount": 9,
"ngn_rate": 0,
"coin_usdt_rate": 0,
"ngn_amount": 0,
"usd_amount": 0,
"txid": "5a7fc948f80117896a4a2a2ea915c6466c7ccbf4b55cc1a7ddd9abc491d5eb4a",
"bank_txid": "",
"block": 1705610337000,
"close": false,
"ready": false,
"funded": false,
"imported": true,
"processed": false,
"memepool": true,
"error": false,
"date": 1705610048358,
"confirmation_date": 0,
"index": 1561,
"__v": 0,
"confirmations": 2
},
"account": {}
},
"result_info": {}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your API key for authentication |
payment_id |
string | Yes | The unique ID of the payment request |
Request User Accounts
Retrieve a list of user bank accounts
/accounts
Fetch a list of user bank accounts associated with the authenticated user.
cURL Example
curl -X GET https://api2.bitmessa.com/accounts \
-F 'secretkey=your_api_key'
Response Example
{
"success": true,
"message": "Got all Accounts",
"code": 200,
"result": {
"result": [
{
"_id": "65a99a7483d08157c391719a",
"id": "784d4846-5e28-4eff-9f1b-8a10b2d82dc1",
"name": "Joe Doe",
"currency": "NGN",
"accountName": " Joe Doe",
"accountNumber": "0000000000",
"bankCode": "000004",
"bankName": "UNITED BANK FOR AFRICA",
"freeze": false,
"date": 1705613940141,
"__v": 0
}
]
},
"result_info": {
"info": {
"total_count": 1,
"total": 1,
"pages": 1,
"current": 1,
"accounts": 1
}
}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your API key for authentication |
Request Bank List
Retrieve a list of available Nigerian banks
/banks/get
Fetch a list of Nigerian banks that can be used for account resolution.
cURL Example
curl -X GET https://api2.bitmessa.com/banks/get \
-F 'secretkey=your_api_key'
Response Example
{
"success": true,
"message": "Banks list",
"code": 200,
"result": {
"banks": [
{
"code": "110072",
"name": "78 FINANCE COMPANY LIMITED"
},
{
"code": "120001",
"name": "9 PAYMENT SOLUTIONS BANK"
},
{
"code": "090629",
"name": "9JAPAY MICROFINANCE BANK"
},
...
]
},
"result_info": {}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your API key for authentication |
Resolve Bank Account
Resolve a user's bank account details
/account-resolve
Resolve a user's bank account details (account name, number, and bank) using their account number and bank code.
cURL Example
curl -X POST https://api2.bitmessa.com/account-resolve \
-F 'secretkey=your_api_key' \
-F 'account_number=0123456789' \
-F 'bank_code=000004'
Response Example
{
"success": true,
"message": "Banks list",
"code": 200,
"result": {
"response": {
"status": true,
"message": "",
"data": {
"accountName": "Joe Doe",
"accountNumber": "0000000000",
"bank": {
"code": "000004",
"name": "UNITED BANK FOR AFRICA"
}
}
}
},
"result_info": {}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your API key for authentication |
account_number |
string | Yes | User's account number |
bank_code |
string | Yes | User's bank code |
Assign Bank Account
Assign a bank account to a specific payment request
/account/assign/{payment_id}
Assign a bank account to a payment request using its unique ID.
cURL Example
curl -X POST https://api2.bitmessa.com/account/assign/{payment_id} \
-F 'secretkey=your_api_key' \
-F 'account_number=0123456789' \
-F 'bank_code=000004'
Response Example
{
"success": true,
"message": "asssigned bank account",
"code": 200,
"result": {
"payment": {
"_id": "65a98b4082fafe4091fa9684",
"address": "TFxjVC8X4FFXyM94BxMgf2x8odySZXxKAp",
"user_id": "63afe34d5d9508186fa03e3b",
"gateway": "BITMESSA",
"phone_number": 0000000000000,
"coin": "TRON-USDT",
"coin_amount": 9,
"ngn_rate": 0,
"coin_usdt_rate": 0,
"ngn_amount": 0,
"usd_amount": 0,
"txid": "5a7fc948f80117896a4a2a2ea915c6466c7ccbf4b55cc1a7ddd9abc491d5eb4a",
"bank_txid": "",
"block": 1705610337000,
"close": false,
"ready": true,
"funded": false,
"imported": true,
"processed": false,
"memepool": true,
"error": false,
"date": 1705610048358,
"confirmation_date": 0,
"index": 1561,
"__v": 0,
"confirmations": 2,
"bank_name": "Joe Doe",
"bank_number": "16792453844460000000000",
"account": {
"_id": "64174048c3883f93745ee50b",
"id": "16792453844460000000000",
"user_id": "63afe34d5d9508186fa03e3b",
"name": "Joe Doe",
"currency": "NGN",
"accountName": "Joe Doe",
"accountNumber": "0000000000",
"bankCode": "000004",
"bankName": "UNITED BANK FOR AFRICA",
"freeze": false,
"date": 1679245384446,
"__v": 0
}
}
},
"result_info": {}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your API key for authentication |
payment_id |
string | Yes | The unique ID of the payment request |
account_number |
string | Yes | User's account number |
bank_code |
string | Yes | User's bank code |
Request Final Payment Data
Retrieve detailed information about a specific payment request
/payment/{payment_id}
Fetch detailed information about a payment request using its unique ID.
cURL Example
curl -X GET https://api2.bitmessa.com/payment/{payment_id} \
-F 'secretkey=your_api_key'
Response Example
{
"success": true,
"message": "found payment",
"code": 200,
"result": {
"payment": {
"_id": "65a98b4082fafe4091fa9684",
"address": "TFxjVC8X4FFXyM94BxMgf2x8odySZXxKAp",
"user_id": "63afe34d5d9508186fa03e3b",
"gateway": "BITMESSA",
"phone_number": 0000000000,
"coin": "TRON-USDT",
"coin_amount": 9,
"ngn_rate": 0,
"coin_usdt_rate": 0,
"ngn_amount": 0,
"usd_amount": 0,
"txid": "5a7fc948f80117896a4a2a2ea915c6466c7ccbf4b55cc1a7ddd9abc491d5eb4a",
"bank_txid": "",
"block": 1705610337000,
"close": false,
"ready": true,
"funded": false,
"imported": true,
"processed": false,
"memepool": true,
"error": false,
"date": 1705610048358,
"confirmation_date": 0,
"index": 1561,
"__v": 0,
"confirmations": 2,
"account": {
"_id": "64174048c3883f93745ee50b",
"id": "16792453844460000000000",
"user_id": "63afe34d5d9508186fa03e3b",
"name": "Joe Doe",
"currency": "NGN",
"accountName": "Joe Doe",
"accountNumber": "0000000000",
"bankCode": "000004",
"bankName": "UNITED BANK FOR AFRICA",
"freeze": false,
"date": 1679245384446,
"__v": 0
},
"bank_name": "Joe Doe",
"bank_number": "16792453844460000000000"
},
"account": {
"_id": "64174048c3883f93745ee50b",
"id": "16792453844460000000000",
"user_id": "63afe34d5d9508186fa03e3b",
"name": "Joe Doe",
"currency": "NGN",
"accountName": "Joe Doe",
"accountNumber": "0000000000",
"bankCode": "000004",
"bankName": "UNITED BANK FOR AFRICA",
"freeze": false,
"date": 1679245384446,
"__v": 0
}
},
"result_info": {}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your API key for authentication |
payment_id |
string | Yes | The unique ID of the payment request |
Finalize Payment
Finalize a payment request and confirm the transaction
/payment/finalize/{payment_id}
Finalize a payment request by providing the payment ID, account number, and bank code.
cURL Example
curl -X GET https://api2.bitmessa.com/payment/finalize/{payment_id} \
-F 'secretkey=your_api_key' \
-F 'account_number=0123456789' \
-F 'bank_code=000004'
Response Example
{
"success": true,
"message": "fixed rate for Payment",
"code": 200,
"result": {
"payment": {
"_id": "65a98b4082fafe4091fa9684",
"address": "TFxjVC8X4FFXyM94BxMgf2x8odySZXxKAp",
"user_id": "63afe34d5d9508186fa03e3b",
"gateway": "BITMESSA",
"phone_number": 0000000000,
"coin": "TRON-USDT",
"coin_amount": 9,
"ngn_rate": 1323,
"coin_usdt_rate": 0.998579,
"ngn_amount": 11891,
"usd_amount": 9,
"txid": "5a7fc948f80117896a4a2a2ea915c6466c7ccbf4b55cc1a7ddd9abc491d5eb4a",
"bank_txid": "",
"block": 1705610337000,
"close": true,
"ready": true,
"funded": false,
"imported": true,
"processed": false,
"memepool": true,
"error": false,
"date": 1705610048358,
"confirmation_date": 0,
"index": 1561,
"__v": 0,
"confirmations": 2,
"account": {
"_id": "64174048c3883f93745ee50b",
"id": "16792453844460000000000",
"user_id": "63afe34d5d9508186fa03e3b",
"name": "Joe Doe",
"currency": "NGN",
"accountName": "Joe Doe",
"accountNumber": "0000000000",
"bankCode": "000004",
"bankName": "UNITED BANK FOR AFRICA",
"freeze": false,
"date": 1679245384446,
"__v": 0
},
"bank_name": "Joe Doe",
"bank_number": "16792453844460000000000"
},
"account": {
"_id": "64174048c3883f93745ee50b",
"id": "16792453844460000000000",
"user_id": "63afe34d5d9508186fa03e3b",
"name": "Joe Doe",
"currency": "NGN",
"accountName": "Joe Doe",
"accountNumber": "0000000000",
"bankCode": "000004",
"bankName": "UNITED BANK FOR AFRICA",
"freeze": false,
"date": 1679245384446,
"__v": 0
}
},
"result_info": {}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your API key for authentication |
payment_id |
string | Yes | The unique ID of the payment request |
account_number |
string | Yes | User's account number |
bank_code |
string | Yes | User's bank code |
Bitcoin Core RPC API Overview
Complete Bitcoin Core RPC API reference for advanced Bitcoin operations
Bitcoin Core RPC API
The Bitcoin Core RPC API provides advanced access to Bitcoin operations through the Bitmessa platform. This API requires a special RPC access key that you can request from our team.
https://api2.bitmessa.com/bitcoin/
RPC Configuration
Authentication
Bitcoin Core RPC uses the same secretkey authentication as the main API:
secretkey=your_rpc_access_key
Request Format
All RPC calls use JSON-RPC 1.0 format with secretkey authentication:
{
"jsonrpc": "1.0",
"id": "request_id",
"method": "method_name",
"params": ["param1", "param2"],
"secretkey": "your_rpc_access_key"
}
Response Format
{
"jsonrpc": "1.0",
"id": "request_id",
"result": "method_result",
"error": null
}
Access Requirements
- RPC Access Key: Contact us to request special RPC access
- Authentication: Use secretkey parameter for all requests
- Rate Limits: RPC calls have higher rate limits than standard API
- Advanced Features: Direct blockchain and wallet operations
- Security: All requests are logged and monitored
Wallet RPC Methods
Manage Bitcoin addresses, transactions, and wallet operations
https://api2.bitmessa.com/bitcoin/getnewaddress
Generate New Address
Generates a new Bitcoin address for receiving payments.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getnewaddress",
"params": ["label", "address_type"],
"secretkey": "your_rpc_access_key"
}
{
"jsonrpc": "1.0",
"id": "curltest",
"result": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"error": null
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your RPC access key |
label |
string | No | Label for the address |
address_type |
string | No | Address type: "legacy", "p2sh-segwit", "bech32" |
https://api2.bitmessa.com/bitcoin/importaddress
Import Address
Imports an address for monitoring and transaction tracking.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "importaddress",
"params": ["1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "payment_label", false, false],
"secretkey": "your_rpc_access_key"
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
secretkey |
string | Yes | Your RPC access key |
address |
string | Yes | Bitcoin address to import |
label |
string | Yes | Label for the address |
rescan |
boolean | Yes | Whether to rescan the blockchain |
p2sh |
boolean | Yes | Whether this is a P2SH address |
https://api2.bitmessa.com/bitcoin/listtransactions
List Transactions
Returns the most recent transactions for a label or address.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "listtransactions",
"params": ["label", 10, 0, true],
"secretkey": "your_rpc_access_key"
}
{
"jsonrpc": "1.0",
"id": "curltest",
"result": [
{
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"category": "receive",
"amount": 0.001,
"label": "payment_label",
"vout": 0,
"confirmations": 6,
"blockhash": "0000000000000000000000000000000000000000000000000000000000000000",
"blockindex": 0,
"blocktime": 1234567890,
"txid": "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"walletconflicts": [],
"time": 1234567890,
"timereceived": 1234567890,
"bip125-replaceable": "no"
}
],
"error": null
}
https://api2.bitmessa.com/bitcoin/getbalance
Get Wallet Balance
Returns the total available balance in the wallet.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getbalance",
"params": ["*", 0],
"secretkey": "your_rpc_access_key"
}
{
"jsonrpc": "1.0",
"id": "curltest",
"result": 0.12345678,
"error": null
}
Blockchain RPC Methods
Access blockchain data, blocks, and transaction information
https://api2.bitmessa.com/bitcoin/getblockchaininfo
Get Blockchain Information
Returns information about the blockchain status and network.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getblockchaininfo",
"params": [],
"secretkey": "your_rpc_access_key"
}
{
"jsonrpc": "1.0",
"id": "curltest",
"result": {
"chain": "main",
"blocks": 800000,
"headers": 800000,
"bestblockhash": "0000000000000000000000000000000000000000000000000000000000000000",
"difficulty": 123456789.123456789,
"mediantime": 1234567890,
"verificationprogress": 0.9999,
"initialblockdownload": false,
"chainwork": "0000000000000000000000000000000000000000000000000000000000000000",
"size_on_disk": 123456789,
"pruned": false,
"pruneheight": 0,
"automatic_pruning": false,
"prune_target_size": 0,
"warnings": ""
},
"error": null
}
https://api2.bitmessa.com/bitcoin/getblock
Get Block Information
Returns detailed information about a specific block.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getblock",
"params": ["0000000000000000000000000000000000000000000000000000000000000000", 2],
"secretkey": "your_rpc_access_key"
}
https://api2.bitmessa.com/bitcoin/getrawtransaction
Get Raw Transaction
Returns the raw transaction data and details.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getrawtransaction",
"params": ["1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", true],
"secretkey": "your_rpc_access_key"
}
Network RPC Methods
Manage network connections and peer information
https://api2.bitmessa.com/bitcoin/getnetworkinfo
Get Network Information
Returns information about the Bitcoin network status.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getnetworkinfo",
"params": [],
"secretkey": "your_rpc_access_key"
}
https://api2.bitmessa.com/bitcoin/getpeerinfo
Get Peer Information
Returns information about connected network peers.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getpeerinfo",
"params": [],
"secretkey": "your_rpc_access_key"
}
Control RPC Methods
Control and manage the Bitcoin Core node
https://api2.bitmessa.com/bitcoin/getmemoryinfo
Get Memory Information
Returns information about memory usage and system status.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getmemoryinfo",
"params": [],
"secretkey": "your_rpc_access_key"
}
https://api2.bitmessa.com/bitcoin/help
Get Help
Returns help information for RPC methods.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "help",
"params": ["getblockchaininfo"],
"secretkey": "your_rpc_access_key"
}
Fee Estimation RPC Methods
Estimate network fees and analyze mempool data
https://api2.bitmessa.com/bitcoin/estimatesmartfee
Estimate Smart Fee
Estimates the fee rate (in BTC/kB) needed for a transaction to be confirmed within a target number of blocks.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "estimatesmartfee",
"params": [6, "CONSERVATIVE"],
"secretkey": "your_rpc_access_key"
}
{
"jsonrpc": "1.0",
"id": "curltest",
"result": {
"feerate": 0.00001000,
"blocks": 6
},
"error": null
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
conf_target |
number | Yes | Target number of blocks for confirmation (1-1008) |
estimate_mode |
string | No | Fee estimation mode: "UNSET", "ECONOMICAL", "CONSERVATIVE" |
secretkey |
string | Yes | Your RPC access key |
Response Fields
feerate
Fee rate in BTC per kilobyte
blocks
Number of blocks for confirmation
https://api2.bitmessa.com/bitcoin/getmempoolinfo
Get Mempool Information
Returns information about the transaction memory pool including size, fees, and statistics.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getmempoolinfo",
"params": [],
"secretkey": "your_rpc_access_key"
}
{
"jsonrpc": "1.0",
"id": "curltest",
"result": {
"loaded": true,
"size": 1234,
"bytes": 567890,
"usage": 1234567,
"maxmempool": 300000000,
"mempoolminfee": 0.00001000,
"minrelaytxfee": 0.00001000
},
"error": null
}
Response Fields
loaded
Whether mempool is loaded
size
Number of transactions in mempool
bytes
Total size of mempool in bytes
usage
Memory usage in bytes
maxmempool
Maximum mempool size in bytes
mempoolminfee
Minimum fee rate for mempool inclusion
minrelaytxfee
Minimum relay fee rate
https://api2.bitmessa.com/bitcoin/getmempoolentry
Get Mempool Entry
Returns mempool data for a specific transaction ID including fee information.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getmempoolentry",
"params": ["txid"],
"secretkey": "your_rpc_access_key"
}
{
"jsonrpc": "1.0",
"id": "curltest",
"result": {
"vsize": 123,
"weight": 492,
"fee": 0.00012345,
"modifiedfee": 0.00012345,
"time": 1234567890,
"height": 123456,
"descendantcount": 1,
"descendantsize": 123,
"descendantfees": 0.00012345,
"ancestorcount": 0,
"ancestorsize": 0,
"ancestorfees": 0.0,
"wtxid": "wtxid",
"fees": {
"base": 0.00012345,
"modified": 0.00012345,
"ancestor": 0.0,
"descendant": 0.00012345
},
"depends": [],
"spentby": []
},
"error": null
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
txid |
string | Yes | The transaction ID to look up |
secretkey |
string | Yes | Your RPC access key |
https://api2.bitmessa.com/bitcoin/estimaterawfee
Estimate Raw Fee
Estimates the fee rate for a raw transaction based on current mempool conditions.
{
"jsonrpc": "1.0",
"id": "curltest",
"method": "estimaterawfee",
"params": [6, 0.95],
"secretkey": "your_rpc_access_key"
}
{
"jsonrpc": "1.0",
"id": "curltest",
"result": {
"feerate": 0.00001000,
"decay": 0.962,
"scale": 2,
"pass": {
"startrange": 0,
"endrange": 6,
"withintarget": 6,
"totalconfirmed": 6,
"inmempool": 0,
"leftmempool": 0
},
"fail": {
"startrange": 0,
"endrange": 6,
"withintarget": 0,
"totalconfirmed": 0,
"inmempool": 0,
"leftmempool": 0
},
"errors": []
},
"error": null
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
conf_target |
number | Yes | Target number of blocks for confirmation |
threshold |
number | Yes | Threshold for fee estimation (0.0-1.0) |
secretkey |
string | Yes | Your RPC access key |
RPC Examples
Practical examples of Bitcoin Core RPC usage
cURL Examples
Here are practical examples of how to interact with the Bitcoin Core RPC API using cURL with secretkey authentication.
Get Blockchain Info
Get Current Blockchain Status
curl -X POST "https://api2.bitmessa.com/bitcoin/getblockchaininfo" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getblockchaininfo",
"params": [],
"secretkey": "your_rpc_access_key"
}'
Generate New Address
Create New Bitcoin Address
curl -X POST "https://api2.bitmessa.com/bitcoin/getnewaddress" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getnewaddress",
"params": ["new_payment", "bech32"],
"secretkey": "your_rpc_access_key"
}'
List Transactions
Get Transactions for a Label
curl -X POST "https://api2.bitmessa.com/bitcoin/listtransactions" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "1.0",
"id": "curltest",
"method": "listtransactions",
"params": ["test_label"],
"secretkey": "your_rpc_access_key"
}'
Get Wallet Balance
Check Wallet Balance
curl -X POST "https://api2.bitmessa.com/bitcoin/getbalance" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "1.0",
"id": "curltest",
"method": "getbalance",
"params": ["*", 0],
"secretkey": "your_rpc_access_key"
}'
Interactive API Documentation
Explore and test all API endpoints interactively with our Swagger UI integration.
Try It Out
Use the interactive documentation below to explore all available endpoints, view request/response schemas, and test API calls directly from your browser.
API Key Setup
To test authenticated endpoints, you'll need to provide your API key. Click the "Authorize" button in the Swagger UI and enter your API key.
your_api_key_here