These APIs can be helpful for developers as they offer the possibility of fetching data from the blockchain and use that data for their own goals, such as dapp development, data streams and other possibilities.
Overview
Shib’s on-chain data APIs provide developers with comprehensive access to blockchain data from both Shibarium mainnet and Puppynet testnet. These APIs enable you to build applications that can fetch transaction history, account balances, and other blockchain data for various use cases including dApp development, analytics, and data streaming.Access to the RPC data requires authentication. Head to the Developer Portal to get your API Key.
Available APIs
Transactions API
Fetch transaction data from specific addresses with detailed information about gas fees, confirmations, and token transfers.
Balance API
Retrieve account balances for native tokens and ERC-20 tokens across multiple networks.
Base URLs
The APIs are available for both Shibarium mainnet and Puppynet testnet:Network | Base URL | Description |
---|---|---|
Shibarium | https://chain.shib.io/api/v1/shibarium | Mainnet production environment |
Puppynet | https://chain.shib.io/api/v1/puppynet | Testnet for development |
Transactions API
Use this endpoint to fetch transaction data from a given address.Endpoint
Request Examples
Query Parameters
Your API key provided by the Developer Portal.
The wallet address from which you would like to fetch data.
Response Schema
Response Fields
List of transactions for the specified address.
A list of actions associated with the transaction.
The base fee per gas unit for this transaction, indicating the minimum amount of gas required to process the transaction.
The number of the block where the transaction was registered.
An array representing the range of time (in milliseconds) it took for the transaction to be confirmed.
The number of confirmations this transaction has received. Confirmations indicate how many blocks have been added to the blockchain since this transaction.
Details about a contract that was created as a result of a transaction. Contains information such as the contract’s address, name, and whether it has been verified.
The decoded information from the raw transaction input. Typically includes the method call and the parameters passed to the function during the transaction.
The exchange rate at the time of the transaction (if applicable).
Contains information about the transaction fee.
Contains information about the sender of the transaction.
The maximum amount of gas allowed for the transaction.
The price of gas per unit.
The actual amount of gas used by the transaction.
Whether there were any errors in any internal transactions.
The transaction hash.
The maximum fee per gas unit that the sender is willing to pay.
The maximum priority fee per gas unit that the sender is willing to pay to speed up the transaction process.
Specific method or smart contract function.
The nonce for this transaction, which is the number of transactions sent by the sender up to this point.
The position of the transaction within the block.
The priority fee paid to validators.
The raw input data provided in the transaction.
Indicates the outcome of the transaction.
Shows the reason why the transaction was reverted, if applicable.
The transaction status, that is, if it was successfully processed or not.
The timestamp when the transaction occurred.
Contains information about the recipient of the transaction (same structure as
from
field).What token transfers occurred during this transaction.
Whether overflow or errors in token transfers happened.
The amount of gas fees burned by the transaction.
Specific tags associated with the transaction.
A list indicating the type of transaction.
The transaction type.
The amount of cryptocurrency transferred in the transaction.
These are parameters needed to retrieve the next page of transactions when paginating through API results.
Balance API
The Balance API allows you to retrieve account balances for native tokens and ERC-20 tokens.Endpoint
Query Parameters
Your API key provided by the Developer Portal.
The wallet address for which you want to fetch balance data.
Response Schema
Response Fields
List of token balances for the specified address.
The balance of the token in its smallest unit (wei for ETH).
The current exchange rate of the token.
The fiat value of the token balance.
Information about the token.
Parameters for pagination to retrieve the next page of results.
Rate Limits
The APIs have rate limits to ensure fair usage. Monitor your API usage and implement appropriate caching strategies for production applications.
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 requestRate Limit Exceeded
Rate Limit Exceeded
Error:
429 Too Many Requests
Cause: Exceeded rate limitsSolution: Implement exponential backoff and reduce request frequencyInvalid Address
Invalid Address
Error:
400 Bad Request
Cause: Invalid wallet address formatSolution: Ensure the address is a valid Ethereum address formatServer Errors
Server Errors
Error:
500 Internal Server Error
Cause: Server-side issuesSolution: Retry the request with exponential backoffBest Practices
- Implement proper error handling and retry logic
- Cache responses when appropriate to reduce API calls
- Use pagination for large datasets
- Monitor your API usage and stay within rate limits
- Implement exponential backoff for failed requests
- Validate addresses before making API calls
Never expose your API key in client-side code. Always make API calls from your backend server to keep your key secure.
Use Cases
Wallet Applications
Display transaction history and balances for user wallets with real-time updates.
Analytics Dashboards
Build comprehensive analytics platforms showing transaction patterns and token flows.
DeFi Applications
Track user positions, liquidity pools, and yield farming activities.
Blockchain Explorers
Create custom blockchain explorers with detailed transaction and balance information.
Next Steps
Get API Key
Obtain your API key from the Developer Portal to start using the on-chain data APIs.
Explore More APIs
Discover additional APIs and tools available in the Shib ecosystem.