{"id":28561271,"url":"https://github.com/duneanalytics/ts-dune-client","last_synced_at":"2025-06-10T10:42:06.375Z","repository":{"id":60826673,"uuid":"543780667","full_name":"duneanalytics/ts-dune-client","owner":"duneanalytics","description":"TS Client for Dune Analytics' officially supported API.","archived":false,"fork":false,"pushed_at":"2025-02-19T19:52:53.000Z","size":238,"stargazers_count":39,"open_issues_count":6,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-27T14:04:19.819Z","etag":null,"topics":["api-client","dune-analytics","nodejs","ts"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duneanalytics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-30T20:34:46.000Z","updated_at":"2025-03-20T10:31:58.000Z","dependencies_parsed_at":"2024-03-08T10:44:37.040Z","dependency_job_id":"c7d0a01b-39ce-484c-9166-fd064d30a74d","html_url":"https://github.com/duneanalytics/ts-dune-client","commit_stats":{"total_commits":75,"total_committers":4,"mean_commits":18.75,"dds":0.28,"last_synced_commit":"ffb64108fb5b3ec34d9122182f653440470d5924"},"previous_names":["cowprotocol/ts-dune-client","duneanalytics/ts-dune-client","bh2smith/ts-dune-client"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fts-dune-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fts-dune-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fts-dune-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fts-dune-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duneanalytics","download_url":"https://codeload.github.com/duneanalytics/ts-dune-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duneanalytics%2Fts-dune-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":257731055,"owners_count":22593418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","dune-analytics","nodejs","ts"],"created_at":"2025-06-10T10:41:47.126Z","updated_at":"2025-06-10T10:42:06.355Z","avatar_url":"https://github.com/duneanalytics.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Styled With Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io/)\n[![Build](https://github.com/bh2smith/ts-dune-client/actions/workflows/pull-request.yaml/badge.svg)](https://github.com/duneanalytics/ts-dune-client/actions/workflows/pull-request.yaml)\n\n# Dune Client TS\n\nThis [NPM package](https://www.npmjs.com/package/@duneanalytics/client-sdk) implements all the basic routes defined in the [Dune API Docs](https://dune.com/docs/api/). 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.\n\nInstall the package\n\n```sh\nyarn add @duneanalytics/client-sdk\n```\n\n```ts\nimport { QueryParameter, DuneClient, RunQueryArgs } from \"@duneanalytics/client-sdk\";\nconst { DUNE_API_KEY } = process.env;\n\nconst client = new DuneClient(DUNE_API_KEY ?? \"\");\nconst queryId = 1215383;\nconst opts: RunQueryArgs = {\n  queryId,\n  query_parameters: [\n    QueryParameter.text(\"TextField\", \"Plain Text\"),\n    QueryParameter.number(\"NumberField\", 3.1415926535),\n    QueryParameter.date(\"DateField\", \"2022-05-04 00:00:00\"),\n    QueryParameter.enum(\"ListField\", \"Option 1\"),\n  ],\n};\n\nclient\n  .runQuery(opts)\n  .then((executionResult) =\u003e console.log(executionResult.result?.rows));\n\n// should look like\n// [\n//    {\n//      date_field: \"2022-05-04 00:00:00.000\",\n//      list_field: \"Option 1\",\n//      number_field: \"3.1415926535\",\n//      text_field: \"Plain Text\",\n//    },\n//  ]\n```\n\n## Custom API\n\n```ts\nconst { DUNE_API_KEY } = process.env;\n\nconst client = new DuneClient(DUNE_API_KEY ?? \"\");\nconst results = await client.custom.getResults({\n  username: \"your_username\", \n  slug: \"endpoint-slug\"\n  // optional arguments: see `GetResultParams`\n  limit: 100,\n});\n```\n\n\nNote also that the client has methods `executeQuery`, `getExecutionStatus`, `getExecutionResult` and `cancelExecution`\n\nCheck out this [Demo Project](https://github.com/bh2smith/demo-ts-dune-client)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduneanalytics%2Fts-dune-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduneanalytics%2Fts-dune-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduneanalytics%2Fts-dune-client/lists"}