> For the complete documentation index, see [llms.txt](https://docs.minervachain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.minervachain.org/build/indexer-api.md). Agents can also search and read this documentation through its [MCP server](https://docs.minervachain.org/~gitbook/mcp).

# Indexer API

The Minerva indexer backs the explorer and is open for anyone to query. It stores blocks, transactions with their ML-DSA authorization, logs, addresses, tokens, PQ accounts, verified contracts and daily statistics.

| Network | Base URL                                       |
| ------- | ---------------------------------------------- |
| Mainnet | `https://mainnet.minervachain.org/api/indexer` |
| Testnet | `https://testnet.minervachain.org/api/indexer` |

Responses are JSON; list endpoints are paginated with `limit` and a `cursor` (or `before` for blocks).

## Status and statistics

| Endpoint                   | Returns                                                                                                                                                                                                                                                                                                                                                 |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /status`              | `ok, network, chainId, lastIndexedBlock, head, lag, syncing, indexedBlockCount, transactionCount, …`                                                                                                                                                                                                                                                    |
| `GET /stats`               | `network`, `head`, `sync`, `totals {blocks, transactions, pqTransactions, failedTransactions, addresses, contracts, pqAccounts, tokens, tokenTransfers, verifiedContracts, gasUsed, burnedWei, minerBaseFeeWei, baseFeeBurnBps}`, `recent {avgBlockTimeSeconds, avgDifficulty, hashrateEstimate, blocksLast24h, transactionsLast24h, burnedLast24hWei}` |
| `GET /stats/daily?days=30` | one row per day with blocks, transactions, gas, burned MRV, difficulty, block time, token transfers, new addresses                                                                                                                                                                                                                                      |
| `GET /search?q=`           | block number or hash, transaction hash, address, PQ key commitment, or a token or label fragment                                                                                                                                                                                                                                                        |
| `GET /methods`             | known 4-byte selectors                                                                                                                                                                                                                                                                                                                                  |

## Blocks and transactions

| Endpoint                                                                            | Returns                                                                                                             |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `GET /blocks?limit=&before=`                                                        | page of blocks                                                                                                      |
| `GET /block/:numberOrHash`                                                          | block with its transactions                                                                                         |
| `GET /txs?limit=&cursor=&type=pq\|legacy\|failed\|contract-creation\|token&method=` | page of transactions                                                                                                |
| `GET /tx/:hash`                                                                     | transaction with input, fees, decoded call, logs, token transfers, confirmations and `pq {publicKey, signature, …}` |
| `GET /events?limit=&cursor=&type=&address=`                                         | page of logs                                                                                                        |

## Addresses and accounts

| Endpoint                                                                           | Returns                                                                                                                                                           |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /address/:address`                                                            | summary, recent transactions and events, token balances, live state                                                                                               |
| `GET /address/:address/txs`, `/logs`, `/transfers?contract=`, `/tokens`, `/assets` | paged detail                                                                                                                                                      |
| `GET /address/:address/live`                                                       | `balanceWei, hasCode, codeSize, nonce, accountControl {exists, deployed, commitment, algorithm, policyVersion, controlRuleActive}` read from the node (5 s cache) |
| `GET /accounts?limit=&cursor=`                                                     | page of PQ accounts                                                                                                                                               |
| `GET /accounts/:address`                                                           | the account with its key rotations and recent PQ transactions                                                                                                     |

## Tokens

| Endpoint                                        | Returns                          |
| ----------------------------------------------- | -------------------------------- |
| `GET /tokens?standard=erc20\|erc721\|erc1155`   | page of tokens                   |
| `GET /token/:address`, `/holders`, `/transfers` | token detail, holders, transfers |
| `GET /transfers`                                | transfers across all tokens      |

## Contracts and verification

| Endpoint                                    | Returns                                                                                                     |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `GET /contracts`, `GET /contracts/verified` | pages of contracts                                                                                          |
| `GET /contracts/compilers`                  | supported solc releases                                                                                     |
| `GET /contracts/:address?sources=0`         | contract with verification status, sources and settings                                                     |
| `POST /contracts/:address/verify`           | body `{compilerVersion, contractName, standardJsonInput, constructorArgs?}`; `422` with details on mismatch |

Verified sources let the explorer decode calls and events. Blockscout imports Sourcify matches separately.

## Example

```sh
curl -s https://mainnet.minervachain.org/api/indexer/stats | jq '.totals.pqTransactions, .totals.burnedWei'
curl -s https://mainnet.minervachain.org/api/indexer/address/0x0000000000000000000000000000000000000303/live
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.minervachain.org/build/indexer-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
