dnapi

Crates.iodnapi
lib.rsdnapi
version0.1.1
created_at2026-01-17 12:47:30.796337+00
updated_at2026-01-22 21:40:30.620711+00
descriptionUnofficial Rust client for the Dune Analytics API (dnapi)
homepage
repositoryhttps://github.com/yldfi/yldfi-rs/tree/main/crates/dnapi
max_upload_size
id2050396
size111,286
michaeldim (michaeldim)

documentation

README

yld_fi

dune-api

Unofficial Rust client for the Dune Analytics API

crates.io MIT License

Features

  • Queries - Create, read, update, archive/unarchive queries
  • Executions - Execute queries, run raw SQL, get results
  • Tables - Manage custom tables, upload/insert data
  • Materialized Views - Create and manage materialized views
  • Pipelines - Set up data pipelines
  • Usage - Get API usage statistics

Installation

[dependencies]
dnapi = "0.1"
tokio = { version = "1", features = ["full"] }

Quick Start

use dnapi::Client;

#[tokio::main]
async fn main() -> Result<(), dnapi::Error> {
    let client = Client::new("your-api-key")?;

    // Execute a query and wait for results
    let result = client.executions().run_query(1234, None).await?;
    for row in result.result.unwrap().rows {
        println!("{:?}", row);
    }

    // Execute raw SQL
    let result = client.executions().run_sql("SELECT 1 as value", None).await?;
    println!("{:?}", result.result);

    // Get cached results for a query
    let result = client.executions().query_results(1234).await?;
    println!("{:?}", result.result);

    Ok(())
}

Environment Variables

  • DUNE_API_KEY - Your Dune API key (required)

License

MIT

Commit count: 46

cargo fmt