> ## Documentation Index
> Fetch the complete documentation index at: https://artemis.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Dune

> Pulling data programmatically from Dune into Excel / GSheets

Artemis Sheets allow you to pull individual charts or queries programmatically from [Dune](https://dune.com/browse/dashboards) directly into your Excel / GSheets.

![Example Dune Chart - GMX Volume](https://mintcdn.com/artemis-db73460d/NNkNKnlLcFniLQiw/images/image%20\(80\).png?fit=max\&auto=format\&n=NNkNKnlLcFniLQiw\&q=85\&s=cd5683e525043cadf199d9829178da90)

![GMX Volume pulled in Excel](https://mintcdn.com/artemis-db73460d/NNkNKnlLcFniLQiw/images/image%20\(73\).png?fit=max\&auto=format\&n=NNkNKnlLcFniLQiw\&q=85\&s=4faa51b8f786a96c13ba202f98b1b7c6)

##

## 1. Setup

### Google Sheet

1. Get your Dune API key by navigating to the [Dune API settings page](https://dune.com/settings/api).

2. Click "Create new API key":\\

   ![](https://mintcdn.com/artemis-db73460d/u2ylj6ovlda4p-qx/images/Screenshot%202023-08-04%20at%203.15.16%20PM.png?fit=max\&auto=format\&n=u2ylj6ovlda4p-qx\&q=85\&s=6648d7d768d92db8b03ceb8e68122a1d)

3. Copy the new API key:\\

   ![](https://mintcdn.com/artemis-db73460d/u2ylj6ovlda4p-qx/images/Screenshot%202023-08-04%20at%203.26.27%20PM.png?fit=max\&auto=format\&n=u2ylj6ovlda4p-qx\&q=85\&s=4a4d60930ec31824374411c9b3e7ddc3)

4. Go to your Google Sheet with Artemis Sheets installed (installation instructions [here](https://artemis.ai/docs/artemis-sheets/installation-and-usage.md)) and open the side bar. Click on the settings menu:\\

   ![](https://mintcdn.com/artemis-db73460d/u2ylj6ovlda4p-qx/images/Screenshot%202023-08-04%20at%203.18.38%20PM.png?fit=max\&auto=format\&n=u2ylj6ovlda4p-qx\&q=85\&s=a20c287b9d5b01ffef0a434933c3fe94)

5. Click "Insert Dune API Key":\\

   ![](https://mintcdn.com/artemis-db73460d/u2ylj6ovlda4p-qx/images/Screenshot%202023-08-04%20at%203.19.54%20PM.png?fit=max\&auto=format\&n=u2ylj6ovlda4p-qx\&q=85\&s=91e6797d071778e600a2fb3090381829)

6. Past the Dune API key into the text box and click "Ok":\\

   ![](https://mintcdn.com/artemis-db73460d/u2ylj6ovlda4p-qx/images/Screenshot%202023-08-14%20at%204.26.48%20PM.png?fit=max\&auto=format\&n=u2ylj6ovlda4p-qx\&q=85\&s=579407c58fa87e17427359a0aaebb6af)

7. Done!

### Excel (Windows)

1. Get your Dune API key by navigating to the [Dune API settings page](https://dune.com/settings/api).

2. Click "Create new API key":\
   \\

   ![](https://mintcdn.com/artemis-db73460d/u2ylj6ovlda4p-qx/images/Screenshot%202023-08-10%20at%205.23.39%20PM.png?fit=max\&auto=format\&n=u2ylj6ovlda4p-qx\&q=85\&s=b81744b8f229f3f69fd5ff1c35f5a06f)

3. Copy the new API key:\\

   ![](https://mintcdn.com/artemis-db73460d/u2ylj6ovlda4p-qx/images/Screenshot%202023-08-10%20at%205.24.20%20PM.png?fit=max\&auto=format\&n=u2ylj6ovlda4p-qx\&q=85\&s=38e3cbd36b22b8fa5726c3210cf0392d)

4. Go to your Excel application with Artemis Sheets installed (installation instructions [here](https://artemis.ai/docs/artemis-sheets/installation-and-usage.md)) and click on the "Artemis Sheets" menu bar item. Then click on the "External providers API keys" button:\\

   ![](https://mintcdn.com/artemis-db73460d/u2ylj6ovlda4p-qx/images/Screenshot%202023-08-10%20at%205.25.38%20PM.png?fit=max\&auto=format\&n=u2ylj6ovlda4p-qx\&q=85\&s=aeaf9df310c9f7b2a540ebf2d8ecc828)

5. Past the Dune API key into the Dune text box and click "Save":\\

   ![](https://mintcdn.com/artemis-db73460d/u2ylj6ovlda4p-qx/images/Screenshot%202023-08-10%20at%205.28.40%20PM.png?fit=max\&auto=format\&n=u2ylj6ovlda4p-qx\&q=85\&s=3fa3a0fcb74285abaee610a36b129d2d)

6. Done! You should see your masked Dune API key displayed at the top right:\\

   ![](https://mintcdn.com/artemis-db73460d/u2ylj6ovlda4p-qx/images/Screenshot%202023-08-10%20at%205.29.47%20PM.png?fit=max\&auto=format\&n=u2ylj6ovlda4p-qx\&q=85\&s=98547b4d4e9c154406e6db2154794392)

## 2. Usage

#### 1. Find your Dune query ID:

1. Locate a dashboard from Dune you're interested in pulling. In the example above, we use this [GMX Everything Dashboard](https://dune.com/gmxtrader/gmx-dashboard-insights).

2. Locate a chart from the dashboard you'd like to pull.

3. Click on the chart title - this should take you to the [chart's query](https://dune.com/queries/1443379/2445683).

   ![](https://mintcdn.com/artemis-db73460d/NNkNKnlLcFniLQiw/images/image%20\(93\).png?fit=max\&auto=format\&n=NNkNKnlLcFniLQiw\&q=85\&s=1e52fa322506b39bdb4a631326a5b499)

4. The `queryId` is the first number in the URL. For example, the GMX Platform Volume URL is: [https://dune.com/queries/1443379/2445683](https://dune.com/queries/1443379/2445683). Therefore, its `queryId` is `1443379`

#### 2. Syntax

`=ARTDUNE(queryId)`

In the example above, we use:

`=ARTDUNE(1443379)`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.