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.
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://yemscan.com/api/createTransactions.php', { method: 'POST', headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': '1000001234', '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://yemscan.com/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: 1000001234', '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://yemscan.com/api/getBalances.php?uids=123,456&tokenSymbol=YEM', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': '1000001234' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://yemscan.com/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: 1000001234' ]); $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://yemscan.com/api/getGlobals.php', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': '1000001234' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://yemscan.com/api/getGlobals.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: 'yourdomain.com', 'Pernum: 1000001234' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "success": true, "message": "Global stats retrieved successfully in 5ms", "total_accs": 15000, "total_txns": 50000 }
Endpoint: GET /api/getTxnVolume.php
Retrieves transaction volume statistics.
fetch('https://yemscan.com/api/getTxnVolume.php?tokenSymbol=YEM', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': '1000001234' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://yemscan.com/api/getTxnVolume.php?tokenSymbol=YEM'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: yourdomain.com', 'Pernum: 1000001234' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "success": true, "volume_1d": 15000.25, "volume_7d": 105000.75, "message": "Transaction volume retrieved successfully in 2ms" }
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://yemscan.com/api/getTxnHashes.php?hashes=0xa1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12345678,0xb2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890,0x243347373ddb571b4794580fbd852622b2d5ac6a7c567683f5a6614fabe04a85', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': '1000001234' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://yemscan.com/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: 1000001234' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "statuses": { "0xa1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12345678": "1", "0xb2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890": "2", "0xc3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890ab": "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://yemscan.com/api/getAssetStats.php?tokenSymbol=YEM', { headers: { 'Apikey': 'YOUR_API_KEY', 'Customdomain': 'yourdomain.com', 'Pernum': '1000001234' } }) .then(response => response.json()) .then(data => console.log(data));
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://yemscan.com/api/getAssetStats.php?tokenSymbol=YEM'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Apikey: YOUR_API_KEY', 'Customdomain: yourdomain.com', 'Pernum: 1000001234' ]); $response = curl_exec($ch); curl_close($ch); echo $response;
{ "price": "1.00", "wallets": 1257632 }