This document explains how third parties can integrate with our blockchain API. All API requests require authentication via headers.
See the GITHUB REPOSITORY at YEM Blockchain API Integration for more information.
Contact us to submit a ticket to request access or for increased rate limiting. Make sure you specify that you want it for the KEYCHAINLIFE.
The API has a rate limit of 10 requests per minute per API key. If you need a higher rate limit, please contact us.
Endpoint: POST /api/createTransactions.php
Creates multiple transactions in a batch (max 100 per request).
Note that the function uses UID's and not Pernum's in the parameters.
The `value` is the amount of the ASSET including decimals and always expressed as an integer. Example for asset YEM: 1234 is actually 12.34 YEM
[ { "from_uid": 123, "to_uid": 456, "value": 1234, "reason": "Payment for order #12345", "asset": "YEM", "from_curr": "EUR", "to_curr": "USD" }, { "from_uid": 789, "to_uid": 101, "value": 567, "reason": "Refund for order #67890", "asset": "YEM", "from_curr": "USD", "to_curr": "GBP" } ]
fetch('https://public.keychainlife.net/api/createTransactions.php', { method: 'POST', headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': 'YOUR_PERNUM', 'Content-Type': 'application/json' }, body: JSON.stringify([{ from_uid: 123, to_uid: 456, value: 1234, reason: "Payment for order #12345", asset: "YEM", from_curr: "EUR", to_curr: "USD" }, { from_uid: 789, to_uid: 101, value: 567, reason: "Refund for order #67890", asset: "YEM", from_curr: "USD", to_curr: "GBP" }]) }) .then(response => response.json()) .then(data => console.log(data));
$data = json_encode([[ 'from_uid' => 123, 'to_uid' => 456, 'value' => 1234, 'reason' => 'Payment for order #12345', 'asset' => 'YEM', 'from_curr' => 'EUR', 'to_curr' => 'USD' ], [ 'from_uid' => 789, 'to_uid' => 101, 'value' => 567, 'reason' => 'Refund for order #67890', 'asset' => 'YEM', 'from_curr' => 'USD', 'to_curr' => 'GBP' ]]); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://public.keychainlife.net/api/createTransactions.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: yourdomain.com', 'Pernum: YOUR_PERNUM', 'Content-Type: application/json' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "success": true, "message": "1 transactions inserted successfully.", "inserted_count": 1, "transaction_hashes": [ "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12345678" ] }
Endpoint: GET /api/getBalances.php
Retrieves balances for multiple UIDs (max 100 per request).
fetch('https://public.keychainlife.net/api/getBalances.php?uids=123,456&tokenSymbol=YEM', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': 'YOUR_PERNUM' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://public.keychainlife.net/api/getBalances.php?uids=123,456&tokenSymbol=YEM'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: yourdomain.com', 'Pernum: YOUR_PERNUM' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "balances": { "123": "1000.00", "456": "2000.00" } }
Endpoint: GET /api/getGlobals.php
Retrieves global blockchain statistics.
fetch('https://public.keychainlife.net/api/getGlobals.php', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': 'YOUR_PERNUM' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://public.keychainlife.net/api/getGlobals.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: 'yourdomain.com', 'Pernum: YOUR_PERNUM' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "success": true, "total_accs": 15000, "total_txns": 50000, "price": "1.00" }
Endpoint: GET /api/getTxnVolume.php
Retrieves transaction volume statistics.
fetch('https://public.keychainlife.net/api/getTxnVolume.php?tokenSymbol=YEM', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': 'YOUR_PERNUM' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://public.keychainlife.net/api/getTxnVolume.php?tokenSymbol=YEM'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: yourdomain.com', 'Pernum: YOUR_PERNUM' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "success": true, "volume_1d": 15000.25, "volume_7d": 105000.75, "num_addresses": 500, "balances": 250000.50, "transaction_count": 1250, "cacheHit": true }
Endpoint: GET /api/getTxnHashes.php
Retrieves statuses for multiple transaction hashes (max 100 per request).
Especially useful after using the createTransactions function to ensure they have been processed from the Mempool.
The returned status is an integer as follows:
fetch('https://public.keychainlife.net/api/getTxnHashes.php?hashes=0xa1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12345678,0xb2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890,0x243347373ddb571b4794580fbd852622b2d5ac6a7c567683f5a6614fabe04a85', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': 'YOUR_PERNUM' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://public.keychainlife.net/api/getTxnHashes.php?hashes=0xa1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12345678,0xb2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890,0x243347373ddb571b4794580fbd852622b2d5ac6a7c567683f5a6614fabe04a85'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: yourdomain.com', 'Pernum: YOUR_PERNUM' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "statuses": { "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12345678": "1", "b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890": "2", "c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890ab": "0" } }
{ "error": "Maximum 100 hashes allowed." }
{ "error": "Missing hashes." }
Endpoint: GET /api/getAssetStats.php
Retrieves price and number of wallets holding a balance of that asset.
fetch('https://public.keychainlife.net/api/getAssetStats.php?tokenSymbol=YEM', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': 'YOUR_PERNUM' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://public.keychainlife.net/api/getAssetStats.php?tokenSymbol=YEM'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: yourdomain.com', 'Pernum: YOUR_PERNUM' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "price": "1.00", "wallets": 1257632 }
Endpoint: GET /api/getPublicKey.php
Retrieves the Ethereum public key for a specific UID.
fetch('https://public.keychainlife.net/api/getPublicKey.php?uid=12345', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': 'YOUR_PERNUM' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://public.keychainlife.net/api/getPublicKey.php?uid=12345'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: yourdomain.com', 'Pernum: YOUR_PERNUM' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "success": true, "address": "0x742d35cc6634c0532925a3b844b91678f8c8f3a0" }
{ "success": false, "message": "Invalid uid parameter" }
{ "success": false, "message": "Public key not found for uid: 12345" }
Endpoint: GET /api/getTransactionHash.php
Retrieves transaction details by hash.
The `value` field is defined as an integer, so 123 for YEM would be 1.23 YEM as it has 2 decimal places.
fetch('https://public.keychainlife.net/api/getTransactionHash.php?hash=0x278d9e202a17d833f05f744758c5eb423411529e90cc0e5f04aa6825c30aab6e', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': 'YOUR_PERNUM' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://public.keychainlife.net/api/getTransactionHash.php?hash=0x278d9e202a17d833f05f744758c5eb423411529e90cc0e5f04aa6825c30aab6e'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: yourdomain.com', 'Pernum: YOUR_PERNUM' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "hash": "0x278d9e202a17d833f05f744758c5eb423411529e90cc0e5f04aa6825c30aab6e", "blockNumber": 476232, "gas": 29437, "gasPrice": 0, "gasLimit": 29437, "burntFees": 0, "from": "0xfa592403b9c52b6f61f7e2334b5c7c4feb847ded", "to": "0xcc60ede05e871b0c19d6bdd9aa012d75948ebbc9", "from_uid": 999999, "to_uid": 789, "reason": "", "reasonCode": 18, "value": 73, "onchaindata": "|0.73|CHF|0.91|USD", "asset": "YEM", "timestamp": 1765650241, "status": true, "failedText": "", "cacheHit": true }
null
Endpoint: GET /api/getUserTransactionsExternal.php
Retrieves transactions for a specific UID with pagination support.
fetch('https://public.keychainlife.net/api/getUserTransactionsExternal.php?uid=12345&limit=10&offset=0', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': 'YOUR_PERNUM' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://public.keychainlife.net/api/getUserTransactionsExternal.php?uid=12345&limit=10&offset=0'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum: YOUR_PERNUM' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
[ { "hash": "0x278d9e202a17d833f05f744758c5eb423411529e90cc0e5f04aa6825c30aab6e", "blockNumber": 476232, "gas": 29437, "gasPrice": 0, "gasLimit": 29437, "burntFees": 0, "from_uid": 999999, "to_uid": 789, "reason": "", "reasonCode": 18, "value": 73, "asset": "YEM", "timestamp": 1765650241, "status": true, "failedText": "" }, { "hash": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef1234567890abcdef12345678", "blockNumber": 476231, "gas": 21000, "gasPrice": 0, "gasLimit": 21000, "burntFees": 0, "from_uid": 789, "to_uid": 12345, "reason": "Payment", "reasonCode": 1, "value": 1000, "asset": "YEM", "timestamp": 1765650180, "status": true, "failedText": "" } ]
from
to
onchaindata