> ## 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.

<img src="https://mintcdn.com/artemis-db73460d/NNkNKnlLcFniLQiw/images/image%20(80).png?fit=max&auto=format&n=NNkNKnlLcFniLQiw&q=85&s=cd5683e525043cadf199d9829178da90" alt="Example Dune Chart - GMX Volume" width="1486" height="998" data-path="images/image (80).png" />

<img src="https://mintcdn.com/artemis-db73460d/NNkNKnlLcFniLQiw/images/image%20(73).png?fit=max&auto=format&n=NNkNKnlLcFniLQiw&q=85&s=4faa51b8f786a96c13ba202f98b1b7c6" alt="GMX Volume pulled in Excel" width="1722" height="1388" data-path="images/image (73).png" />

##

## 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":\\

   <img src="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" alt="" width="1214" height="615" data-path="images/Screenshot 2023-08-04 at 3.15.16 PM.png" />

3. Copy the new API key:\\

   <img src="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" alt="" width="692" height="647" data-path="images/Screenshot 2023-08-04 at 3.26.27 PM.png" />

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

   <img src="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" alt="" width="1418" height="959" data-path="images/Screenshot 2023-08-04 at 3.18.38 PM.png" />

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

   <img src="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" alt="" width="1612" height="963" data-path="images/Screenshot 2023-08-04 at 3.19.54 PM.png" />

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

   <img src="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" alt="" width="562" height="388" data-path="images/Screenshot 2023-08-14 at 4.26.48 PM.png" />

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":\
   \\

   <img src="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" alt="" width="1211" height="613" data-path="images/Screenshot 2023-08-10 at 5.23.39 PM.png" />

3. Copy the new API key:\\

   <img src="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" alt="" width="687" height="646" data-path="images/Screenshot 2023-08-10 at 5.24.20 PM.png" />

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

   <img src="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" alt="" width="1087" height="670" data-path="images/Screenshot 2023-08-10 at 5.25.38 PM.png" />

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

   <img src="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" alt="" width="542" height="429" data-path="images/Screenshot 2023-08-10 at 5.28.40 PM.png" />

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

   <img src="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" alt="" width="1071" height="623" data-path="images/Screenshot 2023-08-10 at 5.29.47 PM.png" />

## 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).

   <img src="https://mintcdn.com/artemis-db73460d/NNkNKnlLcFniLQiw/images/image%20(93).png?fit=max&auto=format&n=NNkNKnlLcFniLQiw&q=85&s=1e52fa322506b39bdb4a631326a5b499" alt="" width="1960" height="930" data-path="images/image (93).png" />

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)`
