Complete Beginner's Guide
Get started with FortiBlox API in 10 minutes - no prior blockchain experience needed! Step-by-step guide from account creation to your first API call.
FortiBlox API - Complete Beginner's Guide
Get started with FortiBlox API in 10 minutes - no prior blockchain experience needed!
What is FortiBlox?
FortiBlox provides fast, reliable access to the X1 Blockchain. Instead of running your own validator node (which costs thousands of dollars), you can use our API to:
- Check wallet balances
- Get transaction history
- Search for NFTs and tokens
- Stream real-time blockchain data
- Send transactions to the blockchain
Step 1: Create Your Free Account (2 minutes)
Option A: Sign Up with Google (Easiest)
- Go to https://nexus.fortiblox.com
- Click "Sign in with Google"
- Choose your Google account
- You're in! Skip to Step 2.
Option B: Sign Up with GitHub
- Go to https://nexus.fortiblox.com
- Click "Sign in with GitHub"
- Authorize FortiBlox
- You're in! Skip to Step 2.
Option C: Sign Up with Email
- Go to https://nexus.fortiblox.com
- Click "Sign Up"
- Enter your email and create a password
- Check your email for a 6-digit verification code
- Enter the code to activate your account
Tip: Use Google or GitHub login for the fastest setup!
Step 2: Get Your API Key (1 minute)
- After logging in, click "API Keys" in the left sidebar
- Click the "Create New API Key" button
- Give it a name like
My First Key - Choose scopes (for beginners, select all scopes)
- Click "Create"
- Copy your API key - it looks like:
fbx_abc123xyz...
Security: Never share your API key publicly! Treat it like a password.
Step 3: Make Your First API Call
Example 1: Check X1 Blockchain Network Health
The simplest API call - just check if X1 Blockchain is working:
curl -X POST "https://nexus.fortiblox.com/rpc" \
-H "X-API-Key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getHealth"
}'Expected Response:
{
"jsonrpc": "2.0",
"result": "ok",
"id": 1
}Create a file called check-health.js:
// check-health.js - Check if X1 Blockchain is working
const axios = require('axios');
// Replace with your actual API key
const API_KEY = 'fbx_YOUR_KEY_HERE';
async function checkHealth() {
try {
const response = await axios.post(
'https://nexus.fortiblox.com/rpc',
{
jsonrpc: '2.0',
id: 1,
method: 'getHealth'
},
{
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
}
}
);
console.log('X1 Blockchain Status:', response.data.result);
} catch (error) {
console.error('Error:', error.message);
}
}
checkHealth();Run it:
npm install axios
node check-health.jsCreate a file called check_health.py:
# check_health.py - Check if X1 Blockchain is working
import requests
import json
# Replace with your actual API key
API_KEY = 'fbx_YOUR_KEY_HERE'
def check_health():
url = 'https://nexus.fortiblox.com/rpc'
headers = {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
}
payload = {
'jsonrpc': '2.0',
'id': 1,
'method': 'getHealth'
}
try:
response = requests.post(url, json=payload, headers=headers)
result = response.json()
print('X1 Blockchain Status:', result['result'])
except Exception as error:
print('Error:', str(error))
if __name__ == '__main__':
check_health()Run it:
pip install requests
python check_health.pyExample 2: Get a Wallet Balance (Real-World Use Case)
Let's check how much SOL is in a wallet:
// get-balance.js - Check wallet balance
const axios = require('axios');
const API_KEY = 'fbx_YOUR_KEY_HERE';
const WALLET_ADDRESS = 'vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg'; // Example wallet
async function getBalance(walletAddress) {
try {
const response = await axios.post(
'https://nexus.fortiblox.com/rpc',
{
jsonrpc: '2.0',
id: 1,
method: 'getBalance',
params: [walletAddress]
},
{
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
}
}
);
const lamports = response.data.result.value;
const sol = lamports / 1000000000; // Convert lamports to SOL
console.log(`Wallet: ${walletAddress}`);
console.log(`Balance: ${sol} SOL`);
console.log(` (${lamports} lamports)`);
} catch (error) {
console.error('Error:', error.response?.data || error.message);
}
}
getBalance(WALLET_ADDRESS);Output:
Wallet: vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg
Balance: 123.456 SOL
(123456000000 lamports)# get_balance.py - Check wallet balance
import requests
API_KEY = 'fbx_YOUR_KEY_HERE'
WALLET_ADDRESS = 'vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg' # Example wallet
def get_balance(wallet_address):
url = 'https://nexus.fortiblox.com/rpc'
headers = {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
}
payload = {
'jsonrpc': '2.0',
'id': 1,
'method': 'getBalance',
'params': [wallet_address]
}
try:
response = requests.post(url, json=payload, headers=headers)
result = response.json()
lamports = result['result']['value']
sol = lamports / 1_000_000_000 # Convert to SOL
print(f'Wallet: {wallet_address}')
print(f'Balance: {sol} SOL')
print(f' ({lamports:,} lamports)')
except Exception as error:
print(f'Error: {error}')
if __name__ == '__main__':
get_balance(WALLET_ADDRESS)Understanding the Response
When you make an API call, you get back JSON data with three main parts:
{
"jsonrpc": "2.0", // Protocol version (always 2.0)
"result": { // Your data is here
"value": 123456000000 // Balance in lamports
},
"id": 1 // Matches the request ID
}What are lamports? 1 SOL = 1,000,000,000 lamports. Think of lamports like cents to a dollar, but with 9 decimal places instead of 2.
Common Beginner Questions
Q: What can I build with FortiBlox?
Wallet Apps - Show users their SOL balance and transaction history NFT Marketplaces - Track NFT sales and listings Trading Bots - Monitor prices and execute trades Portfolio Trackers - Track multiple wallets and assets Analytics Dashboards - Visualize blockchain data
Q: Do I need to pay?
Not to get started! The Free tier gives you:
- 1 million monthly credits
- 10 requests per second
- WebSocket streaming
- Perfect for learning and prototyping
See our Pricing Guide for paid tiers.
Q: Is my API key secure?
Your API key is like a password. Follow these rules:
- Never commit it to GitHub
- Use environment variables
- Don't share it publicly
- Rotate it monthly
Read our Security Best Practices for more.
Q: What if I get errors?
Common errors and solutions:
401 Unauthorized
- Check your API key is correct
- Make sure you're using the
X-API-Keyheader
429 Rate Limited
- You're making too many requests
- Free tier: 10 requests/second max
- Consider upgrading or adding delays
Network timeout
- Check your internet connection
- X1 Blockchain might be congested
- Try again in a few seconds
Next Steps
Congratulations! You've made your first API call. Here's what to learn next:
Complete API Examples
50+ copy-paste examples for every endpoint
Pricing & Tiers
Choose the right plan for your project
Security Guide
Protect your API keys and secure your app
WebSocket Streaming
Get real-time blockchain updates
Resources for Learning
Official Documentation
- X1 Blockchain Docs - Learn about X1 Blockchain
- Web3.js Guide - JavaScript library for blockchain interactions
Video Tutorials
- Getting Started with FortiBlox (10 min)
- Building Your First Wallet App (30 min)
- Real-time NFT Tracking (20 min)
Community
- Discord - Ask questions and get help
- GitHub Examples - Code samples
- Twitter - Updates and tips
Ready to build something awesome? Head to the Complete API Examples for more code!