view function - Movement

Executes a read-only Move view function against the current (or a historical) ledger state and returns its result, without creating a transaction.

Endpoint

httpPOST /v1/view

Query Parameters

ParameterTypeDescription
ledger_versionstringExecute at a specific ledger version

Example

bashexport MOVEMENT_REST=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl -X POST "${MOVEMENT_REST}v1/view" \
  -H "Content-Type: application/json" \
  -d '{"function": "0x1::coin::balance", "type_arguments": ["0x1::aptos_coin::AptosCoin"], "arguments": ["0xabc..."]}'

Response

json[
    "1500000000"
]

Response Fields

FieldTypeDescription
(root)arrayThe view function's return values

Use Cases

  • Read-Only Calls: Query a Move view function (e.g. a balance)
  • dApp Reads: Resolve on-chain state without a transaction

Error Handling

ErrorMessageDescription
400 / Bad requestBad requestA path, query, or body parameter was invalid
404 / Not foundNot foundThe account, block, transaction, or resource does not exist
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect