Getting Started with NorChain API
Quick guide to start using the NorChain API in your applications.
Base URL
Production
https://api.norchain.org/api/v1Development
http://localhost:4000/api/v1Quick Start
1. Make Your First Request
curl https://api.norchain.org/api/v1/health2. Get Account Balance
curl "https://api.norchain.org/api/v1/account/balance?address=0x742d35Cc6634C0532925a3b844D9A5d4c9db901c"3. Get Latest Block
curl "https://api.norchain.org/api/v1/blockchain/validators"Authentication
The API supports two authentication methods:
API Key (Recommended)
Include in header:
curl -H "X-API-Key: nk_your_api_key_here" \
https://api.norchain.org/api/v1/account/summary?address=0x...JWT Token
- Login to get token:
curl -X POST https://api.norchain.org/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"password"}'- Use token in requests:
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
https://api.norchain.org/api/v1/account/summary?address=0x...Response Format
All API responses follow this structure:
Success Response
{
"status": "1",
"message": "OK",
"result": {
// Response data
}
}Error Response
{
"status": "0",
"message": "Error description",
"result": null
}Rate Limits
| Plan | Requests/Minute | Requests/Day |
|---|---|---|
| Public (No Auth) | 100 | 10,000 |
| Authenticated | 1,000 | 100,000 |
| Premium | 10,000 | 1,000,000 |
Rate limit headers included in responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200SDKs and Libraries
JavaScript/TypeScript
npm install @norchain/sdkimport { NorChainClient } from '@norchain/sdk';
const client = new NorChainClient({
apiKey: 'nk_your_api_key'
});
// Get account balance
const balance = await client.account.getBalance('0x...');
// Get transactions
const transactions = await client.account.getTransactions({
address: '0x...',
page: 1,
offset: 10
});Python
pip install norchain-sdkfrom norchain import NorChainClient
client = NorChainClient(api_key='nk_your_api_key')
# Get account balance
balance = client.account.get_balance('0x...')
# Get transactions
transactions = client.account.get_transactions(
address='0x...',
page=1,
offset=10
)Interactive API Documentation
Swagger UI available at:
https://api.norchain.org/api-docsWebSocket Connection
For real-time data:
const ws = new WebSocket('wss://api.norchain.org');
ws.on('open', () => {
ws.send(JSON.stringify({
event: 'subscribe',
channel: 'blocks'
}));
});
ws.on('message', (data) => {
console.log('New block:', JSON.parse(data));
});GraphQL Endpoint
POST https://api.norchain.org/graphqlExample query:
query {
account(address: "0x...") {
balance
transactions(first: 10) {
edges {
node {
hash
value
timestamp
}
}
}
}
}Next Steps
- Account API - Account balances and transactions
- Blockchain API - Blockchain data and validators
- Payments API - Payment processing
- DeFi API - Trading and swaps
- GraphQL API - GraphQL queries