{
  "schemaVersion": "1.0",
  "item": {
    "slug": "dune-analytics-api",
    "name": "Dune Analytics Api",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/LZ-Web3/dune-analytics-api",
    "canonicalUrl": "https://clawhub.ai/LZ-Web3/dune-analytics-api",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/dune-analytics-api",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=dune-analytics-api",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "evals/evals.json",
      "references/common-tables.md",
      "references/data-upload.md",
      "references/query-execution.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "dune-analytics-api",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T18:09:08.590Z",
      "expiresAt": "2026-05-09T18:09:08.590Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=dune-analytics-api",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=dune-analytics-api",
        "contentDisposition": "attachment; filename=\"dune-analytics-api-2.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "dune-analytics-api"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/dune-analytics-api"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/dune-analytics-api",
    "agentPageUrl": "https://openagent3.xyz/skills/dune-analytics-api/agent",
    "manifestUrl": "https://openagent3.xyz/skills/dune-analytics-api/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/dune-analytics-api/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Dune Analytics API",
        "body": "A skill for querying and analyzing blockchain data via the Dune Analytics API."
      },
      {
        "title": "Setup",
        "body": "pip install dune-client\n\nSet DUNE_API_KEY via environment variable, .env file, or agent config."
      },
      {
        "title": "Best Practices",
        "body": "Read references first — The reference files contain critical table names, anti-patterns, and chain-specific gotchas that aren't obvious from table names alone. Reading the right reference before writing SQL prevents common mistakes like using dex.trades for wallet analysis (which inflates volume ~30%) or missing Solana's dedup requirement.\n\n\nPrefer private queries — Creating queries with is_private=True keeps the user's workspace clean and avoids polluting the public Dune namespace. Fall back to public if it fails (free plan limitation), and let the user know.\n\n\nReuse before creating — Dune charges credits per execution. Reusing or updating an existing query avoids unnecessary duplicates and makes credit tracking easier. Only create new queries when the user explicitly asks.\n\n\nConfirm before updating — Modifying an existing query's SQL is destructive (previous version isn't saved by default). A quick confirmation avoids overwriting work the user might want to keep.\n\n\nTrack credits — Each execution costs credits depending on the performance tier and data scanned. Reporting credits consumed helps the user manage their budget. See query-execution.md."
      },
      {
        "title": "Scripts — Common Operations",
        "body": "For common operations, use the scripts in scripts/ to avoid writing boilerplate code every time. All scripts read DUNE_API_KEY from the environment automatically.\n\nScriptCommandWhat it doesdune_query.pyexecute --query-id IDExecute a saved query (supports --params, --performance, --format)dune_query.pyget_latest --query-id IDGet cached result without re-executiondune_query.pyget_sql --query-id IDPrint query SQLdune_query.pyupdate_sql --query-id ID --sql \"...\"Update query SQLdune_discover.pysearch --keyword \"uniswap\"Search tables by keyworddune_discover.pyschema --table \"dex.trades\"Show table columns and typesdune_discover.pylist_schemas --namespace \"uniswap_v3\"List tables in a namespacedune_discover.pycontract --address \"0x...\"Find decoded tables by contract addressdune_discover.pydocs --keyword \"dex\"Search Dune documentationdune_upload.pyupload_csv --file data.csv --table-name tblQuick CSV upload (overwrites)dune_upload.pycreate_table --table-name tbl --namespace ns --schema '[...]'Create table with explicit schemadune_upload.pyinsert --file data.csv --table-name tbl --namespace nsAppend data to existing table\n\nExample:\n\n# Execute query with parameters\npython scripts/dune_query.py execute --query-id 123456 --params '{\"token\":\"ETH\"}' --format table\n\n# Upload a CSV privately\npython scripts/dune_upload.py upload_csv --file wallets.csv --table-name my_wallets --private"
      },
      {
        "title": "Reference Selection",
        "body": "Before writing any SQL, route to the correct reference file(s) based on your task:\n\nTask involves...Read this referenceFinding tables / inspecting schema / discovering protocolstable-discovery.mdFinding decoded tables by contract addresstable-discovery.mdSearching Dune documentation / guides / examplestable-discovery.mdWallet / address tracking / router identificationwallet-analysis.mdTable selection / common table namescommon-tables.mdSQL performance / complex joins / array opssql-optimization.mdAPI calls / execution / caching / parametersquery-execution.mdUploading CSV/NDJSON data to Dunedata-upload.md\n\nIf your task spans multiple categories, read all relevant files. The references contain critical details (e.g., specialized tables, anti-patterns) that aren't covered in this overview — guessing table names or query patterns leads to subtle bugs."
      },
      {
        "title": "Quick Start",
        "body": "from dune_client.client import DuneClient\nfrom dune_client.query import QueryBase\nimport os\n\nclient = DuneClient(api_key=os.environ['DUNE_API_KEY'])\n\n# Execute a query\nresult = client.run_query(query=QueryBase(query_id=123456), performance='medium', ping_frequency=5)\nprint(f\"Rows: {len(result.result.rows)}\")\n\n# Get cached result (no re-execution)\nresult = client.get_latest_result(query_id=123456)\n\n# Get/update SQL\nsql = client.get_query(123456).sql\nclient.update_query(query_id=123456, query_sql=\"SELECT ...\")\n\n# Upload CSV data (quick, overwrites existing)\nclient.upload_csv(\n    data=\"col1,col2\\nval1,val2\",\n    description=\"My data\",\n    table_name=\"my_table\",\n    is_private=True\n)\n\n# Create table + insert (supports append)\nclient.create_table(\n    namespace=\"my_user\",\n    table_name=\"my_table\",\n    schema=[{\"name\": \"col1\", \"type\": \"varchar\"}, {\"name\": \"col2\", \"type\": \"double\"}],\n    is_private=True\n)\nimport io\nclient.insert_data(\n    namespace=\"my_user\",\n    table_name=\"my_table\",\n    data=io.BytesIO(b\"col1,col2\\nabc,1.5\"),\n    content_type=\"text/csv\"\n)"
      },
      {
        "title": "Subscription Tiers",
        "body": "MethodDescriptionPlanrun_queryExecute saved query (supports {{param}})Freerun_sqlExecute SQL directly (no params)Plus"
      },
      {
        "title": "dex.trades vs dex_aggregator.trades",
        "body": "TableUse CaseVolumedex.tradesPer-pool analysis⚠️ Inflated ~30% (multi-hop counted multiple times)dex_aggregator.tradesUser/wallet analysisAccurate\n\nWhy this matters: If you're analyzing a specific wallet's trading activity and use dex.trades, you'll see inflated volume because a single swap through an aggregator gets split into multiple pool-level trades. dex_aggregator.trades captures the user-level intent — one row per user swap. See wallet-analysis.md for full patterns.\n\nSolana has no dex_aggregator_solana.trades. Dedupe by tx_id:\n\nSELECT tx_id, MAX(amount_usd) as amount_usd\nFROM dex_solana.trades\nGROUP BY tx_id"
      },
      {
        "title": "Data Freshness",
        "body": "LayerDelayExampleRaw< 1 minethereum.transactions, solana.transactionsDecoded15-60 secuniswap_v3_ethereum.evt_SwapCurated~1 hour+dex.trades, dex_solana.trades\n\nQuery previous day's data after UTC 12:00 for completeness."
      },
      {
        "title": "References",
        "body": "Detailed documentation is organized in the references/ directory:\n\nFileDescriptiontable-discovery.mdTable discovery: search tables by name, inspect schema/columns, list schemas and uploadsquery-execution.mdAPI patterns: execute, update, cache, multi-day fetch, credits tracking, subqueriescommon-tables.mdQuick reference of commonly used tables: raw, decoded, curated, community datasql-optimization.mdSQL optimization: CTE, JOIN strategies, array ops, partition pruningwallet-analysis.mdWallet tracking: Solana/EVM queries, multi-chain aggregation, fee analysisdata-upload.mdData upload: CSV/NDJSON upload, create table, insert data, manage tables, credits"
      }
    ],
    "body": "Dune Analytics API\n\nA skill for querying and analyzing blockchain data via the Dune Analytics API.\n\nSetup\npip install dune-client\n\n\nSet DUNE_API_KEY via environment variable, .env file, or agent config.\n\nBest Practices\n\nRead references first — The reference files contain critical table names, anti-patterns, and chain-specific gotchas that aren't obvious from table names alone. Reading the right reference before writing SQL prevents common mistakes like using dex.trades for wallet analysis (which inflates volume ~30%) or missing Solana's dedup requirement.\n\nPrefer private queries — Creating queries with is_private=True keeps the user's workspace clean and avoids polluting the public Dune namespace. Fall back to public if it fails (free plan limitation), and let the user know.\n\nReuse before creating — Dune charges credits per execution. Reusing or updating an existing query avoids unnecessary duplicates and makes credit tracking easier. Only create new queries when the user explicitly asks.\n\nConfirm before updating — Modifying an existing query's SQL is destructive (previous version isn't saved by default). A quick confirmation avoids overwriting work the user might want to keep.\n\nTrack credits — Each execution costs credits depending on the performance tier and data scanned. Reporting credits consumed helps the user manage their budget. See query-execution.md.\n\nScripts — Common Operations\n\nFor common operations, use the scripts in scripts/ to avoid writing boilerplate code every time. All scripts read DUNE_API_KEY from the environment automatically.\n\nScript\tCommand\tWhat it does\ndune_query.py\texecute --query-id ID\tExecute a saved query (supports --params, --performance, --format)\ndune_query.py\tget_latest --query-id ID\tGet cached result without re-execution\ndune_query.py\tget_sql --query-id ID\tPrint query SQL\ndune_query.py\tupdate_sql --query-id ID --sql \"...\"\tUpdate query SQL\ndune_discover.py\tsearch --keyword \"uniswap\"\tSearch tables by keyword\ndune_discover.py\tschema --table \"dex.trades\"\tShow table columns and types\ndune_discover.py\tlist_schemas --namespace \"uniswap_v3\"\tList tables in a namespace\ndune_discover.py\tcontract --address \"0x...\"\tFind decoded tables by contract address\ndune_discover.py\tdocs --keyword \"dex\"\tSearch Dune documentation\ndune_upload.py\tupload_csv --file data.csv --table-name tbl\tQuick CSV upload (overwrites)\ndune_upload.py\tcreate_table --table-name tbl --namespace ns --schema '[...]'\tCreate table with explicit schema\ndune_upload.py\tinsert --file data.csv --table-name tbl --namespace ns\tAppend data to existing table\n\nExample:\n\n# Execute query with parameters\npython scripts/dune_query.py execute --query-id 123456 --params '{\"token\":\"ETH\"}' --format table\n\n# Upload a CSV privately\npython scripts/dune_upload.py upload_csv --file wallets.csv --table-name my_wallets --private\n\nReference Selection\n\nBefore writing any SQL, route to the correct reference file(s) based on your task:\n\nTask involves...\tRead this reference\nFinding tables / inspecting schema / discovering protocols\ttable-discovery.md\nFinding decoded tables by contract address\ttable-discovery.md\nSearching Dune documentation / guides / examples\ttable-discovery.md\nWallet / address tracking / router identification\twallet-analysis.md\nTable selection / common table names\tcommon-tables.md\nSQL performance / complex joins / array ops\tsql-optimization.md\nAPI calls / execution / caching / parameters\tquery-execution.md\nUploading CSV/NDJSON data to Dune\tdata-upload.md\n\nIf your task spans multiple categories, read all relevant files. The references contain critical details (e.g., specialized tables, anti-patterns) that aren't covered in this overview — guessing table names or query patterns leads to subtle bugs.\n\nQuick Start\nfrom dune_client.client import DuneClient\nfrom dune_client.query import QueryBase\nimport os\n\nclient = DuneClient(api_key=os.environ['DUNE_API_KEY'])\n\n# Execute a query\nresult = client.run_query(query=QueryBase(query_id=123456), performance='medium', ping_frequency=5)\nprint(f\"Rows: {len(result.result.rows)}\")\n\n# Get cached result (no re-execution)\nresult = client.get_latest_result(query_id=123456)\n\n# Get/update SQL\nsql = client.get_query(123456).sql\nclient.update_query(query_id=123456, query_sql=\"SELECT ...\")\n\n# Upload CSV data (quick, overwrites existing)\nclient.upload_csv(\n    data=\"col1,col2\\nval1,val2\",\n    description=\"My data\",\n    table_name=\"my_table\",\n    is_private=True\n)\n\n# Create table + insert (supports append)\nclient.create_table(\n    namespace=\"my_user\",\n    table_name=\"my_table\",\n    schema=[{\"name\": \"col1\", \"type\": \"varchar\"}, {\"name\": \"col2\", \"type\": \"double\"}],\n    is_private=True\n)\nimport io\nclient.insert_data(\n    namespace=\"my_user\",\n    table_name=\"my_table\",\n    data=io.BytesIO(b\"col1,col2\\nabc,1.5\"),\n    content_type=\"text/csv\"\n)\n\nSubscription Tiers\nMethod\tDescription\tPlan\nrun_query\tExecute saved query (supports {{param}})\tFree\nrun_sql\tExecute SQL directly (no params)\tPlus\nKey Concepts\ndex.trades vs dex_aggregator.trades\nTable\tUse Case\tVolume\ndex.trades\tPer-pool analysis\t⚠️ Inflated ~30% (multi-hop counted multiple times)\ndex_aggregator.trades\tUser/wallet analysis\tAccurate\n\nWhy this matters: If you're analyzing a specific wallet's trading activity and use dex.trades, you'll see inflated volume because a single swap through an aggregator gets split into multiple pool-level trades. dex_aggregator.trades captures the user-level intent — one row per user swap. See wallet-analysis.md for full patterns.\n\nSolana has no dex_aggregator_solana.trades. Dedupe by tx_id:\n\nSELECT tx_id, MAX(amount_usd) as amount_usd\nFROM dex_solana.trades\nGROUP BY tx_id\n\nData Freshness\nLayer\tDelay\tExample\nRaw\t< 1 min\tethereum.transactions, solana.transactions\nDecoded\t15-60 sec\tuniswap_v3_ethereum.evt_Swap\nCurated\t~1 hour+\tdex.trades, dex_solana.trades\n\nQuery previous day's data after UTC 12:00 for completeness.\n\nReferences\n\nDetailed documentation is organized in the references/ directory:\n\nFile\tDescription\ntable-discovery.md\tTable discovery: search tables by name, inspect schema/columns, list schemas and uploads\nquery-execution.md\tAPI patterns: execute, update, cache, multi-day fetch, credits tracking, subqueries\ncommon-tables.md\tQuick reference of commonly used tables: raw, decoded, curated, community data\nsql-optimization.md\tSQL optimization: CTE, JOIN strategies, array ops, partition pruning\nwallet-analysis.md\tWallet tracking: Solana/EVM queries, multi-chain aggregation, fee analysis\ndata-upload.md\tData upload: CSV/NDJSON upload, create table, insert data, manage tables, credits"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/LZ-Web3/dune-analytics-api",
    "publisherUrl": "https://clawhub.ai/LZ-Web3/dune-analytics-api",
    "owner": "LZ-Web3",
    "version": "2.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/dune-analytics-api",
    "downloadUrl": "https://openagent3.xyz/downloads/dune-analytics-api",
    "agentUrl": "https://openagent3.xyz/skills/dune-analytics-api/agent",
    "manifestUrl": "https://openagent3.xyz/skills/dune-analytics-api/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/dune-analytics-api/agent.md"
  }
}