Skip to main content

Authentication

All API requests to NodeTrace require authentication using an API key. This guide explains how to obtain and use your API key.

Obtaining an API Key

1. Connect Your Wallet

Visit www.nodetrace.xyz and click the "Connect Wallet" button. NodeTrace supports all major Ethereum wallets including:

  • MetaMask
  • WalletConnect
  • Coinbase Wallet
  • Rainbow Wallet
  • And many more...

2. Sign the Authentication Message

After connecting your wallet, you'll be prompted to sign a message to verify ownership. This signature is used to create your secure session.

3. Generate Your API Key

Once authenticated, navigate to your Dashboard and click "Generate API Key" to create a new key.

Important

Your API key will only be displayed once. Make sure to copy and store it securely. If you lose your key, you'll need to generate a new one.

Using Your API Key

You can authenticate using your API key in two ways:

Include your API key directly in the URL path:

curl -X POST https://eth.nodetrace.xyz/rpc/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

This method is ideal for:

  • Command line tools (cast, forge)
  • Wallet configurations (MetaMask, etc.)
  • Quick testing

Method 2: Request Header

Include your API key in the X-API-Key header:

curl -X POST https://eth.nodetrace.xyz/rpc \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

This method is more secure for:

  • Production applications
  • Shared codebases
  • When you want to keep API keys out of logs

API Key Management

Key Limits

  • Each account can have up to 3 active API keys
  • Keys can be named for easy identification
  • Keys can be revoked at any time from your dashboard

Security Best Practices

  1. Never share your API key - Treat it like a password
  2. Use environment variables - Don't hardcode keys in your source code
  3. Rotate keys regularly - Revoke and regenerate keys periodically
  4. Monitor usage - Check your dashboard for unexpected activity

Example: Using Environment Variables

// .env file
NODETRACE_API_KEY = ntr_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;

// JavaScript code with URL path
const apiKey = process.env.NODETRACE_API_KEY;
const rpcUrl = `https://eth.nodetrace.xyz/rpc/${apiKey}`;

const response = await fetch(rpcUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_blockNumber',
params: [],
id: 1,
}),
});

Rate Limiting

All API keys are subject to monthly rate limits based on your subscription tier:

TierMonthly Limit
Free1,000 requests
Pro600,000 requests
Max2,000,000 requests

Rate limit information is included in response headers:

  • X-RateLimit-Limit: Your monthly quota
  • X-RateLimit-Remaining: Requests remaining this month
  • X-RateLimit-Reset: When your quota resets (start of next month)

Troubleshooting

Invalid API Key

{
"error": {
"code": -32000,
"message": "Invalid API key"
}
}

Solution: Check that you've copied the entire key including the ntr_ prefix.

Rate Limit Exceeded

{
"error": {
"code": -32000,
"message": "Rate limit exceeded"
}
}

Solution: Wait for your daily quota to reset or upgrade your subscription.

API Key Not Found

If your previously working API key stops working, it may have been revoked. Check your dashboard to verify the key status.

Next Steps