# API v2 overview (https://docs-fpm2731fy-ton-core-docs.vercel.app/llms/ecosystem/api/toncenter/v2/overview/content.md)



The TON Center API v2 provides developer access to the TON blockchain through [REST](https://en.wikipedia.org/wiki/REST) and [JSON-RPC](https://en.wikipedia.org/wiki/JSON-RPC) endpoints. It allows applications to read blockchain data, run smart contract methods, and send transactions.

API v2 serves as the non-indexed access layer.

Applications interact with the TON blockchain by connecting to a TON node. Since nodes communicate through the binary ADNL protocol, an intermediate layer is needed for web-based access. API v2 provides this bridge by using [`tonlib`](https://github.com/ton-blockchain/ton/tree/master/tonlib/tonlib) to query data from liteservers and exposes it through a standard REST interface.

<Callout type="note">
  Refer to the [Streaming API v2](/llms/ecosystem/api/toncenter/streaming/content.md) page for an API that uses Server-Sent Events (SSE) and exposes WebSocket interfaces.
</Callout>

## Base URLs [#base-urls]

| API    | Mainnet                        | Testnet                                |
| ------ | ------------------------------ | -------------------------------------- |
| API v2 | `https://toncenter.com/api/v2` | `https://testnet.toncenter.com/api/v2` |

## Versioning [#versioning]

API v2 uses semantic versioning in the format `a.b.c` (for example, `2.1.1`):

| Segment | Example | Meaning                                                             |
| ------- | ------- | ------------------------------------------------------------------- |
| Major   | `2.x.x` | Fixed at `2` to avoid confusion ("API v2 v3.x.x"). Will not change. |
| Minor   | `2.1.x` | Implementation variant: `0` = Python version, `1` = C++ version.    |
| Patch   | `2.1.1` | Bumped with every release on GitHub.                                |

## Typical use cases [#typical-use-cases]

* Query account balances and state
* Run get-methods on smart contracts
* Send or broadcast messages
* Retrieve latest transactions and block information

## Endpoints [#endpoints]

{/* BEGIN_AUTO_GENERATED: API_V2_ENDPOINTS */}

| Category          | Method                                                                                                        | Description                       |
| ----------------- | ------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| **Accounts**      | [`GET /getAddressInformation`](/llms/ecosystem/api/toncenter/v2/accounts/get-address-information/content.md)                  | Get address information           |
| **Accounts**      | [`GET /getExtendedAddressInformation`](/llms/ecosystem/api/toncenter/v2/accounts/get-extended-address-information/content.md) | Get extended address information  |
| **Accounts**      | [`GET /getWalletInformation`](/llms/ecosystem/api/toncenter/v2/accounts/get-wallet-information/content.md)                    | Get wallet information            |
| **Accounts**      | [`GET /getAddressBalance`](/llms/ecosystem/api/toncenter/v2/accounts/get-address-balance/content.md)                          | Get address balance               |
| **Accounts**      | [`GET /getAddressState`](/llms/ecosystem/api/toncenter/v2/accounts/get-address-state/content.md)                              | Get address state                 |
| **Accounts**      | [`GET /getTokenData`](/llms/ecosystem/api/toncenter/v2/accounts/get-token-data/content.md)                                    | Get token data                    |
| **Blocks**        | [`GET /getMasterchainInfo`](/llms/ecosystem/api/toncenter/v2/blocks/get-masterchain-info/content.md)                          | Get masterchain info              |
| **Blocks**        | [`GET /getMasterchainBlockSignatures`](/llms/ecosystem/api/toncenter/v2/blocks/get-masterchain-block-signatures/content.md)   | Get masterchain block signatures  |
| **Blocks**        | [`GET /getShardBlockProof`](/llms/ecosystem/api/toncenter/v2/blocks/get-shard-block-proof/content.md)                         | Get shard block proof             |
| **Blocks**        | [`GET /getConsensusBlock`](/llms/ecosystem/api/toncenter/v2/blocks/get-consensus-block/content.md)                            | Get consensus block               |
| **Blocks**        | [`GET /lookupBlock`](/llms/ecosystem/api/toncenter/v2/blocks/lookup-block/content.md)                                         | Lookup block                      |
| **Blocks**        | [`GET /getShards`](/llms/ecosystem/api/toncenter/v2/blocks/get-shards/content.md)                                             | Get shards                        |
| **Blocks**        | [`GET /getBlockHeader`](/llms/ecosystem/api/toncenter/v2/blocks/get-block-header/content.md)                                  | Get block header                  |
| **Blocks**        | [`GET /getOutMsgQueueSize`](/llms/ecosystem/api/toncenter/v2/blocks/get-outbound-message-queue-size/content.md)               | Get outbound message queue size   |
| **Transactions**  | [`GET /getBlockTransactions`](/llms/ecosystem/api/toncenter/v2/transactions/get-block-transactions/content.md)                | Get block transactions            |
| **Transactions**  | [`GET /getBlockTransactionsExt`](/llms/ecosystem/api/toncenter/v2/transactions/get-block-transactions-extended/content.md)    | Get block transactions (extended) |
| **Transactions**  | [`GET /getTransactions`](/llms/ecosystem/api/toncenter/v2/transactions/get-transactions/content.md)                           | Get transactions                  |
| **Transactions**  | [`GET /getTransactionsStd`](/llms/ecosystem/api/toncenter/v2/transactions/get-transactions-standard/content.md)               | Get transactions (standard)       |
| **Transactions**  | [`GET /tryLocateTx`](/llms/ecosystem/api/toncenter/v2/transactions/try-locate-transaction/content.md)                         | Try locate transaction            |
| **Transactions**  | [`GET /tryLocateResultTx`](/llms/ecosystem/api/toncenter/v2/transactions/try-locate-result-transaction/content.md)            | Try locate result transaction     |
| **Transactions**  | [`GET /tryLocateSourceTx`](/llms/ecosystem/api/toncenter/v2/transactions/try-locate-source-transaction/content.md)            | Try locate source transaction     |
| **Send**          | [`POST /sendBoc`](/llms/ecosystem/api/toncenter/v2/send/send-boc/content.md)                                                  | Send BoC                          |
| **Send**          | [`POST /sendBocReturnHash`](/llms/ecosystem/api/toncenter/v2/send/send-boc-return-hash/content.md)                            | Send BoC (return hash)            |
| **Send**          | [`POST /estimateFee`](/llms/ecosystem/api/toncenter/v2/send/estimate-fee/content.md)                                          | Estimate fee                      |
| **Run method**    | [`POST /runGetMethod`](/llms/ecosystem/api/toncenter/v2/run-method/run-get-method/content.md)                                 | Run get method                    |
| **Run method**    | [`POST /runGetMethodStd`](/llms/ecosystem/api/toncenter/v2/run-method/run-get-method-standard/content.md)                     | Run get method (standard)         |
| **Utils**         | [`GET /detectAddress`](/llms/ecosystem/api/toncenter/v2/utils/detect-address/content.md)                                      | Detect address                    |
| **Utils**         | [`GET /detectHash`](/llms/ecosystem/api/toncenter/v2/utils/detect-hash/content.md)                                            | Detect hash                       |
| **Utils**         | [`GET /packAddress`](/llms/ecosystem/api/toncenter/v2/utils/pack-address/content.md)                                          | Pack address                      |
| **Utils**         | [`GET /unpackAddress`](/llms/ecosystem/api/toncenter/v2/utils/unpack-address/content.md)                                      | Unpack address                    |
| **Configuration** | [`GET /getConfigParam`](/llms/ecosystem/api/toncenter/v2/configuration/get-config-parameter/content.md)                       | Get config parameter              |
| **Configuration** | [`GET /getConfigAll`](/llms/ecosystem/api/toncenter/v2/configuration/get-all-config-parameters/content.md)                    | Get all config parameters         |
| **Configuration** | [`GET /getLibraries`](/llms/ecosystem/api/toncenter/v2/configuration/get-libraries/content.md)                                | Get libraries                     |
| **RPC**           | [`POST /jsonRPC`](/llms/ecosystem/api/toncenter/v2/rpc/json-rpc-endpoint/content.md)                                          | JSON-RPC endpoint                 |

{/* END_AUTO_GENERATED: API_V2_ENDPOINTS */}

## How to access the API [#how-to-access-the-api]

Developers can access API v2 either through hosted infrastructure managed by TON Center or by running a self-hosted instance.

### Managed service [#managed-service]

Hosted access uses TON Center’s managed infrastructure instead of running a personal node. This approach enables immediate network access without setup or maintenance.

Requests without an API key are limited to a default rate of 1 request per second. To increase this limit or access private liteservers, generate an [API key](/llms/ecosystem/api/toncenter/get-api-key/content.md) and [choose a plan](/llms/ecosystem/api/toncenter/rate-limit/content.md).

### Self-hosted service [#self-hosted-service]

Run a self-hosted TON Center API v2 infrastructure for full control over performance and data retention. See the [API v2](https://github.com/toncenter/ton-http-api-cpp) repository for setup instructions.
