Skip to content

You can query entities stored on Arkiv with standard JSON-RPC 2.0 calls. This page covers the methods, query syntax, operators, pagination, and utility endpoints.

PropertyValue
Chain ID7738577 (0x7614d1)
HTTP RPChttps://rpc.tiramisu.db-chain.testnet.arkiv.network
Explorertiramisu.explorer.arkiv.network

Use of the public RPC is subject to the Arkiv Terms of Use and Privacy Policy.

All methods use standard JSON-RPC 2.0:

Terminal window
curl https://rpc.tiramisu.db-chain.testnet.arkiv.network \
-H "content-type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"METHOD_NAME","params":[]}'

This method reads one entity by key, at the tip or as of a past block.

IndexTypeRequiredDescription
0stringYesEntity key, 32-byte hex
1numberNoBlock number to read as of

This method returns every field on the entity. There is no select option, because the read already names a single entity. If the key never existed, was deleted, or expired, this method returns null.

Terminal window
curl https://rpc.tiramisu.db-chain.testnet.arkiv.network \
-H "content-type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"arkiv_getEntity","params":["0x9f2c..."]}'

This method queries entities from the indexed store.

IndexTypeRequiredDescription
0stringYesQuery expression
1object/nullNoQuery options

A query is a bare boolean expression, no SELECT or WHERE. Keywords are case-insensitive. A comment starts with -- and runs to the end of the line.

For example, this query matches every open ticket with a priority of 3 or higher:

-- open tickets, priority 3 or higher
status = str('open') AND priority >= 3

Operators:

OperatorDescription
ANDLogical AND
ORLogical OR
NOTComplement, evaluated against the set of live entities
=Equality
<, >, <=, >=Numeric comparisons (ordered types only: i32, u64, u256, dec)
STARTSWITHString prefix match (the language’s only pattern operator)

Value literals:

Every value carries a type tag. The tag is part of what the predicate asserts. For example, level >= i32(10) matches only entities whose level is an i32.

Two things are untagged: a bare boolean (true / false) and a bare number. An untagged number defaults to i32. You must give every other value an explicit type tag:

TypeLiteral form
Stringstr('open')
32-bit integeri32(10) or bare 10
64-bit unsigned integeru64(1200000)
256-bit unsigned integeru256(1000000)
Fixed-point decimaldec('3.5')
Addressaddr(0xAbC...)
Entity keykey(0x123...)
Fixed 32 bytesbytes32(0x...)
Booleanbare true / false

Match everything:

*

Synthetic attributes (use with $ prefix):

AttributeTypeFilterable
$keykeyYes
$owneraddrYes
$creatoraddrYes
$expiresAtu64Yes
$createdAtu64Yes
$contentTypestrYes
$updatedAtn/aNo (returned by projections only)
$creationFlagsn/aNo (returned by projections only)
$payloadn/aNo (bytes carry no index)
FieldTypeDescription
selectobjectWhich fields to return. Defaults to { "key": true }
limithex stringPage size. Node maximum is 200
cursorstringPagination cursor from a previous response
atBlockhex stringQuery at a specific block (for example, "0x1bc"). Defaults to the head

select fields (all default to false except key, which defaults to true when select is omitted):

key, owner, creator, createdAt, updatedAt, expiresAt, creationFlags, contentType, payload, attributeSchema, attributes

attributes can also take an object of names, to fetch only those. For example: { "attributes": { "status": true } }.

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
{
"key": "0x9f2c...",
"owner": "0xabc...",
"creator": "0xabc...",
"createdAt": "0x191",
"updatedAt": "0x1bb",
"expiresAt": "0x2000",
"creationFlags": { "readonly": false, "permissionlessExtension": false, "raw": 0 },
"contentType": "application/json",
"payload": "0x7b226d657373616765223a2268656c6c6f227d",
"attributes": [
{ "name": "status", "type": "str", "value": "active" },
{ "name": "rarity", "type": "i32", "value": 5 }
]
}
],
"blockNumber": "0x1bc",
"cursor": "0x2a"
}
}

By attribute:

Terminal window
curl https://rpc.tiramisu.db-chain.testnet.arkiv.network \
-H "content-type: application/json" \
-d '{
"jsonrpc":"2.0","id":1,
"method":"arkiv_query",
"params":[
"type = str('\''nft'\'') AND status = str('\''active'\'')",
{"limit":"0xa","select":{"key":true,"attributes":true}}
]
}'

By owner:

Terminal window
curl https://rpc.tiramisu.db-chain.testnet.arkiv.network \
-H "content-type: application/json" \
-d '{
"jsonrpc":"2.0","id":10,
"method":"arkiv_query",
"params":[
"$owner = addr(0x2222222222222222222222222222222222222222)",
null
]
}'

Numeric range:

Terminal window
curl https://rpc.tiramisu.db-chain.testnet.arkiv.network \
-H "content-type: application/json" \
-d '{
"jsonrpc":"2.0","id":12,
"method":"arkiv_query",
"params":["price >= i32(100) AND price <= i32(1000)", null]
}'

Prefix match with negation:

Terminal window
curl https://rpc.tiramisu.db-chain.testnet.arkiv.network \
-H "content-type: application/json" \
-d '{
"jsonrpc":"2.0","id":13,
"method":"arkiv_query",
"params":["name STARTSWITH str('\''test'\'') AND NOT (status = str('\''deleted'\''))", null]
}'

Metadata only (omit payload):

Terminal window
curl https://rpc.tiramisu.db-chain.testnet.arkiv.network \
-H "content-type: application/json" \
-d '{
"jsonrpc":"2.0","id":14,
"method":"arkiv_query",
"params":[
"*",
{
"limit":"0xa",
"select":{
"key":true,"attributes":true,"payload":false,
"contentType":true,"expiresAt":true,
"creator":true,"owner":true
}
}
]
}'

Use the returned cursor in the next request:

{
"method": "arkiv_query",
"params": [
"type = str('nft')",
{ "cursor": "0x2a", "limit": "0x2" }
]
}

When cursor is absent from the response, there are no more pages.

This method returns the total number of entities that match an optional query, at the tip or a past block.

IndexTypeRequiredDescription
0object/nullNo{ "query"?: string, "block"?: number }. Defaults to every entity at the tip
Terminal window
curl https://rpc.tiramisu.db-chain.testnet.arkiv.network \
-H "content-type: application/json" \
-d '{"jsonrpc":"2.0","id":3,"method":"arkiv_getEntityCount","params":[]}'

Result: a plain JSON number (for example, 18427).

This method returns the timing for the current head block. It takes no parameters.

{
"result": {
"current_block": 582143,
"current_block_time": 1742721127,
"duration": 2
}
}
  • current_block_time: Unix timestamp in seconds
  • duration: seconds since the previous block