⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today →
Skip to main content

Getting Started

Welcome to Dwellir's API platform. This guide helps you create an API key and make your first request in minutes.

1. Sign Up and Create an API Key

  1. Go to dashboard.dwellir.com and sign up
  2. Navigate to the API Keys section
  3. Click "Create API Key" to generate your first key
  4. Copy your API key (format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

2. Choose a Network

Select from 140+ supported networks. Popular choices include:

  • Ethereum: ethereum-mainnet
  • Base: base-mainnet
  • Arbitrum: arbitrum-one
  • Polygon: polygon-mainnet
  • Polkadot: polkadot

See the full list in Supported Chains.

3. Make Your First Request

The API key is included directly in the URL. No Authorization header needed!

Using cURL

curl -X POST \
-H "Content-Type: application/json" \
https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'

Example with endpoint format

curl -X POST \
-H "Content-Type: application/json" \
https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}'

4. Use an SDK

Web3.js

const Web3 = require('web3');

// API key is in the URL, no auth header needed
const web3 = new Web3('https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY');

// Make requests
const blockNumber = await web3.eth.getBlockNumber();
console.log('Latest block:', blockNumber);

// Get balance
const balance = await web3.eth.getBalance('0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb');
console.log('Balance:', web3.utils.fromWei(balance, 'ether'), 'ETH');

Ethers.js

import { JsonRpcProvider } from 'ethers';

// API key is in the URL, no auth header needed
const provider = new JsonRpcProvider(
'https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY'
);

// Make requests
const blockNumber = await provider.getBlockNumber();
console.log('Latest block:', blockNumber);

// Get balance
const balance = await provider.getBalance('0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb');
console.log('Balance:', ethers.formatEther(balance), 'ETH');

WebSocket Connection

const WebSocket = require('ws');

const ws = new WebSocket('wss://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY');

ws.on('open', () => {
// Subscribe to new blocks
ws.send(JSON.stringify({
jsonrpc: '2.0',
method: 'eth_subscribe',
params: ['newHeads'],
id: 1
}));
});

ws.on('message', (data) => {
const response = JSON.parse(data);
console.log('New block:', response);
});

5. Configure API Quotas

Protect yourself from unexpected usage by setting quotas on your API keys:

  1. Go to dashboard.dwellir.com/api-keys
  2. Click the edit icon next to your API key
  3. In the Edit API key dialog:
    • Name: Give your key a descriptive name
    • Daily quota: Toggle and set daily request limit
    • Monthly quota: Toggle and set monthly request limit
  4. Click "Update API Key" to save changes

When a quota is reached, the API will return a 429 error until the quota resets.

6. Monitor Your Usage

Track your API usage in real-time:

  1. Go to dashboard.dwellir.com/usage
  2. View metrics:
    • Total requests
    • Requests by method
    • Requests by network
    • Response times
    • Error rates

Set up alerts to notify you when approaching limits.

7. Best Practices

Error Handling

async function makeRequest() {
try {
const blockNumber = await web3.eth.getBlockNumber();
return blockNumber;
} catch (error) {
if (error.code === 429) {
console.log('Rate limit exceeded, retry after delay');
// Implement exponential backoff
} else {
console.error('Request failed:', error);
}
}
}

Connection Pooling

// Reuse provider instances
const providers = {
ethereum: new Web3('https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY'),
polygon: new Web3('https://api-polygon-mainnet.n.dwellir.com/YOUR_API_KEY'),
arbitrum: new Web3('https://api-arbitrum-one.n.dwellir.com/YOUR_API_KEY')
};

// Use the same provider for multiple requests
async function getMultiChainData() {
const ethBlock = await providers.ethereum.eth.getBlockNumber();
const polyBlock = await providers.polygon.eth.getBlockNumber();
const arbBlock = await providers.arbitrum.eth.getBlockNumber();

return { ethBlock, polyBlock, arbBlock };
}

Batch Requests

// Batch multiple calls into one request
const batch = new web3.BatchRequest();

batch.add(web3.eth.getBlockNumber.request((err, res) => {
console.log('Block number:', res);
}));

batch.add(web3.eth.getGasPrice.request((err, res) => {
console.log('Gas price:', res);
}));

batch.execute();

Quick Reference

Endpoint Format

https://api-{network}.n.dwellir.com/{YOUR_API_KEY}
wss://api-{network}.n.dwellir.com/{YOUR_API_KEY}

Common Networks

  • Ethereum: api-ethereum-mainnet
  • Base: api-base-mainnet
  • Arbitrum: api-arbitrum-one
  • Optimism: api-optimism-mainnet
  • Polygon: api-polygon-mainnet
  • BSC: api-bsc-mainnet
  • Avalanche: api-avalanche-c-chain

Need Help?

Ready to scale? Upgrade your plan for higher rate limits and additional features.