Skip to main content

Fetch data from the Indexer

Prerequisites

Access to the Calimero console running a private shard.

Configuration

Create a new shard token https://near.github.io/near-api-js/interfaces/connect.connectconfig.html

Generate a new token in the calimero security dashboard.

Fetching data

Method: POST

Url: (https://api.testnet.calimero.network/api/v1/shards/{{shardId}}/indexer-graphql/graphql)

Headers: Any request to the indexer endpoint must include an authorization header. The value is the token generated in the previous step.

Body: A GraphQL query

Example

    "query": "query getAccountType($accountId: String!){\n    allActionReceiptActions(\n      condition: {actionKind: DEPLOY_CONTRACT, receiptPredecessorAccountId: $accountId}\n      orderBy: RECEIPT_INCLUDED_IN_BLOCK_TIMESTAMP_DESC\n      first: 1\n    ) {\n      totalCount\n    }\n  }",
"variables":{
"accountId": "{{shardId}}.calimero"
}
}
Screen Shot 2022-08-05 at 12 31 10 PM