back to top

Analyzing the Top 10 Ethereum NFTs Using the Dune API: A Comprehensive Guide

DeFi Pulse – June 2024


Full‑stack guide shows how to extract, analyse and visualise the top‑10 Ethereum NFT collections with Dune Analytics

A new step‑by‑step tutorial released on the Dune blog demonstrates how developers and analysts can tap the Dune API to pull real‑time on‑chain data for the most heavily traded Ethereum NFTs, rank the collections by volume and turn the numbers into ready‑to‑publish charts. The guide, authored by Dune community member Toufik Bahammou, combines a custom SQL query, a lightweight Python script and a handful of common data‑science libraries (pandas, seaborn and matplotlib) to deliver a reproducible workflow for anyone with a Dune account and a basic Python environment.

Below is a condensed overview of the methodology, the key insights the author uncovered for the period 1 Jan – 29 Mar 2024, and the practical take‑aways for DeFi and NFT analysts.


1. Why Dune?

Dune Analytics is a SaaS platform that indexes Ethereum‑derived data and exposes it through an SQL‑compatible query engine. By writing a query against Dune’s curated tables (e.g., nft.trades) users can retrieve granular transaction details—timestamp, price in ETH, converted USD value, contract address, and more—without running a full node. The platform also provides an API that returns query results in JSON, making it straightforward to pull data into external scripts.


2. Building the data pipeline

Step What the guide does Tools used
Preparation Install required Python packages (dune-client, python‑dotenv, pandas, seaborn, matplotlib). Store the Dune API key in a .env file. pip, dotenv
SQL query design Write a SELECT that aggregates nft.trades by collection name, counting sales and summing both ETH and USD volumes. Filters exclude non‑standard sellers and apply a user‑defined date window (Start_Date, End_Date). Results are ordered descending by volume. Dune SQL editor
Saving & executing Save the query in Dune, generate a Python code snippet through the “API” button, and note the query ID. Dune UI
Python client Initialise DuneClient with the API key, call client.run_query(query_id, params) to fetch the aggregated data, and load it into a pandas DataFrame. dune-client
User interaction Prompt the user for the start‑ and end‑date (validated for format and logical order). input()
Visualization Produce two horizontal bar charts—one for USD volume, the other for ETH volume—using seaborn’s barplot and matplotlib’s figure layout. The charts display the top‑10 collections as ranked by each metric. seaborn, matplotlib

All the code is hosted on GitHub (https://github.com/Toufik‑BHM/Top-10-Ethereum-NFTs-with-Dune-Analytics-API) for quick cloning.


3. What the data revealed

Running the workflow for the 89‑day window (Jan 1 – Mar 29 2024) generated the following observations:

  • Bored Ape Yacht Club (BAYC) topped both the ETH‑volume and USD‑volume rankings, underscoring its continued dominance in the high‑end NFT market.
  • Collections such as LilPudgys and Milady ranked higher when measured by USD volume than by ETH volume. This divergence suggests either a temporary price premium in USD terms (perhaps driven by speculative buying) or a surge in activity that coincided with a dip in ETH price.
  • The top‑10 list displayed a relatively balanced mix of legacy projects (e.g., BAYC, CryptoPunks) and newer entrants that have benefited from recent hype cycles, indicating a diversified market rather than a single‑player monopoly.
  • The disparity between ETH‑ and USD‑rankings signals that exchange‑rate fluctuations still play a material role in assessing NFT market health. Analysts focusing solely on one metric could misinterpret underlying demand.

4. Analytical takeaways

  1. SQL on‑chain data is now as accessible as any off‑chain API – The ability to write a query straight against Dune’s tables means that analysts can bypass third‑party aggregators and verify figures themselves.
  2. Pairing on‑chain data with familiar Python libraries lowers the barrier to entry – The tutorial shows that a data‑science skill set (pandas, seaborn) is sufficient to produce publication‑ready visualisations, without needing bespoke blockchain tooling.
  3. Dual‑currency ranking is essential – Because NFT prices are denominated in ETH but valued in USD, tracking both dimensions provides a clearer picture of market dynamics, especially during periods of high ETH volatility.
  4. Reproducibility – By storing the query ID and parameterising the date range, the workflow can be scheduled (e.g., via a CI pipeline) to generate regular market snapshots for newsletters, dashboards, or investment theses.
  5. Open‑source community contribution – The guide’s public repository invites forks and extensions, such as adding floor‑price data, integrating other chains (Polygon, Arbitrum) or enriching the visual output with interactive Plotly charts.

5. How to get started

  1. Create a Dune account and request an API key from the “API” section of the dashboard.
  2. Clone the GitHub repo and install dependencies (pip install dune-client python-dotenv seaborn matplotlib pandas).
  3. Create a new query in Dune using the supplied SQL template; adjust the date parameters as needed.
  4. Run the Python script (python src/script.py). Provide the start and end dates when prompted.
  5. Review the generated charts—they can be saved as PNGs or embedded directly into reports.

For a deeper dive into the SQL syntax and Dune’s data catalog, consult the official documentation at docs.dune.com.


6. Outlook

As NFTs continue to evolve, the demand for transparent, on‑chain analytics grows in tandem. Tools like Dune, combined with the simplicity of Python data‑science stacks, are poised to become the backbone of many DeFi research workflows. The guide by Bahammou not only demystifies the technical steps but also delivers a template that can be repurposed for other tokenised assets—gaming items, metaverse parcels, or even decentralized finance positions.

Key takeaway: With a few lines of SQL and a short Python script, analysts can reliably surface the most active NFT collections, monitor shifts in market liquidity, and produce actionable visual insights—all without leaving the comfort of a standard data‑science environment.


Prepared by the DeFi Pulse editorial team. For the full tutorial and source code, visit the Dune blog post “Complete Guide: Analyzing the Top 10 Ethereum NFTs Using Dune API.”



Source: https://dune.com/blog/complete-guide-analyzing-the-top-10-ethereum-nfts-using-dune-api

spot_img

More from this stream

Recomended