With access to the RPC, you can interact with Shibarium and Puppynet networks and fetch relevant data to your needs, such as the latest block, gas price and other standard Ethereum JSON-RPC API functions. You can use all the standard Ethereum JSON-RPC API methods, such as
eth_blockNumber
to retrieve the network’s latest block.Access to the RPC data requires authentication. Head to the Developer Portal to get your API Key.
Find a complete list of all possible functions on Ethereum’s documentation.
Base URLs
The RPC endpoints are available for both Shibarium mainnet and Puppynet testnet:Network | Base URL | Description |
---|---|---|
Shibarium | https://api.shibrpc.com/shibarium/ | Mainnet production environment |
Puppynet | https://api.shibrpc.com/puppynet/ | Testnet for development |
Request Examples
Request Format
Endpoint
Request Body
Body Parameters
JSON-RPC specification version. Must be “2.0”.
Function to retrieve data from the network. Find more methods on Ethereum’s documentation.
Extra parameters required by the specific method. Can be empty array if no parameters are needed.
Unique identifier for the RPC call. Used to match responses with requests.
Header Parameters
Must be set to “application/json” for all requests.
Response Format
Response Fields
JSON-RPC specification version. Always “2.0”.
The same ID that was sent in the request, used to match responses with requests.
The result of the RPC call. The format depends on the method called. For
eth_blockNumber
, this is the latest block number in hexadecimal format.Error information if the request failed.
Common RPC Methods
Get Latest Block Number
Get Gas Price
Get Account Balance
Get Block by Number
Web3.js Integration
If you are building a frontend or backend project, you can use the web3.js library for easier integration:Error Handling
Authentication Errors
Authentication Errors
Error:
401 Unauthorized
Cause: Invalid or missing API keySolution: Verify your API key is correct and included in the URL pathInvalid JSON-RPC Format
Invalid JSON-RPC Format
Error:
400 Bad Request
Cause: Malformed JSON-RPC requestSolution: Ensure request follows JSON-RPC 2.0 specificationMethod Not Found
Method Not Found
Error:
-32601 Method not found
Cause: Unsupported RPC methodSolution: Check Ethereum JSON-RPC documentation for supported methodsRate Limit Exceeded
Rate Limit Exceeded
Error:
429 Too Many Requests
Cause: Exceeded rate limitsSolution: Implement exponential backoff and reduce request frequencyBest Practices
- Always include proper error handling in your RPC calls
- Use appropriate timeouts for network requests
- Implement retry logic with exponential backoff
- Cache frequently requested data when appropriate
- Monitor your API usage and stay within rate limits
- Use Web3.js or similar libraries for easier integration
- Validate addresses and parameters before making requests
Never expose your API key in client-side code. Always make RPC calls from your backend server to keep your key secure.
Rate Limits
The RPC endpoints have rate limits to ensure fair usage. Monitor your request frequency and implement appropriate caching strategies for production applications.
Use Cases
DApp Development
Build decentralized applications that interact directly with the Shibarium blockchain.
Blockchain Explorers
Create custom blockchain explorers to display transaction and block information.
Analytics Platforms
Develop analytics tools to track blockchain metrics and trends.
Wallet Applications
Build wallet applications that can read blockchain state and send transactions.
Next Steps
Get API Key
Obtain your API key from the Developer Portal to start using the RPC endpoints.
Explore JSON-RPC Methods
Learn about all available JSON-RPC methods for Ethereum-compatible networks.