The Indexer API allows you to interact with the Calimero shard's indexer service to fetch data about accounts, transactions, and other blockchain-related information. Here's a guide on how to use the Indexer API:
Before using the Indexer API, ensure you have access to the Calimero console.
To make calls to the Indexer API, you need to configure the following parameters:
The API endpoint is constructed using the following parts:
networkId: This can be either testnet (with the suffix: -calimero-testnet) or mainnet (with the suffix: -calimero).
shardId: This is the unique identifier of your shard and consists of the user-defined shard name and network suffix. All parts are required. The endpoint URL is as follows:
You can find the endpoint URL in the Calimero Console.
Follow the steps provided here to generate an auth token for your Calimero shard.
The authorization token must be provided in the header of your API request:
The Indexer API schema is available here.
Here's an example of how to make a request to the Indexer API using different tools:
shardId: test-calimero-testnet (make sure to include the complete shard ID)
- Include the
Authorizationheader with the value of the token generated in the previous step.
- Include the
- A GraphQL query.
- If the API call is correct, a status 200 will be returned with the response body:
Login to Apollo Studio and create a new project.
Open the Explorer and set the following configuration details:
- Endpoint URL and authorization token.
Enter your GraphQL query in the Explorer.
With these examples, you can start using the Indexer API to fetch data from the Calimero shard's indexer service.