Skip to main content
On this page you can find examples for Node.js , Python and Go languages.
import axios from "axios";

/**
 * This is the Kenshi Deep Index endpoint for MQL
 */
const endpoint = "https://api.kenshi.io/index/mql";
const apikey = "YOUR_API_KEY";
const owner = "YOUR_WALLET_ADDRESS";

/**
 * Define your MQL request here
 */
const request = {
  blockchain: "binance-mainnet",
  owner,
  apikey,
  query: {
    "event.name": "Transfer",
    "block.number": { $gte: 20740000 },
  },
};

/**
 * Post request sending the MQL request to the
 * Kenshi Deep Index endpoint, receive the data and print
 */
const data = await axios.post(endpoint, request);
console.log(data);
import fetch from "node-fetch";

/**
 * This is the Kenshi Deep Index endpoint for MQL
 */
const endpoint = "https://api.kenshi.io/index/mql";
const apikey = "YOUR_API_KEY";
const owner = "YOUR_WALLET_ADDRESS";

/**
 * Define your MQL request here
 */
const request = {
  blockchain: "binance-mainnet",
  owner,
  apikey,
  query: {
    "event.name": "Transfer",
    "block.number": { $gte: 20740000 },
  },
};

/**
 * Post request sending the MQL request to the
 * Kenshi Deep Index endpoint
 */
const response = await fetch(endpoint, {
  method: "POST",
  body: JSON.stringify(request),
});

/**
 * Receive the data and print it
 */
const data = await response.json();
console.log(data);
import requests

# This is the Kenshi Deep Index endpoint for MQL
endpoint = "https://api.kenshi.io/index/mql"

# Define your MQL query here
request = {
    "blockchain": "binance-mainnet",
    "owner": "YOUR_WALLET_ADDRESS",
    "apikey": "YOUR_API_KEY",
    "query": {
        "event.name": "Transfer",
        "block.number": {"$gte": 20740000},
    },
}

# Post request sending the MQL request to the
# Kenshi Deep Index endpoint
response = requests.post(endpoint, json=request)

# Receive the data and print it
data = response.json()
print(data)
package main

import (
  "bytes"
  "fmt"
  "io/ioutil"
  "net/http"
)

func main() {
  /**
   * This is the Kenshi Deep Index endpoint for MQL
   */
  endpoint := "https://api.kenshi.io/index/mql"

  /**
   * Define your MQL request here
   */
  var mql = []byte(`{
        "blockchain": "binance-mainnet",
        "owner": "YOUR_WALLET_ADDRESS",
        "apikey": "YOUR_API_KEY",
        "query": {
          "event.name": "Transfer",
          "block.number": {
            "$gte": 20740000
          }
        }
      }`)

  /**
   * Post request sending the MQL request to the
   * Kenshi Deep Index endpoint, receive the data and print
   */
  req, err := http.NewRequest("POST", endpoint, bytes.NewBuffer(mql))
  req.Header.Set("Content-Type", "application/json; charset=UTF-8")

  client := &http.Client{}
  resp, err := client.Do(req)

  if err != nil {
    panic(err)
  }

  defer resp.Body.Close()
  body, _ := ioutil.ReadAll(resp.Body)
  fmt.Println(string(body))
}
On this page