
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@duneanalytics/client-sdk
Advanced tools
This NPM package implements all the basic routes defined in the Dune API Docs. It also introduces a convenience method refresh which combines executeQuery, getExecutionStatus and gettExecutionResults in a way that makes it nearly trivial to fetch query execution results.
Install the package
yarn add @duneanalytics/client-sdk
import { QueryParameter, DuneClient, RunQueryArgs } from "@duneanalytics/client-sdk";
const { DUNE_API_KEY } = process.env;
const client = new DuneClient(DUNE_API_KEY ?? "");
const queryId = 1215383;
const opts: RunQueryArgs = {
queryId,
query_parameters: [
QueryParameter.text("TextField", "Plain Text"),
QueryParameter.number("NumberField", 3.1415926535),
QueryParameter.date("DateField", "2022-05-04 00:00:00"),
QueryParameter.enum("ListField", "Option 1"),
],
};
client
.runQuery(opts)
.then((executionResult) => console.log(executionResult.result?.rows));
// should look like
// [
// {
// date_field: "2022-05-04 00:00:00.000",
// list_field: "Option 1",
// number_field: "3.1415926535",
// text_field: "Plain Text",
// },
// ]
const { DUNE_API_KEY } = process.env;
const client = new DuneClient(DUNE_API_KEY ?? "");
const results = await client.custom.getResults({
username: "your_username",
slug: "endpoint-slug"
// optional arguments: see `GetResultParams`
limit: 100,
});
Note also that the client has methods executeQuery, getExecutionStatus, getExecutionResult and cancelExecution
Check out this Demo Project!
FAQs
Node Client for Dune Analytics' officially supported API.
We found that @duneanalytics/client-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.