Query an Aggregated API

Learn how to query aggregated cross-chain data.

Ocelloids agents with querying capabilities expose supported query parameters through the web API. You can use these parameters to query the agent by posting an HTTP request to the agent/{agentId}/query path.

The general body properties of the query interface are:

args
Agent-specific arguments. You can retrieve the schema of the supported arguments from agent/{agentId}/queries.
pagination
Cursor-based pagination parameters. Properties include limit (maximum number of results) and cursor (starting key).

Example Request

This example request queries the Data Steward agent to retrieve data of certain assets.

Please replace <YOUR_API_KEY>1 with your own API key value.

Query Request
curl \
  'https://api.ocelloids.net/query/steward' \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -d '{
  "args":{
    "op":"assets",
    "criteria":[
      {
        "network":"urn:ocn:polkadot:1000",
        "assets":[
          "1984"
        ]
      },
      {
        "network":"urn:ocn:polkadot:2034",
        "assets":[
          "15",
          "10",
          "25"
        ]
      },
      {
        "network":"urn:ocn:polkadot:2004",
        "assets":[
          "78407957940239408223554844611219482002",
          "133307414193833606001516599592873928539"
        ]
      },
      {
        "network":"urn:ocn:polkadot:2030",
        "assets":[
          "{\"token2\":10}",
          "{\"vToken2\":0}"
        ]
      }
    ]
  }
}'
Retrieve assets data

  1. If you don’t have an API key, please refer to Get an API key ↩︎