Multichain Queries
Insight now supports querying multiple blockchain networks in a single API call. This powerful feature allows you to retrieve and analyze data across different chains without making separate requests for each network.
- Efficiency: Reduce the number of API calls needed to fetch data from multiple chains
- Simplicity: Consolidate cross-chain data in a single request and response
- Performance: Minimize latency by avoiding sequential requests to different chains
- Consistency: Process data from different networks using a unified format
Instead of using the chain-specific subdomain approach, multichain queries use the base URL with multiple chain
query parameters:
Authentication works the same way as with single-chain queries:
Responses for multichain queries include additional metadata to help you identify which data belongs to which chain:
Key differences in the response format:
- The
meta
object includes achain_ids
array listing all queried chains - A
limit_per_chain
field indicates how many items were requested per chain - Each item in the
data
array includes achain_id
field to identify its network
When using multichain queries, the limit
parameter applies to each chain individually:
The limit_per_chain
in the response metadata shows how many items were requested per chain, while the overall limit
represents the maximum total items across all chains.
All Insight blueprints support multichain queries:
- Events Blueprint:
/v1/events
- Returns events from specified chains - Transactions Blueprint:
/v1/transactions
- Provides transactions from multiple chains - Tokens Blueprint:
/v1/tokens/erc20/:ownerAddress
- Consolidates ERC-20 token balances across chains/v1/tokens/erc721/:ownerAddress
- Consolidates NFT holdings across chains/v1/tokens/erc1155/:ownerAddress
- Consolidates ERC-1155 token balances across chains
-
Limit Chain Count: While you can query multiple chains, it's best to limit the number of chains in a single request to avoid timeouts.
-
Use Appropriate Limits: Set reasonable
limit
values to control response size and processing time. -
Handle Chain-Specific Errors: Some chains might return errors while others succeed. Your code should handle partial successes.
-
Process Data by Chain: When analyzing the response, group or filter data by
chain_id
for chain-specific analysis. -
Consider Rate Limits: Multichain queries count against your rate limits for each chain queried.
Track a user's assets across multiple networks to provide a comprehensive view of their holdings:
Monitor transactions or events across multiple chains for a specific address:
Analyze protocol activity across different deployments on multiple chains: