DappLooker Docs
  • 👋Welcome
  • Data APIs for AI
    • Overview
    • Changelog
    • API Authentication
    • API Endpoints
      • GET: Crypto Token Market Data
      • GET: List of All Tokens
      • GET: Multi-Timeframe Technical Analysis
      • GET: Agent Details
      • POST: AI-Powered Query via NLQ
    • Best Practices
    • Conclusion
  • DappLooker Analytics
    • 🗃️Products
      • 📶Analytics
        • 🔎Browse and Search data
        • 📈Creating Charts
          • No-Code Charts
          • SQL Charts
        • 🔢Custom Values
        • 📊Dashboards
          • Create Dashboard
          • Add Charts to Dashboard
          • Discover Page
          • Link dashboard to another dashboard
          • Adding Filters to Dashboard
            • Time Filter
        • ♻️Convert No-Code to SQL
        • 🔗Making Charts and Dashboards Public
      • 🔍Subgraph Analyzer
      • ✨AI Studio
        • AI Studio API Support
      • 🤖DataBOT
        • 🎮Discord Bot
        • ▶️Telegram Bot
        • 🌐Connect with Leading Networks and dApps
      • 🔑DappLooker SDK
        • 🔎Tracking API Usage
    • 🌐Supported Networks
      • Blockchain Data
      • Smart Contracts
      • Subgraphs
      • SubQuery
      • Offchain Data Sources
    • 📲Registering Data
      • My Dashboard Overview
      • Smart Contracts
      • Subgraph
      • Subquery
      • Off-Chain Integration
    • 🔖Featured Projects
    • 🎯Features
      • XRay Feature
      • Filtering
      • Summarize
      • Downloading
        • Download Chart Data
      • Editor Panel
        • Preview Chart
        • Joining Data
        • Types Of Join Data
        • Sorting
        • Row Limit
        • Convert to models
        • Duplicate a Chart
        • New Collection
      • Creating Custom Column and Custom Expressions
      • 📷Screenshot
      • 🗃️Collections
        • Browse Collection
        • Personal Collection
        • Team Collection
    • ⛓️Smart Contract Live Query
    • 🔔Push Notifications
      • 👀Where to view notifications?
      • 📰Push x MetaMask Snaps
    • 👨‍⚖️Case Studies
      • 1️⃣Community Updates
      • 2️⃣DeFi Reports
      • 3️⃣On-Chain & Off-Chain Analysis
      • 4️⃣User Retention Analysis
      • 5️⃣DappLooker Telegram Bot
      • 6️⃣Subgraph Powered No-Code Dashboards
      • 7️⃣API Use Case: Beamswap
      • 8️⃣Embedding Use Case: GRTDataHub
    • 💰Pricing
      • Pricing Breakdown
      • Discounts And Payments
    • 💻Deploy a subgraph on the DappLooker custom node
    • 🥷DappLooker No-code Ninjas Program!
    • 🤝Sponsor With Us
    • 🔗Relevant Resources
    • ☎️Contact Us
  • API Guides
    • Get API Key
    • How to Get an API of a Chart
    • Render Chart or Dashboard as an Image with API
    • Mintbase
      • Individual Store Level APIs
      • Mintbase Protocol Level APIs
    • Nordek Developer APIs
  • Explorers
    • CeloSpy
    • VaraSpy
Powered by GitBook
On this page
  • Visit AI Studio here.
  • 1. Install SDK
  • 2. Get the Details of a Project
  • 3. Query Data Using Natural Language (NLQ)
  • 4. Important Notes:

Was this helpful?

  1. DappLooker Analytics
  2. Products
  3. AI Studio

AI Studio API Support

PreviousAI StudioNextDataBOT

Last updated 6 months ago

Was this helpful?

Overview

This documentation provides details on how to use the DappLooker SDK to interact with AI Studio API. It explains how to install the SDK, retrieve schema details of projects, and query data using Natural Language Query (NLQ). The API Key is required for accessing the data securely.

Visit AI Studio .

Prerequisites:

  • You must have a valid DappLooker API Key. Sign up at or Get API key from .

  • Node.js environment installed.


1. Install SDK

You can install the DappLooker SDK in your project using npm.

npm install dapplooker-sdk

2. Get the Details of a Project

The following code retrieves the schema details of projects available in DappLooker.

import { DappLookerNlqAPI } from "dapplooker-sdk";

// Function to get schema details
async function getSchemaDetails(): Promise<any> {
  let response = await DappLookerNlqAPI.getSchemaName("");
  console.log("API Response Data: ", JSON.stringify(response));
};

getSchemaDetails();

Sample Response:

{
   "success": true,
   "data": {
      "projects": [
         {
            "projectName": "Aave V3 Ethereum",
            "schemaName": "aave_v3_ethereum",
            "networkName": "MAINNET"
         },
         {
            "projectName": "Gooddollar Celo",
            "schemaName": "gooddollar_celo",
            "networkName": "OFFCHAIN"
         }
         // More projects...
      ]
   }
}

This response provides the projectName, schemaName, and the networkName for different projects that are supported by DappLooker.


3. Query Data Using Natural Language (NLQ)

DappLooker supports querying data using simple natural language queries. You will need to pass your API Key and the query string to retrieve data.

import { DappLookerNlqAPI } from "dapplooker-sdk";

// Function to get data using NLQ
async function getNlqData(): Promise<any> {
  let apiKey = "YOUR_DAPPLOOKER_API_KEY";  // Replace with your API key
  let response = await DappLookerNlqAPI.getNlqData(apiKey, 'What is the current gas price per hour on the Ethereum network?', 'ethereum');
  console.log("API Response Data: ", JSON.stringify(response));
};

getNlqData();

Sample Response:

{
  "success": true,
  "data": {
    "msg": "Visualization Result",
    "vizualizationData": {
      "rows": [
        ["<timestamp>", "<average_value>", "<low_value>"]
        // More rows...
      ],
      "cols": [
        {
          "display_name": "Hour",
          "source": "native",
          "name": "Hour",
          "base_type": "type/DateTime",
          "effective_type": "type/DateTime"
        }
        // More columns...
      ],
      "native_form": {
        "query": "<SQL_QUERY>",
        "params": null
      },
      "results_timezone": "GMT",
      "results_metadata": {
        "columns": [
          {
            "display_name": "Hour",
            "name": "Hour",
            "base_type": "type/DateTime",
            "effective_type": "type/DateTime"
          }
          // More metadata...
        ]
      }
    },
    "questionId": "<question_id>",
    "answerId": "<answer_id>",
    "entityId": "<entity_id>",
    "entityType": "CHART"
  },
  "nlqLogId": "<nlq_log_id>"
}

This response contains the visualized data with columns such as Hour, average_value, and low_value. Additionally, it includes metadata such as the query used and the time zone.


4. Important Notes:

  • Always ensure your API Key is securely stored and not hardcoded in production environments.

  • Modify NLQ queries according to your data needs, and you can interact with multiple blockchain networks and schemas through the SDK.

🗃️
✨
here
DappLooker
here