To work with the MQL endpoint, you need to serialize your MQL query together
with your API key, API key owner and the desired blockchain in a JSON package.
Then you can make an HTTP POST request to the Kenshi Deep Index endpoint
for MQL. The endpoint address and examples for making MQL requests
can be found in the next chapters.
The schema for returned data types, as well as the schema for making requests
to the MQL endpoint, are also provided. The provided schema can be used in
languages such as Go where an interface is required for unpacking the received
MQL data.
To create an API key for querying the MQL endpoint, you can head over to
the Kenshi dashboard , connect your wallet,
fill and submit the "New GraphQL + MQL API Key" form.
To fill and submit the new MQL API key form you can refer to the following manual:
- API Key : You can use the auto-generated API key, and auto-generate a new one by pressing the small "refresh" button on the field, or by generating and providing your own. The API keys are scoped, they're only valid if combined with the address of their owner. In other words, you'll need to provide your public address as well as this API key for making any requests to the MQL endpoint.
- Requests : The number of requests you're expecting to have. This amount does not expire by the passing of time, but every successful or unsuccessful call counts as one usage and decreases the remaining possible "requests" by one.
- Query limits : You can add a limit to your API keys. For example, you can define an event type or a contract address. The API endpoint then is going to throw an error if a query is made using this API key that doesn't match the query limits. This field is optional.
The MQL endpoint can return a maximum of 1024 records at a time. The maximum processing time for
each request is 5 seconds, and the maximum size of returned data is 1MB.