Skip to main content
POST
/
api
/
v2
/
runGetMethod
Run get method
curl --request POST \
  --url https://toncenter.com/api/v2/runGetMethod \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "address": "<string>",
  "method": "<string>",
  "stack": [
    [
      "<string>"
    ]
  ],
  "seqno": 123
}
'
{
  "ok": true,
  "result": {
    "@type": "smc.runResult",
    "gas_used": 123,
    "stack": [
      [
        "<string>"
      ]
    ],
    "exit_code": 123,
    "block_id": {
      "@type": "ton.blockIdExt",
      "workchain": 123,
      "shard": "<string>",
      "seqno": 123,
      "root_hash": "<string>",
      "file_hash": "<string>"
    },
    "last_transaction_id": {
      "@type": "internal.transactionId",
      "lt": "<string>",
      "hash": "<string>"
    }
  },
  "@extra": "<string>"
}

Authorizations

X-API-Key
string
header
required

API key header of the form X-API-Key: <token>, where <token> is your API key. Requests without a key are limited to 1 RPS. More info here.

Body

application/json

Request to execute a smart contract get method. Specify address, method name/ID, and input stack.

address
string
required

Account address in raw format (e.g., 0:ca6e321c...) or user-friendly format (e.g., EQDKbjIcfM...). All formats are automatically detected.

method
required

The get method name (e.g., "seqno", "get_wallet_data") or its numeric ID.

stack
string · integer<int64> · object · object · object[][]
required

Input arguments as a TVM stack. Each entry is a two-element array: [type, value] where type is "num" (decimal string), "cell" (base64 BOC), or "slice" (base64 BOC).

Required array length: 2 elements
seqno
integer<int32>

Masterchain block sequence number. Run the get method against the contract state at this specific block height. If omitted, uses the current state.

Response

Returns the TVM stack output and exit code from executing the specified get method.

ok
boolean
default:true
required

Returns true if the request succeeded; otherwise false. See the error field for details.

result
object
required

Response data. Present only when ok is true.

@extra
string

Optional request ID that you can pass in the request and receive back in the response. Useful for matching async responses.