# Google Sheets Add-On

> Install, set up, and use the following instructions to learn how to obtain data with the Trading Economics Google Sheets Add-On.

Source: https://docs.tradingeconomics.com/google-sheet/

This add-on connects Google Sheets to the Trading Economics API, letting you pull live economic indicators, calendar events, forecasts, market data, and more directly into your spreadsheet.

There are two ways to install it: directly from the Google Workspace Marketplace or manually by pasting the source code into Apps Script.

## Requirements

- A Google account with access to [Google Sheets](https://sheets.google.com)
- A [Trading Economics API key](https://tradingeconomics.com/api/pricing.aspx?source=mcp)

### Method 1 — Install from Google Workspace Marketplace

Use this method to install the add-on directly from Google Sheets in a few clicks.

### Step 1 — Open the Add-ons Marketplace

1. Open a Google Sheets spreadsheet.
2. Go to **Extensions → Add-ons → Get add-ons**.

![Extensions → Add-ons → Get add-ons](./images/add-on-8.png)

3. In the Google Workspace Marketplace, search for **Trading Economics**.
4. Click **Install** on **TRADING ECONOMICS Sheets Add-on**.

![TRADING ECONOMICS Sheets Add-on listing](./images/add-on-10.png)

### Step 2 — Sign In Popup

A Google popup will appear asking you to sign in to the **TRADING ECONOMICS Sheets Add-on**.

1. Click **Continue**.

![Sign in popup — click Continue](./images/add-on-11.png)

### Step 3 — Grant Permissions

In the next Google popup, grant the required access permissions.

1. Click **Select all**.
2. Click **Continue**.

![Permission selection — select all](./images/add-on-12.png)

### Step 4 — Open the Add-On

After the permissions are accepted:

1. Go to **Extensions**.
2. Click **TRADING ECONOMICS Sheets Addon** to access indicators, calendar, markets, and settings.

![Extensions → TRADING ECONOMICS Sheets Addon](./images/add-on-14.png)

3. Click **Settings** and enter your [Trading Economics API key](https://tradingeconomics.com/api/pricing.aspx?source=mcp) to start fetching data.

### Method 2 — Install from Source Code (Apps Script)

Use this method if you want to install the add-on by pasting the project files directly into Apps Script.

### Step 1 — Open the Apps Script Editor

1. Open your Google Sheets spreadsheet.
2. In the menu bar, go to **Extensions → Apps Script**.

The Apps Script editor will open in a new browser tab.

![Extensions → Apps Script](./images/add-on-1.png)

### Step 2 — Add the Script Code

1. In the Apps Script editor, click on the default **`Code.gs`** file in the left panel.
2. Delete all existing content in the editor.
3. Copy the full contents of [Code.gs](https://raw.githubusercontent.com/tradingeconomics/tradingeconomics/master/Google-Sheets/Code.gs) and paste it into the editor.
4. Press **Ctrl + S** (or **Cmd + S** on Mac) to save.

![Code.gs editor](./images/add-on-2.png)

### Step 3 — Configure the Manifest

The `appsscript.json` manifest declares the OAuth permissions the add-on needs to communicate with Google Sheets and the Trading Economics API.

1. In the Apps Script editor, click **Project Settings** (the gear icon in the left panel).
2. Check the box labelled **"Show 'appsscript.json' manifest file in editor"**.
3. Go back to the **Editor** view — `appsscript.json` will now appear in the file list.
4. Click on **`appsscript.json`**, delete all existing content, and paste in the following:

```json
{
  "timeZone": "Etc/UTC",
  "dependencies": {},
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
  "oauthScopes": [
    "https://www.googleapis.com/auth/script.storage",
    "https://www.googleapis.com/auth/spreadsheets",
    "https://www.googleapis.com/auth/script.container.ui",
    "https://www.googleapis.com/auth/script.external_request"
  ]
}
```

5. Press **Ctrl + S** (or **Cmd + S** on Mac) to save.

### Step 4 — Add the Sidebar HTML File

1. In the Apps Script editor, click the **+** icon next to **Files** in the left panel and choose **HTML**.

![Add HTML file](./images/add-on-3.png)

2. Name the new file exactly **`Sidebar`** (the editor will append `.html` automatically).
3. Delete all existing content in the new file.
4. Copy the full contents of [Sidebar.html](https://raw.githubusercontent.com/tradingeconomics/tradingeconomics/master/Google-Sheets/Sidebar.html) and paste it into the editor.
5. Press **Ctrl + S** (or **Cmd + S** on Mac) to save.

![Sidebar.html editor](./images/add-on-5.png)

### Step 5 — Activate the Add-On

1. Go back to your Google Sheets spreadsheet and **refresh the page**.
2. After a few seconds, a new **TE** menu will appear in the menu bar.
3. Click **TE → Settings** and enter your [Trading Economics API key](https://tradingeconomics.com/api/pricing.aspx?source=mcp) to start fetching data.

![TE menu](./images/add-on-6.png)

Ensure your spreadsheet has enough rows (10,000+) before making a request.

- If you need more rows, scroll to the bottom and click "Add" to add more rows.

### Notes

1 - The first time you use the Add-On, a warning might appear stating "This app isn't verified."

- Click on "Advanced"
- Click on "Go to (project name) (unsafe)" to continue using our Add-On.

This warning appears because the script runs under your own Google account. The code is fully open source and visible in the [repository](https://github.com/tradingeconomics/tradingeconomics/tree/master/Google-Sheets).

![Notes](./images/add-on-7.png)

