Skip to main content

Overview

The API v3 requires an API key for all methods. The key can be sent either in an HTTP header or as a query parameter. To obtain an API key, see the TON Center API key guide.
TypeLocationNameRequired
API keyHeaderX-API-KeyYes
API keyQueryapi_keyYes
Only one of these is needed per request.

Header authentication

Send the API key in the X-API-Key header:
curl "https://<HOST>/api/v3/masterchainInfo" \
  -H "X-API-Key: <API_KEY>"
  • <HOST> - The base URL of the TON Center API instance (toncenter.com for example).
  • <API_KEY> - The API key obtained from the TON Center bot.

Query parameter authentication

Pass the key as a query parameter named api_key:
curl "https://<HOST>/api/v3/masterchainInfo?api_key=<API_KEY>"
Both forms are equivalent.