/v1/scripts REST API Endpoint
Parameters
block_id
string
The ID of the block to execute the script against. For a specific block height, use block_height instead
block_height
string
The block height for which the script is to be run. The string final and sealed are also supported. This parameter is incompatible with block_id
script
string
The Base64 encoded content of the Cadence script
arguments
array
A list of arguments each encoded as Base64 passed in the JSON-Cadence interchange format
Returns
value
string
The result of the executed Cadence script
Request
1SCRIPT=$(echo 'pub fun main(greeting: String): String { return greeting }' | base64)2GREETING=$(echo '{"type":"String","value":"Hello world"}' | base64)34curl --location https://docs-demo.flow-mainnet.quiknode.pro/v1/scripts \5-H 'Content-Type: application/json' \6-d "{\"script\": \"${SCRIPT}\",\"arguments\":[\"${GREETING}\"]}"
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free