Flow API
The Graffle Flow API allows for running queries against the Flow blockchain, both for the current and historical sporks.
Check for availability.
GET api/ping
{
// Response
}{
// Response
}Get the latest block
GET api/v1/blocks/getlatest
{
"height": 32362301,
"parentId": "547e12bfd93919ac0475b314ae9b19f6cec8e1881b6f0b6ed92a258f9b63de33",
"id": "0ca907e9638bdb67c4a72ace751dfe3d80d0293acd1421eefe63d6cc424347ca",
"timestamp": "2022-06-28T20:30:54.5133787+00:00",
"collectionGuarantees": [
{
"collectionId": "0c061642d61d0f7bade7cfc0a6ef10838aa44690ab238a1e3f9ed0b69f1eb2ea",
"signatures": [
""
]
},
{
"collectionId": "1045659dc5d52fec0ef1fc0936c854a7d06b6bb942c8c4fef1973df2df817ee6",
"signatures": [
""
]
},
{
"collectionId": "c2d393d4f47bfed499b262683ce64d6e8ec677f885fc61e884576b566752551b",
"signatures": [
""
]
},
{
"collectionId": "8d76b5ae9f5fbbf6f76ec21c72d4caaa080a4333fc9b9935faec3f8643aebdc3",
"signatures": [
""
]
}
],
"signatures": [
"f86f8b0000000000000000000000b0a168d6cb09711813f297340904bf676f149db5d81d848e0c36021ca8661e39041b1df1af3eaac73331ad2e75ae7a904f80b082068f8a6a4dea552d1cfbb79868ed3b4fa6e157cba6cb0fa0540fbbb8f2dee8cc50f253771cbc33fa0c1b1585edd763"
],
"blockSeals": []
}Get block by height
GET api/v1/blocks/height/{blockHeight}
Path Parameters
blockHeight*
Numeric
Height of block to retrieve.
Get the start and end block based on a date range
GET api/v1/blocks/datesearch
Provide two Unix timestamps (in seconds) and retrieve the first and last block heights within that range.
Query Parameters
startTimestamp*
Timestamp
endTimestamp*
Timestamp
Get events by event type and block height range
GET api/v1/events
Query Parameters
eventType*
String
Full name of desired event, e.g. A.c1e4f4f4c4257510.TopShotMarketV3.MomentListed
startHeight*
Numeric
Starting block height
endHeight*
Numeric
Ending block height
Get transaction
GET api/v1/transaction/{transactionId}
Path Parameters
transactionId*
String
Id of transaction to retrieve
Get account at latest block
GET api/v1/account/{address}
Path Parameters
address*
String
Wallet address to retrieve (either with "0x" prefix or without
Get collection by id
GET api/v1/collection/{collectionId}
Path Parameters
collectionId*
String
Id of collection to retrieve
Execute Cadence script at latest block
POST api/v1/cadence/execute
Request body (see example below) is made up of two properties - script and arguments. They are both required, if your script does not need any arguments, pass an empty array.
Script must be a valid Cadence script, with quotes escaped by a backslash \, and newlines represented by \r\n. See the Cadence language documentation for more details:
https://docs.onflow.org/cadence/language/
Arguments must be an array of objects representing valid Cadence types and Cadence JSON. See the Cadence types documentation for more details:
https://docs.onflow.org/cadence/json-cadence-spec/
Last updated
