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

# Overview

> Accounts, blockchain, jettons, NFTs, and more

Query TON blockchain data through the REST API. The SDK exposes resource groups as attributes on `TonapiRestClient`.

<Info>
  API key is optional — without a key, requests are throttled to \~1 per 4 seconds. Get a key at [tonconsole.com](https://tonconsole.com/).
</Info>

## Quick Example

```python theme={"theme":{"light":"github-light-default","dark":"dark-plus"}}
import asyncio

from pytonapi.rest import TonapiRestClient
from pytonapi.types import Network
from pytonapi.utils import to_amount


async def main() -> None:
    async with TonapiRestClient("YOUR_API_KEY", Network.MAINNET) as tonapi:
        account = await tonapi.accounts.get_account(
            account_id="EQDtFpEwcFAEcRe5mLVh2N6C0x-_hJEM7W61_JLnSF74p4q2",
        )
        print(f"Balance: {to_amount(account.balance)} TON")  # balance is in nanotons


if __name__ == "__main__":
    asyncio.run(main())
```

## Resources

| Resource                | Description                                            |
| ----------------------- | ------------------------------------------------------ |
| `tonapi.accounts`       | Account info, balances, events, traces, subscriptions. |
| `tonapi.blockchain`     | Blocks, transactions, validators, config, raw account. |
| `tonapi.connect`        | TON Connect payload and state init.                    |
| `tonapi.dns`            | Domain info, resolve, bids, auctions.                  |
| `tonapi.emulation`      | Message decoding and event/trace/wallet emulation.     |
| `tonapi.events`         | Event lookup and emulation.                            |
| `tonapi.extra_currency` | Extra currency info.                                   |
| `tonapi.gasless`        | Gasless config, estimation, and sending.               |
| `tonapi.jettons`        | Jetton info, holders, transfers, events.               |
| `tonapi.lite_server`    | Direct lite server access (raw blockchain data).       |
| `tonapi.multisig`       | Multisig accounts and orders.                          |
| `tonapi.nft`            | Collections, items, history.                           |
| `tonapi.purchases`      | Purchase history.                                      |
| `tonapi.rates`          | Token rates, charts, markets.                          |
| `tonapi.staking`        | Nominator pools, staking info, history.                |
| `tonapi.storage`        | Storage providers.                                     |
| `tonapi.traces`         | Trace lookup and emulation.                            |
| `tonapi.utilities`      | OpenAPI spec, status, address parsing.                 |
| `tonapi.wallet`         | Wallet info, seqno, TON Connect proof, emulation.      |

## Endpoints

| Network | URL                         |
| ------- | --------------------------- |
| Mainnet | `https://tonapi.io`         |
| Testnet | `https://testnet.tonapi.io` |
| Tetra   | `https://tetra.tonapi.io`   |
