Developer-Friendly REST API
Integrate BCH address conversion into your application with our fast, reliable, and free RESTful API
https://bch-address-harmony.vercel.appReplace with your deployed domain. All endpoints are relative to this base URL.
No authentication required! Our API is completely open and free to use. Rate limiting may apply for excessive usage.
Convert a single BCH address between Legacy and CashAddr formats.
| Parameter | Type | Required | Description |
|---|---|---|---|
address | string | Yes | BCH address in any format (Legacy or CashAddr) |
curl -X POST https://bch-address-harmony.vercel.app/api/convert \
-H "Content-Type: application/json" \
-d '{"address": "1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu"}'const response = await fetch('/api/convert', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
address: '1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu'
})
});
const data = await response.json();
console.log(data);{
"original": "1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu",
"originalType": "Legacy Format",
"legacy": "1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu",
"cashAddrWithPrefix": "bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a",
"cashAddrNoPrefix": "qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a",
"addressType": "P2PKH",
"success": true
}{
"success": false,
"error": "Invalid BCH address format"
}Convert multiple BCH addresses in a single request (up to 10,000 addresses).
| Parameter | Type | Required | Description |
|---|---|---|---|
addresses | string[] | Yes | Array of BCH addresses (max 10,000) |
curl -X POST https://bch-address-harmony.vercel.app/api/batch \
-H "Content-Type: application/json" \
-d '{
"addresses": [
"1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu",
"bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a",
"3J98t1WpEZ73CNmYviecrnyiWrnqRhWNLy"
]
}'const addresses = [
'1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu',
'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a',
'3J98t1WpEZ73CNmYviecrnyiWrnqRhWNLy'
];
const response = await fetch('/api/batch', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ addresses })
});
const data = await response.json();
console.log(`Converted ${data.successful}/${data.total} addresses`);{
"total": 3,
"successful": 3,
"failed": 0,
"results": [
{
"index": 1,
"input": "1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu",
"legacy": "1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu",
"cashAddrWithPrefix": "bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a",
"cashAddrNoPrefix": "qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a",
"addressType": "P2PKH",
"success": true
}
]
}| Field | Type | Description |
|---|---|---|
legacy | string | Legacy format address (1xxx or 3xxx) |
cashAddrWithPrefix | string | CashAddr with bitcoincash: prefix (recommended) |
cashAddrNoPrefix | string | CashAddr without prefix |
addressType | string | Either "P2PKH" or "P2SH" |
original | string | Original input address |
originalType | string | "Legacy Format" or "CashAddr Format" |
| Code | Description |
|---|---|
| 200 | Success - Address converted successfully |
| 400 | Bad Request - Invalid address format or missing parameters |
| 429 | Too Many Requests - Rate limit exceeded |
| 413 | Payload Too Large - Request body exceeds size limit |
| 500 | Internal Server Error - Something went wrong on our end |
Note: Rate limits are enforced per IP address. For higher limits, consider using the web interface or implementing client-side caching.
import requests
url = "https://bch-address-harmony.vercel.app/api/convert"
payload = {"address": "1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu"}
response = requests.post(url, json=payload)
data = response.json()
if data.get("success"):
print(f"Legacy: {data['legacy']}")
print(f"CashAddr: {data['cashAddrWithPrefix']}")
else:
print(f"Error: {data.get('error')}")const axios = require('axios');
const convertAddress = async (address) => {
try {
const response = await axios.post(
'https://bch-address-harmony.vercel.app/api/convert',
{ address }
);
return response.data;
} catch (error) {
console.error('Conversion failed:', error.response?.data?.error);
throw error;
}
};
// Usage
convertAddress('1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu')
.then(result => console.log(result))
.catch(err => console.error(err));<?php
$url = 'https://bch-address-harmony.vercel.app/api/convert';
$data = array('address' => '1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu');
$options = array(
'http' => array(
'header' => "Content-type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$response = json_decode($result, true);
if ($response['success']) {
echo "Legacy: " . $response['legacy'] . "\n";
echo "CashAddr: " . $response['cashAddrWithPrefix'] . "\n";
}
?>Convert addresses for compatibility with different wallet formats
Display addresses in multiple formats for user convenience
Validate and normalize deposit addresses from users
Integrate address conversion into BCH development workflows
Have questions or feedback? We'd love to hear from you!
🐛 Report Issues: Open an issue on GitHub
💬 Community: Join BCH Telegram channel
📧 Contact: Built for BCH Blaze 2025 Hackathon