With the continuous advancement of AI technology, the convenience of data processing and usage has been significantly enhanced. This guide aims to lead readers to explore how to leverage advanced AI tools to delve deeper into and analyze on-chain data. We will focus on how to integrate ChatGPT with Chainbase API to achieve efficient data retrieval, visualization, and in-depth analysis.
Most of you are probably familiar with ChatGPT. This technology has evolved to its 4.0 version, supporting a plethora of plugins with ever-expanding functionalities. In this guide, our spotlight will be on the Noteable plugin. Not only is Noteable a powerful tool for data processing and analysis, but its integration with ChatGPT also allows us to directly converse with AI, articulate our needs, and let AI efficiently carry out the tasks for us.
Note: You must upgrade to ChatGPT Plus to access the plugin features.
Setting Up ChatGPT's Noteable Plugin
Without further ado, let's dive into the hands-on section.
First and foremost, to experience the magic of the Noteable plugin, you need to activate it within ChatGPT Plus. For the specific activation steps, please refer to Get Started With the Plugin. To help you get started quickly, the link also includes practical examples of interacting with AI.
Now, we move on to the core content of this guide: how to use the Noteable plugin in ChatGPT to call the Chainbase API. You can choose to use the standard API provided by Chainbase or customize your API based on Chainbase on third-party platforms. To provide an intuitive experience, we will demonstrate using Chainbase's basic API "Get transactions by account" as an example.
(API from Chainbase documents)
Integrating Chainbase API with ChatGPT
For security and privacy reasons, ChatGPT cannot directly execute code related to external API calls. However, we can leverage the Noteable plugin to create a notebook to run such code. In this case, I chose to use the Python language for the operation.
# **Get transactions by account**
import requests
url = "https://api.chainbase.online/v1/account/txs?chain_id=1&address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&page=1&limit=20"
headers = {
"accept": "application/json",
"x-api-key": "demo"
}
response = requests.get(url, headers=headers)
print(response.text)
Here's how I converse with ChatGPT to import data.
Note: Noteable only accept a few language:
If you input code in a language other than Python, such as Java, the result will be empty in Noteable. However, don't worry about it, ChatGPT can assist you by converting and executing the task using Python code to fetch the data.
Upon opening the link, you'll see what has been done for you in Noteable.
Analyzing Data with ChatGPT and Noteable
After you've uploaded the data, you can request ChatGPT to perform additional analysis.
For instance, you might say: 'Could you execute a notebook to analyze the data above and provide charts and graphs as well as a description of trends and so on to help me understand what I can get from the data?'
In my experience, it not only offered data insights but also executed tasks as displayed in Noteable.
The graph will be updated in the Noteable you previously accessed, as shown here:
Naturally, you have the option to conduct more in-depth analysis or specify more detailed requests.
You can even modify the address information I provided initially and ask specific information. It's truly intelligent!
The above are just some basic operations. Next, based on your needs, you can unleash your imagination and delve into how to leverage the Noteable plugin in ChatGPT to call APIs and conduct data analysis.
Happy coding!
About Chainbase
Chainbase is an all-in-one data infrastructure for Web3 that allows you to index, transform, and use on-chain data at scale. By leveraging enriched on-chain data and streaming computing technologies across one data infrastructure, Chainbase automates the indexing and querying of blockchain data, enabling developers to accomplish more with less effort.
Want to learn more about Chainbase?
Visit our website chainbase.com Sign up for a free account, and Check out our documentation.
Website|Blog|Twitter|Discord|Link3