You are using a small sized device.

Please rotate your device to view the content.

A Private Blockchain Explorer

API Integration Guide

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.

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.

Functions

  1. Create Transactions - Create multiple transactions in a batch
  2. Get Balances - Retrieve balances for multiple UIDs
  3. Get Globals - Retrieve global blockchain statistics
  4. Get Transaction Volume - Retrieve transaction volume statistics
  5. Get Transaction Hash Statuses - Retrieve statuses for multiple transaction hashes
  6. Get Asset Statistics - Asset price and number of wallets holding a balance of that asset

Required Headers

Header Description Example
Apikey Your API key pk_live_d7fbe6aea9a2b61c8c0cbd18225ec126
Customdomain Your domain yourdomain.com
Pernum UID + 1000000000 1234 + 1000000000 = 1000001234

1. Create Transactions

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

Request Body

[
    {
        "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"
    }
]

Examples

fetch

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));

PHP curl

$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;

Example Response

{
  "success": true,
  "message": "1 transactions inserted successfully.",
  "inserted_count": 1,
  "transaction_hashes": [
    "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12345678"
  ]
}

2. Get Balances

Endpoint: GET /api/getBalances.php

Retrieves balances for multiple UIDs (max 100 per request).

Note that the function uses UID's and not Pernum's in the parameters.

Parameters

Parameter Required Description
uids Yes Comma-separated UIDs
tokenSymbol Yes Asset symbol (e.g. YEM)

Examples

fetch

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));

PHP curl

$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;

Example Response

{
  "balances": {
    "123": "1000.00",
    "456": "2000.00"
  }
}

3. Get Globals

Endpoint: GET /api/getGlobals.php

Retrieves global blockchain statistics.

Examples

fetch

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));

PHP curl

$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;

Example Response

{
  "success": true,
  "message": "Global stats retrieved successfully in 5ms",
  "total_accs": 15000,
  "total_txns": 50000
}

4. Get Transaction Volume

Endpoint: GET /api/getTxnVolume.php

Retrieves transaction volume statistics.

Parameters

Parameter Required Description
tokenSymbol Yes Asset symbol (e.g. YEM)

Examples

fetch

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));

PHP curl

$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;

Example Response

{
  "success": true,
  "volume_1d": 15000.25,
  "volume_7d": 105000.75,
  "message": "Transaction volume retrieved successfully in 2ms"
}

5. Get Transaction Hash Statuses

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:

  • 0: Not found
  • 1: Failed
  • 2: Confirmed

Parameters

Parameter Required Description
hashes Yes Comma-separated transaction hashes (max 100)

Examples

fetch

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));

PHP curl

$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;

Example Response

{
  "statuses": {
    "0xa1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12345678": "1",
    "0xb2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890": "2",
    "0xc3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890ab": "0"
  }
}

Error Responses

{
  "error": "Maximum 100 hashes allowed."
}
{
  "error": "Missing hashes."
}

6. Get Asset Statistics

Endpoint: GET /api/getAssetStats.php

Retrieves price and number of wallets holding a balance of that asset.

Parameters

Parameter Required Description
tokenSymbol Yes Asset symbol (e.g. YEM)

Examples

fetch

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));

PHP curl

$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;

Example Response

{
  "price": "1.00",
  "wallets": 1257632
}