KNN3 Network Docs
KNN3 DOC
KNN3 DOC
  • 🚩KNN3 Network
  • 🔦Products Tour
    • TopScore
    • MashMesh
  • 🛠️K.Transformer
    • 🔑Get Started
    • 💡Real-time Data Service
      • K.GraphX (Legacy)
        • GraphX API Quick Start
        • Categories
          • Possession
          • Bond
          • Attendance
          • Governance
          • Lens
        • K.GraphX Extension: Dynamic Verifiable Credentials
      • KNN3 API
      • KNN3 SDK
      • Arseeding GraphQL
    • ⚙️Lambda-style Workflow
      • A Conversational On-Chain Data Query Constructor
      • KNN3 SQL
      • Customized SDK-JAVA
  • 🏡KNN3 Data Fundamentals
    • KNN3 Data Warehouse
  • 🌏Product Roadmap
  • 👾Learn More
Powered by GitBook
On this page
  • Introduction
  • Start with your first query
  • Limit
  • Aggregate Query
  1. K.Transformer
  2. Real-time Data Service
  3. K.GraphX (Legacy)

GraphX API Quick Start

GraphX: a real-time and flexible Web3 relationship graph network designed for graph-based queries

PreviousK.GraphX (Legacy)NextCategories

Last updated 2 years ago

Introduction

KNN3 Network is a one-stop Web3 User-centric DataFi solution for d/Apps and smart contracts. KNN3 allows d/Apps & smart contracts to interact with cross-platform user-centric data in multiple algo-friendly ways.

If you are a Web3 d/App builder or a web3-native data analyst, GraphX is something you should look into. GraphX contains plenty of relational data among users, assets & communities, these relationships are fully backed by web3 users' live on-chain activities.

Graphql Endpoint:

Please note that the address must be in lowercase, otherwise the correct result will not be returned.

Start with your first query

A sample query to explore NFTs held by a given address.

Sample code

query {
  addrs(where:{address:"0xae89ad222e67205e8d947f131fdc9fa139828745"}) {
    address
    holdNfts {
      contract
      imageUrl
      symbol
    }
  }
}

The following result only shows a fragment of NFTs. To see the complete data result, you can visit the link above and try it yourself.

{
  "data": {
    "addrs": [
      {
        "address": "0xae89ad222e67205e8d947f131fdc9fa139828745",
        "holdnfts": [
          {
            "contract": "0x5c400511fb292a50b4d81e601815f617db804302",
            "imageUrl": "https://knn3-static-logo.s3.us-west-1.amazonaws.com/contract/0x5c400511fb292a50b4D81e601815f617DB804302/logo.gif",
            "symbol": "SFGG"
          },
          {
            "contract": "0xc7bda35c92aabcc129379d18024a32f6bae5faca",
            "imageUrl": "https://knn3-static-logo.s3.us-west-1.amazonaws.com/contract/0xc7Bda35c92aabcC129379d18024A32F6bAE5FaCA/logo.gif",
            "symbol": "GAME"
          },
          {
            "contract": "0xafc156b83295aa31ad7ac420b5ab0aa2ac39741c",
            "imageUrl": "https://knn3-static-logo.s3.us-west-1.amazonaws.com/contract/0xaFc156B83295Aa31Ad7AC420B5AB0AA2ac39741c/logo.gif",
            "symbol": "DOGGY"
          },
          ...
        ]
      }
    ]
  }
}

Limit

To help manage the sheer volume of the requests we receive on our api, limits are placed on the number of requests that can be made. These limits help us provide the reliable and scalable API that our developer community relies on.

For a better user experience, there is a limit=10 for each query by default. You can modify this parameter to a maximum of 30 items for each query.

Pagination

Like most GraphQL queries, you can specify pagination queries through the options parameter:

query {
  addrs(options:{limit:30,offset:30}){
    address
    ens
  }
}

Aggregate Query

You can use aggregate queries in the form of xxxAggregate to obtain the likes of count data. See below for an example where the total number of addresses is queried.

query {
  addrsAggregate{
    count
  }
}

If you require a higher limit, please contact us at and we will be happy to assist you.

🛠️
💡
https://master.graphql.knn3.xyz/graphql
Try Yourself
builder@knn3.xyz
Try Yourself
Try Yourself