TONAPI

Quick Start

Get started with TONAPI in minutes

Quick Start

Get up and running with TONAPI in just a few minutes. This guide will walk you through the essential steps to start building on TON blockchain.

Prerequisites

Before you begin, you'll need:

  • Basic understanding of REST APIs
  • An API key (optional for basic usage, required for higher limits)
  • Your preferred programming language and HTTP client

Your First API Call

Let's make your first request to TONAPI. We'll fetch information about a TON account:

curl https://tonapi.io/v2/accounts/EQD0vdSA_NedR9uvbgN9EikRX-suesDxGeFg69XQMavfLqIw

This will return detailed information about the account, including balance, status, and more.

Get Your API Key

For production use and higher rate limits, you'll need an API key:

  1. Visit TON Console
  2. Sign up or log in to your account
  3. Navigate to API Keys section
  4. Create a new API key for your project

Once you have your key, include it in your requests:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://tonapi.io/v2/accounts/EQD0vdSA_NedR9uvbgN9EikRX-suesDxGeFg69XQMavfLqIw

Use SDK for Your Language

TONAPI provides SDKs for popular programming languages:

JavaScript/TypeScript

npm install @ton-api/client
import { TonApiClient } from '@ton-api/client';

const client = new TonApiClient({
  apiKey: 'YOUR_API_KEY'
});

const account = await client.accounts.getAccount(
  'EQD0vdSA_NedR9uvbgN9EikRX-suesDxGeFg69XQMavfLqIw'
);

Python

pip install tonapi
from tonapi import TonApi

client = TonApi(api_key='YOUR_API_KEY')
account = client.accounts.get_account(
  'EQD0vdSA_NedR9uvbgN9EikRX-suesDxGeFg69XQMavfLqIw'
)

Next Steps

Now that you've made your first API call, explore more features:

Need Help?

How is this guide?