> ## Documentation Index
> Fetch the complete documentation index at: https://toncenter.ness.su/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Get Method

> Run get method of smart contract



## OpenAPI

````yaml POST /api/v2/runGetMethod
openapi: 3.1.1
info:
  title: TON HTTP API C++
  description: >
    This API enables HTTP access to TON blockchain - getting accounts and
    wallets information, looking up blocks and transactions, sending messages to
    the blockchain, calling get methods of smart contracts, and more.


    In addition to REST API, all methods are available through [JSON-RPC
    endpoint](#json%20rpc)  with `method` equal to method name and `params`
    passed as a dictionary.


    The response contains a JSON object, which always has a boolean field `ok`
    and either `error` or `result`. If `ok` equals true, the request was
    successful and the result of the query can be found in the `result` field.
    In case of an unsuccessful request, `ok` equals false and the error is
    explained in the `error`.


    API Key should be sent either as `api_key` query parameter or `X-API-Key`
    header
  version: 2.1.1
servers:
  - url: https://toncenter.com
    description: Mainnet
  - url: https://testnet.toncenter.com
    description: Testnet
security: []
tags:
  - name: utils
    description: Some useful methods
  - name: accounts
    description: Information about accounts
  - name: blocks
    description: Information about blocks
  - name: transactions
    description: Fetching and locating transactions
  - name: configuration
    description: Information about blockchain config
  - name: run method
    description: Run get-method of smart contracts
  - name: send
    description: Send data to blockchain
  - name: rpc
    description: JSON-RPC and POST endpoints
paths:
  /api/v2/runGetMethod:
    post:
      tags:
        - run method
        - rpc
      summary: Run Get Method
      description: Run get method of smart contract
      operationId: runGetMethod_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunGetMethodRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    example: true
                  result:
                    title: RunGetMethodResult
                    allOf:
                      - $ref: '#/components/schemas/RunGetMethodResult'
                required:
                  - ok
                  - result
        default:
          $ref: '#/components/responses/default'
components:
  schemas:
    RunGetMethodRequest:
      type: object
      additionalProperties: false
      required:
        - address
        - method
        - stack
      properties:
        address:
          $ref: '#/components/schemas/TonAddr'
        method:
          oneOf:
            - type: string
            - type: integer
              format: int32
        stack:
          type: array
          items:
            $ref: '#/components/schemas/LegacyStackEntry'
        seqno:
          type: integer
          format: int32
    RunGetMethodResult:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - gas_used
        - stack
        - exit_code
        - block_id
        - last_transaction_id
      properties:
        '@type':
          type: string
          enum:
            - smc.runResult
          default: smc.runResult
        gas_used:
          type: integer
          format: int64
        stack:
          type: array
          items:
            $ref: '#/components/schemas/LegacyStackEntry'
        exit_code:
          type: integer
          format: int32
        block_id:
          $ref: '#/components/schemas/TonBlockIdExt'
        last_transaction_id:
          $ref: '#/components/schemas/InternalTransactionId'
    TonAddr:
      type: string
      x-usrv-cpp-type: ton_http::types::ton_addr
    LegacyStackEntry:
      type: array
      items:
        oneOf:
          - type: string
          - type: integer
            format: int64
          - $ref: '#/components/schemas/LegacyStackEntryCell'
          - $ref: '#/components/schemas/TvmTuple'
            x-usrv-cpp-indirect: true
          - $ref: '#/components/schemas/TvmList'
            x-usrv-cpp-indirect: true
      minItems: 2
      maxItems: 2
    TonBlockIdExt:
      type: object
      additionalProperties: false
      properties:
        '@type':
          type: string
          enum:
            - ton.blockIdExt
          default: ton.blockIdExt
        workchain:
          type: integer
        shard:
          type: string
          x-usrv-cpp-type: std::int64_t
        seqno:
          type: integer
        root_hash:
          $ref: '#/components/schemas/TonHash'
        file_hash:
          $ref: '#/components/schemas/TonHash'
      required:
        - '@type'
        - workchain
        - shard
        - seqno
        - root_hash
        - file_hash
      description: Extended block identifier.
    InternalTransactionId:
      type: object
      additionalProperties: false
      description: Internal transaction identifier.
      properties:
        '@type':
          type: string
          enum:
            - internal.transactionId
          default: internal.transactionId
        lt:
          type: string
          description: Logical time
          x-usrv-cpp-type: std::int64_t
        hash:
          $ref: '#/components/schemas/TonHash'
      required:
        - '@type'
        - lt
        - hash
    TonlibErrorResponse:
      type: object
      additionalProperties: false
      title: TonlibErrorResponse
      required:
        - ok
        - error
        - code
      properties:
        ok:
          type: boolean
          title: Ok
          default: false
        error:
          type: string
          title: Error description
        code:
          type: integer
          title: Error code
          minimum: 100
          maximum: 600
        '@extra':
          type: string
          title: Extra information
        jsonrpc:
          type: string
        id:
          type: string
    LegacyStackEntryCell:
      type: object
      additionalProperties: false
      required:
        - bytes
      properties:
        bytes:
          $ref: '#/components/schemas/Bytes'
        object:
          $ref: '#/components/schemas/LegacyTvmCell'
    TvmTuple:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - elements
      properties:
        '@type':
          type: string
          enum:
            - tvm.tuple
          default: tvm.tuple
        elements:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/TvmStackEntrySlice'
                x-usrv-cpp-indirect: true
              - $ref: '#/components/schemas/TvmStackEntryCell'
                x-usrv-cpp-indirect: true
              - $ref: '#/components/schemas/TvmStackEntryNumber'
                x-usrv-cpp-indirect: true
              - $ref: '#/components/schemas/TvmStackEntryTuple'
                x-usrv-cpp-indirect: true
              - $ref: '#/components/schemas/TvmStackEntryList'
                x-usrv-cpp-indirect: true
              - $ref: '#/components/schemas/TvmStackEntryUnsupported'
                x-usrv-cpp-indirect: true
            discriminator:
              propertyName: '@type'
              mapping:
                tvm.stackEntrySlice:
                  $ref: '#/components/schemas/TvmStackEntrySlice'
                tvm.stackEntryCell:
                  $ref: '#/components/schemas/TvmStackEntryCell'
                tvm.stackEntryNumber:
                  $ref: '#/components/schemas/TvmStackEntryNumber'
                tvm.stackEntryTuple:
                  $ref: '#/components/schemas/TvmStackEntryTuple'
                tvm.stackEntryList:
                  $ref: '#/components/schemas/TvmStackEntryList'
                tvm.stackEntryUnsupported:
                  $ref: '#/components/schemas/TvmStackEntryUnsupported'
    TvmList:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - elements
      properties:
        '@type':
          type: string
          enum:
            - tvm.list
          default: tvm.list
        elements:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/TvmStackEntrySlice'
                x-usrv-cpp-indirect: true
              - $ref: '#/components/schemas/TvmStackEntryCell'
                x-usrv-cpp-indirect: true
              - $ref: '#/components/schemas/TvmStackEntryNumber'
                x-usrv-cpp-indirect: true
              - $ref: '#/components/schemas/TvmStackEntryTuple'
                x-usrv-cpp-indirect: true
              - $ref: '#/components/schemas/TvmStackEntryList'
                x-usrv-cpp-indirect: true
              - $ref: '#/components/schemas/TvmStackEntryUnsupported'
                x-usrv-cpp-indirect: true
            discriminator:
              propertyName: '@type'
              mapping:
                tvm.stackEntrySlice:
                  $ref: '#/components/schemas/TvmStackEntrySlice'
                tvm.stackEntryCell:
                  $ref: '#/components/schemas/TvmStackEntryCell'
                tvm.stackEntryNumber:
                  $ref: '#/components/schemas/TvmStackEntryNumber'
                tvm.stackEntryTuple:
                  $ref: '#/components/schemas/TvmStackEntryTuple'
                tvm.stackEntryList:
                  $ref: '#/components/schemas/TvmStackEntryList'
                tvm.stackEntryUnsupported:
                  $ref: '#/components/schemas/TvmStackEntryUnsupported'
    TonHash:
      type: string
      x-usrv-cpp-type: ton_http::types::ton_hash
    Bytes:
      type: string
      x-usrv-cpp-type: ton_http::types::bytes
    LegacyTvmCell:
      type: object
      additionalProperties: false
      required:
        - data
        - refs
        - special
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - b64
            - len
          properties:
            b64:
              $ref: '#/components/schemas/Bytes'
            len:
              type: integer
              format: int32
        refs:
          type: array
          items:
            $ref: '#/components/schemas/LegacyTvmCell'
        special:
          type: boolean
    TvmStackEntrySlice:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - slice
      properties:
        '@type':
          type: string
          enum:
            - tvm.stackEntrySlice
          default: tvm.stackEntrySlice
        slice:
          $ref: '#/components/schemas/TvmSlice'
    TvmStackEntryCell:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - cell
      properties:
        '@type':
          type: string
          enum:
            - tvm.stackEntryCell
          default: tvm.stackEntryCell
        cell:
          $ref: '#/components/schemas/TvmCell'
    TvmStackEntryNumber:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - number
      properties:
        '@type':
          type: string
          enum:
            - tvm.stackEntryNumber
          default: tvm.stackEntryNumber
        number:
          $ref: '#/components/schemas/TvmNumberDecimal'
    TvmStackEntryTuple:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - tuple
      properties:
        '@type':
          type: string
          enum:
            - tvm.stackEntryTuple
          default: tvm.stackEntryTuple
        tuple:
          $ref: '#/components/schemas/TvmTuple'
    TvmStackEntryList:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - list
      properties:
        '@type':
          type: string
          enum:
            - tvm.stackEntryList
          default: tvm.stackEntryList
        list:
          $ref: '#/components/schemas/TvmList'
    TvmStackEntryUnsupported:
      type: object
      additionalProperties: false
      required:
        - '@type'
      properties:
        '@type':
          type: string
          enum:
            - tvm.stackEntryUnsupported
          default: tvm.stackEntryUnsupported
    TvmSlice:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - bytes
      properties:
        '@type':
          type: string
          enum:
            - tvm.slice
          default: tvm.slice
        bytes:
          $ref: '#/components/schemas/Bytes'
    TvmCell:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - bytes
      properties:
        '@type':
          type: string
          enum:
            - tvm.cell
          default: tvm.cell
        bytes:
          $ref: '#/components/schemas/Bytes'
    TvmNumberDecimal:
      type: object
      additionalProperties: false
      required:
        - '@type'
        - number
      properties:
        '@type':
          type: string
          enum:
            - tvm.numberDecimal
          default: tvm.numberDecimal
        number:
          $ref: '#/components/schemas/Int256'
    Int256:
      type: string
      x-usrv-cpp-type: ton_http::types::int256
  responses:
    default:
      description: Tonlib error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TonlibErrorResponse'
          examples:
            '409':
              summary: Not a token
              value:
                ok: false
                code: 409
                error: Smart contract is not a Jetton or NFT
                '@extra': ...
            '422':
              summary: Request validation error
              value:
                ok: false
                code: 422
                error: ...
                '@extra': ...
            '429':
              summary: Ratelimit exceeded
              value:
                ok: false
                code: 429
                error: ...
                '@extra': ...
            '504':
              summary: Tonlib timeout
              value:
                ok: false
                code: 504
                error: ...
                '@extra': ...

````