> ## Documentation Index
> Fetch the complete documentation index at: https://docs.near.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Accessing On-chain Data

> RPC queries, indexers, and hosted data APIs for exchange integrations.

Exchanges need on-chain data to detect deposits, track withdrawals, and reconcile balances. RPC provides queries for specific blocks, accounts, and transactions; indexers process blockchain data continuously and make it searchable across accounts and blocks.

| Approach | Exchange use cases |
| - | - |
| RPC | Check balances at a finalized block, submit withdrawals, and query transaction outcomes |
| Indexer | Track incoming transfers, process receipt outcomes and token events, and maintain a history for reconciliation |
| Hosted data API | Look up an account's assets, retrieve transfer history, and investigate transactions without operating an indexer |

***

## RPC Queries

Use RPC to query native NEAR balances with `view_account`, token balances through `ft_balance_of`, and transaction execution through status queries. For reconciliation, query balances at the same finalized block. Access to older blocks and state depends on the provider's retained history.

Resources:

* [RPC reference](https://docs.near.org/api/rpc/introduction.md)
* [Nodes and archival access](https://docs.near.org/integrations/nodes.md)
* [Balances & Reconciliation](https://docs.near.org/integrations/balance-changes.md)
* [Blocks & Finality](https://docs.near.org/integrations/blocks-and-finality.md)

***

## Indexers

An indexer processes blocks, receipts, execution outcomes, and contract events, and can store relevant movements in a database. For an exchange, this supports continuous deposit monitoring and queries across many blocks, such as all transfers into a customer's account.

Process finalized outcomes across all shards, including receipts generated by contract calls. Save a processing checkpoint so monitoring can resume after an interruption, and deduplicate movements when replaying data. For fungible tokens, identify transfers using events emitted by the supported token contract.

Resources:

* [Introduction to indexers](https://docs.near.org/data-infrastructure/indexers.md)
* [NEAR Indexer](https://docs.near.org/data-infrastructure/near-indexer.md)
* [Receiving Deposits](https://docs.near.org/integrations/deposits.md)
* [Fungible-token deposit accounting](https://docs.near.org/integrations/fungible-tokens.md#deposit-accounting)

***

## Hosted Data APIs

Hosted APIs expose indexed data through HTTP endpoints, allowing an integration to query account assets and history without running its own indexing infrastructure.

| Service | Available data |
| - | - |
| [FastNEAR API](https://docs.fastnear.com/api) | Account assets, staking pools, and public-key-to-account lookups |
| [Pikespeak API](https://api.pikespeak.ai/docs) | Account balances, NEAR and token transfers, contract events, and analytics |
| [NearBlocks API](https://api.nearblocks.io/api-docs/) | Account information, transactions, receipts, and token transfer history |

Check the selected API's network coverage, indexing delay, pagination, and how far back its data extends. Before crediting a deposit, establish finality and successful receipt execution; see [Receiving Deposits](https://docs.near.org/integrations/deposits.md). Use a finalized block checkpoint when reconciling balances.

For additional examples, see [Data APIs](https://docs.near.org/data-infrastructure/data-api.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.