API DocumentationGetting Started

Getting Started with NorChain API

Quick guide to start using the NorChain API in your applications.

Base URL

Production

https://api.norchain.org/api/v1

Development

http://localhost:4000/api/v1

Quick Start

1. Make Your First Request

curl https://api.norchain.org/api/v1/health

2. 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:

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

  1. 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"}'
  1. 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

PlanRequests/MinuteRequests/Day
Public (No Auth)10010,000
Authenticated1,000100,000
Premium10,0001,000,000

Rate limit headers included in responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

SDKs and Libraries

JavaScript/TypeScript

npm install @norchain/sdk
import { 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-sdk
from 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-docs

WebSocket 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/graphql

Example query:

query {
  account(address: "0x...") {
    balance
    transactions(first: 10) {
      edges {
        node {
          hash
          value
          timestamp
        }
      }
    }
  }
}

Next Steps

Support