# Google Sheets Integration

## Importing Coin Metrics Data to Google Sheets

Where our Coin Metrics API includes a csv format option data can be directly loaded into google sheets.

To do this input you API call into the `=IMPORTDATA()` formula.

Below is an example Once included there is warning that requires you to allow access: steps for setting this up yourself

1. Open a new google sheet
2. Add API Parameters to cells in columns A and add results to column B
   1. Example using time series asset-metrics endpoint

| A           | B                    |
| ----------- | -------------------- |
| API KEY     | {API\_KEY}           |
| ASSETS      | btc                  |
| METRICS     | PriceUSD             |
| PAGE SIZE   | 1000                 |
| START TIME  | 2025-01-01T00:00:00Z |
| END TIME    | 2025-01-31T00:00:00Z |
| PAGING FROM | end                  |
| FREQUENCY   | 1d                   |

3. Leverage this formula for creating your API Query

```
= "https://api.coinmetrics.io/v4/timeseries/asset-metrics?" &
"api_key="& B1 &
"&assets=" & B2 &
"&metrics=" & B3 &
"&page_size=" & B4 &
"&start_time=" & B5 &
"&end_time=" & B6 &
"&paging_from=" & B7 &
"&frequency=" & B8 &
"&format=csv"



```

4. In a new cell enter: `=IMPORTDATA({Cell with API Call})`

At this point you will see a warning where you need to allow access for the API Call

<figure><img src="/files/86GBbjn8a9RFAPxevT7o" alt=""><figcaption></figcaption></figure>

Example results:

<figure><img src="/files/fa88m43PfCstJHhkO08c" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook-docs.coinmetrics.io/access-our-data/downloading-our-data/google-sheets-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
