Skip to main content

HTTP API by GetBlock

info

GetBlock is a Web3 infrastructure provider that offers HTTP-based API endpoints for clients to interact with multiple blockchain networks, including TON.

This guide covers essential steps in acquiring and using private RPC endpoints by GetBlock to access TON Blockchain.

How to access TON Blockchain endpoints

To start using GetBlock’s endpoints, users need to log in to their accounts and retrieve a TON endpoint URL. Follow these instructions:

1. Create a GetBlock account

Visit the GetBlock website and click on the "Get Started for Free" button. Sign up using your email address or by connecting a supported wallet (e.g., MetaMask) for GetBlock account authentication; this is unrelated to TON interactions.

GetBlock homepage

2. Select TON Blockchain

After signing in, go to the "My Endpoints" section. Choose TON from the "Protocols" dropdown menu and select the desired network and API type (JSON-RPC or JSON-RPC v2).

GetBlock dashboard — My Endpoints

3. Generate your endpoint URL

Click the Get button to generate your TON Blockchain endpoint URL. The structure of the endpoint will be: https://go.getblock.io/[ACCESS-TOKEN]/.

Access tokens act as unique identifiers for your requests, eliminating the need for separate API keys or authorization headers.

Users have the flexibility to generate multiple endpoints, roll tokens if compromised, or delete unused endpoints.

Generated TON endpoint token

Now you can use these URLs to interact with TON Blockchain, query data, send transactions, and build decentralized applications without the hassle of infrastructure setup and maintenance.

Free requests and user limits

Each registered user receives 40,000 free requests per day with a cap of 60 requests per second (RPS). Limits are provider-specific and subject to change. This balance is renewed daily and can be used for any supported blockchain.

Shared nodes

  • Entry-level option where the same nodes are used by multiple clients.
  • Rate limit increased to 200 RPS.
  • Well suited for individual use or for applications that have lower transaction volumes and resource requirements than fully scaled production applications.
  • More affordable option for individual developers or small teams with limited budgets.

Shared nodes provide a cost-effective solution for accessing TON Blockchain infrastructure without the need for significant upfront investment or commitment.

As developers scale their applications and require additional resources, they can easily upgrade their subscription plans or transition to dedicated nodes if necessary.

Dedicated nodes

  • One node is exclusively allocated to a single client.
  • No request limits.
  • Provides access to archive nodes, multiple server locations, and custom settings.
  • Guarantees premium-level service and support to clients.

This is a next-level solution for developers and decentralized applications (DApps) that require enhanced throughput, higher speed of node connection, and guaranteed resources as they scale.

How to use TON HTTP API by GetBlock

In this section, we delve into the practical usage of the TON HTTP API provided by GetBlock. We explore the examples to showcase how to effectively utilize the generated endpoints for your blockchain interactions.

Examples of common API calls

You can use the /getAddressBalance method to get the balance for a specific TON address:

curl --location --request GET 'https://go.getblock.io/[ACCESS-TOKEN]/getAddressBalance?address=EQDXZ2c5LnA12Eum-DlguTmfYkMOvNeFCh4rBD0tgmwjcFI-'

Make sure to replace [ACCESS-TOKEN] with your actual access token provided by GetBlock.

This will output the balance in nanotons.

Sample getAddressBalance response

Some other available GetBlock methods to query the TON Blockchain:

#HTTP methodPathDescription
1GET/getAddressStateReturns the current state of a specified address (uninitialized, active, or frozen).
2GET/getMasterchainInfoFetches the state of the masterchain.
3GET/getTokenDataRetrieves details about an NFT or jetton associated with the address.
4GET/packAddressConverts a TON address from raw format to human-readable format.
5POST/sendBocSends serialized BOC files with external messages for blockchain execution.
6GET/getAddressBalanceReturns the balance of a specified TON address in nanotons.

For the official method list and detailed API documentation, see GetBlock’s TON JSON-RPC reference.

Deploying smart contracts

Developers can use an SDK to deploy and interact with contracts. The SDK will initialize a client to connect to the network via the GetBlock HTTP API endpoints. See the SDK list.

Deploying via TON Blueprint IDE

By following this guide, developers can easily access TON Blockchain using GetBlock's infrastructure. Whether you're working on decentralized applications (DApps) or simply querying data, GetBlock simplifies the process by offering ready-to-use HTTP API endpoints with various features.

Feel free to learn more at the website or drop a line to GetBlock’s support via live chat, Telegram, or a website form.

Was this article useful?