Authentication
Learn how to securely authenticate your API requests using Tokra API keys and follow security best practices.
Every API request requires authentication via API key. Create your key in the Tokra dashboard under Settings → API Keys.
Include your key in the Authorization header:
Parameters: address (string), block (string, default: "latest")
Response:
Parameters: hash (string)
Response:
Subscription Types:
New Blocks - Receive each new block as it's mined
Pending Transactions - Stream pending txs from mempool
Logs - Subscribe to smart contract events
Example:
Best Practices:
Batch requests when possible using
eth_batchImplement exponential backoff for retries
Cache frequently accessed data (block numbers, contract ABIs)
Use WebSockets for real-time updates instead of polling