Query API Overview
Query API is the Advanced API method group for indexed blockchain query workflows. Use it when your application needs block data, logs, wallet interactions, or transaction details without running its own indexer.
Query API usecases: best suited for explorers, analytics dashboards, monitoring services, compliance workflows, and backend systems that need normalized chain activity data.
What You Can Build
Query API supports common indexed-data workflows used by production applications:
- Inspect block ranges: retrieve indexed block data for supported chains and ranges.
- Read logs: query event logs across block ranges for contracts and indexed workflows.
- Analyze wallet activity: discover chains and contracts an address has interacted with.
- Look up transactions: retrieve transaction details by hash for reconciliation, support, or analytics.
Request Model
Query API uses JSON-RPC 2.0 over the Advanced API multichain HTTPS endpoint. A request includes the endpoint URL, method name, params object, and JSON-RPC metadata:
Successful responses include a result object. Failed responses include an error object with details, so clients should inspect the response body before treating a request as successful.
Methods
ankr_getBlocks: retrieves indexed block data for a supported chain and block range. Use it to inspect block metadata without querying each block individually.ankr_getInteractions: retrieves blockchain interactions for a wallet address. Use it to identify which chains or contracts an address has interacted with.ankr_getLogs: retrieves logs for a supported chain and block range. Use it to build event-driven dashboards, index contract activity, or inspect historical logs.ankr_getTransactionsByHash: retrieves transaction details for one or more transaction hashes. Use it to enrich transaction views or reconcile onchain activity.