Nano RPC API
Secure public access to the Nano blockchain (block lattice) with whitelisted read-only commands and rate limiting
Quick Start
Get started with the Nano RPC endpoint in seconds
Nano RPC Endpoint
https://rpc.nano-gpt.com
No authentication required β’ Read-only operations β’ 100 requests per 15 minutes
curl -X POST https://rpc.nano-gpt.com \
-H "Content-Type: application/json" \
-d '{
"action": "account_info",
"account": "nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3"
}'
What's Included
- β Read-only commands only
- β No authentication required
- β Account info, balances, blocks
- β Network and transaction data
- β Unit conversion utilities
- β DDoS protection enabled
Security Restrictions
- β No wallet operations
- β No send/receive commands
- β No private key access
- β No state-modifying operations
- β No administrative commands
- β No work generation
Rate Limits
100 requests per 15 minutes per IP address. This is sufficient for most applications including real-time balance checking and transaction monitoring.
Get Account Information
Retrieve detailed information about a Nano account including balance, block count, and representative.
curl -X POST https://rpc.nano-gpt.com \
-H "Content-Type: application/json" \
-d '{
"action": "account_info",
"account": "nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3"
}'
Get Account Balance
Get the current balance and pending balance for an account.
curl -X POST https://rpc.nano-gpt.com \
-H "Content-Type: application/json" \
-d '{
"action": "account_balance",
"account": "nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3"
}'
Get Account History
Retrieve the transaction history for an account.
curl -X POST https://rpc.nano-gpt.com \
-H "Content-Type: application/json" \
-d '{
"action": "account_history",
"account": "nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3",
"count": "10"
}'
Convert Units
Convert between Nano and raw units for proper balance calculations.
curl -X POST https://rpc.nano-gpt.com \
-H "Content-Type: application/json" \
-d '{
"action": "nano_to_raw",
"amount": "1"
}'
Check Pending Transactions
Check for incoming transactions that haven't been received yet.
curl -X POST https://rpc.nano-gpt.com \
-H "Content-Type: application/json" \
-d '{
"action": "receivable",
"account": "nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3",
"count": "10"
}'
Get Network Version
Get information about the Nano node version and network.
curl -X POST https://rpc.nano-gpt.com \
-H "Content-Type: application/json" \
-d '{
"action": "version"
}'
These are the whitelisted commands available through our public Nano RPC endpoint. All commands are read-only for security.
Account Operations
account_info
- Get account detailsaccount_history
- Transaction historyaccount_balance
- Current balanceaccounts_balances
- Multiple balancesaccount_key
- Account public keyaccount_representative
- Account representativeaccount_weight
- Account voting weight
Block Operations
block_info
- Block detailsblocks_info
- Multiple blocksblock_count
- Total block countchain
- Block chainfrontiers
- Account frontiershistory
- Block historysuccessors
- Block successors
Network Information
version
- Node versionrepresentatives
- Representative listpeers
- Connected peerstelemetry
- Network telemetryavailable_supply
- Circulating supplyrepublish
- Republish blocksuptime
- Node uptime
Pending/Receivable
receivable
- Pending blocksaccounts_receivable
- Multiple accountspending
- Legacy pending blocksaccounts_pending
- Legacy multiplereceivable_exists
- Check existence
Utilities
nano_to_raw
- Convert to rawraw_to_nano
- Convert to Nanovalidate_account_number
- Validate addresswork_validate
- Validate PoWdeterministic_key
- Generate key
Statistics
confirmation_quorum
- Quorum infodelegators
- Account delegatorsdelegators_count
- Delegator countrepresentatives_online
- Online repsledger
- Ledger statistics
Easy-to-use JavaScript wrapper for the Nano RPC endpoint. Perfect for web applications and Node.js projects.
Basic Wrapper Function
const nanoRPC = async (action, params = {}) => {
try {
const response = await fetch('https://rpc.nano-gpt.com', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ action, ...params })
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return await response.json();
} catch (error) {
console.error('Nano RPC Error:', error);
throw error;
}
};
Usage Examples
// Get node version
const version = await nanoRPC('version');
console.log('Node version:', version.node_vendor);
// Get account info
const accountInfo = await nanoRPC('account_info', {
account: 'nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3'
});
console.log('Balance:', accountInfo.balance);
// Get account history
const history = await nanoRPC('account_history', {
account: 'nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3',
count: '5'
});
console.log('Recent transactions:', history.history);
// Convert units
const rawAmount = await nanoRPC('nano_to_raw', { amount: '1' });
console.log('1 Nano in raw:', rawAmount.amount);
// Check pending transactions
const pending = await nanoRPC('receivable', {
account: 'nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3',
count: '10'
});
console.log('Pending blocks:', pending.blocks);
Real-time Balance Monitoring
class NanoBalanceMonitor {
constructor(account) {
this.account = account;
this.lastBalance = null;
this.callbacks = [];
}
onBalanceChange(callback) {
this.callbacks.push(callback);
}
async checkBalance() {
try {
const accountInfo = await nanoRPC('account_info', {
account: this.account
});
const currentBalance = accountInfo.balance;
if (this.lastBalance && this.lastBalance !== currentBalance) {
this.callbacks.forEach(callback => {
callback({
account: this.account,
oldBalance: this.lastBalance,
newBalance: currentBalance,
timestamp: new Date()
});
});
}
this.lastBalance = currentBalance;
return currentBalance;
} catch (error) {
console.error('Error checking balance:', error);
}
}
startMonitoring(intervalMs = 5000) {
this.interval = setInterval(() => {
this.checkBalance();
}, intervalMs);
}
stopMonitoring() {
if (this.interval) {
clearInterval(this.interval);
}
}
}
// Usage
const monitor = new NanoBalanceMonitor('nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3');
monitor.onBalanceChange((change) => {
console.log('Balance changed!', change);
});
monitor.startMonitoring();
Python library for interacting with the Nano RPC endpoint. Includes error handling and response validation.
Python Wrapper Class
import requests
import json
from typing import Dict, Any, Optional
class NanoRPC:
def __init__(self, rpc_url: str = "https://rpc.nano-gpt.com"):
self.rpc_url = rpc_url
self.session = requests.Session()
self.session.headers.update({
'Content-Type': 'application/json'
})
def call(self, action: str, **params) -> Dict[str, Any]:
"""Make an RPC call to the Nano node"""
payload = {'action': action, **params}
try:
response = self.session.post(
self.rpc_url,
data=json.dumps(payload),
timeout=30
)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
raise Exception(f"RPC call failed: {e}")
def account_info(self, account: str) -> Dict[str, Any]:
"""Get account information"""
return self.call('account_info', account=account)
def account_balance(self, account: str) -> Dict[str, Any]:
"""Get account balance"""
return self.call('account_balance', account=account)
def account_history(self, account: str, count: int = 10) -> Dict[str, Any]:
"""Get account transaction history"""
return self.call('account_history', account=account, count=str(count))
def receivable(self, account: str, count: int = 10) -> Dict[str, Any]:
"""Get receivable/pending transactions"""
return self.call('receivable', account=account, count=str(count))
def nano_to_raw(self, amount: str) -> Dict[str, Any]:
"""Convert Nano to raw units"""
return self.call('nano_to_raw', amount=amount)
def raw_to_nano(self, amount: str) -> Dict[str, Any]:
"""Convert raw to Nano units"""
return self.call('raw_to_nano', amount=amount)
def version(self) -> Dict[str, Any]:
"""Get node version"""
return self.call('version')
def validate_account(self, account: str) -> bool:
"""Validate account address format"""
try:
result = self.call('validate_account_number', account=account)
return result.get('valid') == '1'
except:
return False
Usage Examples
# Initialize the RPC client
nano = NanoRPC()
# Get node version
version_info = nano.version()
print(f"Node version: {version_info['node_vendor']}")
# Get account information
account = "nano_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3"
account_info = nano.account_info(account)
print(f"Balance: {account_info['balance']} raw")
print(f"Block count: {account_info['block_count']}")
# Get recent transactions
history = nano.account_history(account, count=5)
for i, tx in enumerate(history['history']):
print(f"Transaction {i+1}: {tx['type']} - {tx['amount']} raw")
# Convert units
nano_amount = "1.5"
raw_result = nano.nano_to_raw(nano_amount)
print(f"{nano_amount} Nano = {raw_result['amount']} raw")
# Check for pending transactions
pending = nano.receivable(account)
if 'blocks' in pending and pending['blocks']:
print(f"Found {len(pending['blocks'])} pending transactions")
else:
print("No pending transactions")
# Validate account address
is_valid = nano.validate_account(account)
print(f"Account address is valid: {is_valid}")
Payment Verification
Verify incoming payments by checking account history and pending transactions. Perfect for e-commerce integration.
Balance Monitoring
Monitor account balances in real-time for wallets, exchanges, or automated services.
Network Analysis
Analyze network statistics, representative distribution, and blockchain metrics for research.
Address Validation
Validate Nano addresses in your applications before processing transactions.
Security Notice
This public endpoint only allows safe read-only operations. All state-modifying operations (send, receive, wallet commands) are blocked for security. To get full access to interact with the Nano network, you can easily set up your own node.
Need Help?
For questions about the Nano RPC API or to report issues, please reach out to our community.