Getting Started
Get up and running with the Spectrum API in under a minute.
1. Get your endpoint URL
Sign up at spectrumnodes.com to get your assigned endpoint URL. For a step-by-step walkthrough, see our User Guides: covering account creation, endpoint setup, billing, and more.
2. Make your first request
Use the full endpoint URL from your dashboard. It already includes your API key, so no auth header is needed. For example https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/v1:
curl -X POST https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/v1 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"getBlockHeight","params":{"chain":"ethereum"},"id":1}'Response:
{
"jsonrpc": "2.0",
"result": {
"data": {
"chain": "0x1",
"height": 24535031
}
},
"id": 1
}Try a few more:
# Get ETH balance
curl -X POST https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/v1 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"getBalance","params":{"chain":"ethereum","address":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"id":1}'
# Get token price
curl -X POST https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/v1 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"getPrice","params":{"symbol":"ETH"},"id":1}'
# Compare gas fees across chains
curl -X POST https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/v1 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"compareGas","params":{},"id":1}'3. Install the SDK (optional)
npm install @spectrumnodes/sdkimport { Spectrum } from '@spectrumnodes/sdk';
const spectrum = new Spectrum({ api: 'https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/' });
// Get the latest block height
const block = await spectrum.core.getBlockHeight('ethereum');
console.log(block.height); // 24535031
// Get a wallet's ETH balance
const balance = await spectrum.tokens.getBalance(
'ethereum',
'0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
);
console.log(balance.balance); // "32.126799"
// Get DeFi lending rates
const rates = await spectrum.yields.getLending({
chain: 'ethereum', protocol: 'aave', pool: 'USDC'
});
console.log(rates.results[0].apy); // { baseApy: 2.3, extraApy: 0, totalApy: 2.3 }4. Use the CLI (optional)
Prefer the terminal? The CLI wraps the same API and prints JSON by default, so it pipes straight into jq.
npm install -g @spectrumnodes/cli
spectrum config set api https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/spectrumapi/v1/
spectrum core block-height --chain ethereum
spectrum prices price ETH5. JSON-RPC interface
The Spectrum API uses JSON-RPC 2.0 over a single POST to /v1:
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \ -H "Content-Type: application/json" \
{ "jsonrpc": "2.0", "method": "getBlockHeight", "params": { "chain": "ethereum" }, "id": 1 }
Response:
{
"jsonrpc": "2.0",
"result": {
"data": {
"chain": "0x1",
"height": 24535031
}
},
"id": 1
}Request format
| Field | Type | Description |
|---|---|---|
jsonrpc | string | Always "2.0" |
method | string | API method name (e.g. getBlockHeight, getBalance) |
params | object | Method-specific parameters |
id | number | Request identifier returned in the response |
Batch requests
Send multiple JSON-RPC calls in a single HTTP request by posting an array payload to POST /v1.
For complete examples and response behavior, see JSON-RPC Batch.
Error responses
{ "jsonrpc": "2.0", "error": { "code": -32601, "message": "Method not found: foobar" }, "id": 1 }| Error Code | Meaning |
|---|---|
-32700 | Parse error: invalid JSON |
-32600 | Invalid request: missing required fields |
-32601 | Method not found |
-32602 | Invalid params |
-32603 | Internal error |
Rate limits
- Free tier: 10 requests/second
- Pro tier: 100 requests/second
Rate limit headers are included in every response:
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 9
X-RateLimit-Reset: 1709913600Next steps
- API Reference: Full endpoint documentation with interactive examples
- TypeScript SDK: Typed client with caching, retries, and error handling
- CLI: Query the API from your terminal, JSON by default
- Supported Chains: All 24 API chains
- Platform Guide: Account setup, billing, teams, faucets