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

# Pull your inventory into Google Sheets

> Make a read-only API key, then let ChatGPT or Claude write the script that fills a Google Sheet with your Hoard listings.

This makes a Google Sheet of every live listing in your store. You do not need a terminal or any coding. An assistant writes the script, and you paste it in.

You need a Google account, a Hoard account with listings synced, and a ChatGPT or Claude account.

## What you'll end up with

One row per listing. The columns are product name, set, condition, printing, language, quantity, listed price, target price and SKU ID.

***

## Step 1: Create a key

Go to [Settings > Connected apps](https://www.tryhoard.com/settings/connected-apps#api-keys). In the **API keys** card, type a name like "Inventory sheet" and click **Create key**.

![The API keys card with a Key name field and a Create key button](https://mintcdn.com/hoard/9uJbekcl3NI9fzMU/images/feat-api-keys-card.png?fit=max\&auto=format\&n=9uJbekcl3NI9fzMU\&q=85\&s=573341a1140121e0839b1be6e49c5a6c)

***

## Step 2: Copy the key

Hoard shows the key once. It starts with `hdk_`. Copy it and save it somewhere safe, like a password manager. You will paste it into Google in step 5.

If you lose it, rotate the key to get a new one.

***

## Step 3: Test the key

Click **Test key**. You should see "Works. First listing:" followed by one of your cards.

![Step 2 shows Works. First listing: Sol Ring. Step 3 shows the Google Sheets prompt with Copy for ChatGPT and Open Claude](https://mintcdn.com/hoard/9uJbekcl3NI9fzMU/images/feat-api-keys-new-key.png?fit=max\&auto=format\&n=9uJbekcl3NI9fzMU\&q=85\&s=e3b0fa0a3a407a6c709c4afbfa71b292)

If you see "Works. No listings yet.", the key is fine, but your store has no live listings. If you see "That key doesn't work", check the key you copied.

***

## Step 4: Copy the prompt into an assistant

In step 3 on the same page, find the Google Sheets row. Click **Copy for ChatGPT**, then paste it into a new ChatGPT chat. Or click **Open Claude** to start a Claude chat with the prompt filled in.

The prompt reads:

> Write a Google Apps Script for Google Sheets that pulls my Hoard store inventory into the active sheet. Call GET [https://www.tryhoard.com/api/v1/store/inventory?limit=500](https://www.tryhoard.com/api/v1/store/inventory?limit=500) with the header "Authorization: Bearer " followed by my API key, and keep calling with cursor set to next\_cursor until next\_cursor is null. Write one row per listing with these columns: product\_name, set\_name, condition, printing, language, quantity, listed\_price, target\_price, sku\_id. Read the API key from Script Properties under the name HOARD\_API\_KEY, never from the code. Then walk me step by step through pasting the script, saving my key in Script Properties, and running it.

Do not paste your key into the chat. The script reads it from Google later.

***

## Step 5: Follow the assistant's steps in Google Sheets

The assistant gives you a script and walks you through these steps.

1. Open a new Google Sheet.
2. Click Extensions > Apps Script.
3. Delete the sample code and paste the script the assistant wrote. Click the save icon.
4. Click Project Settings (the gear icon), then scroll to Script Properties.
5. Click **Add script property**. Set the property to `HOARD_API_KEY` and the value to your key. Click **Save script properties**.
6. Go back to the editor and click **Run**.
7. Google asks for permission. Click **Review permissions**, pick your account, and approve. If Google warns the app is not verified, click Advanced and continue. The script is yours, and it only runs in your sheet.

***

## Step 6: Check the sheet

Go back to your sheet. You should see a header row and one row per listing. Large stores take a minute to fill.

To refresh the data, run the script again. Ask the assistant how to run it on a schedule if you want that.

***

## Troubleshooting

| What you see | What to do |
| - | - |
| `401` or "unauthorized" | The key was revoked, rotated or mistyped. Check `HOARD_API_KEY` in Script Properties for extra spaces. Make a new key if needed. |
| `429` or "too many requests" | Wait a minute and run the script again. |
| The sheet is empty | You have no live listings. Listings with a quantity of zero are left out. |
| The script says it cannot find the key | The property name must be exactly `HOARD_API_KEY`. |

If the key leaks, go back to the API keys card and click **Revoke**, or **Rotate** to get a new one.

For more on keys, see [API keys](https://docs.tryhoard.com/features/api-keys.md). For every field, see [Store data](https://docs.tryhoard.com/api-reference/store.md).


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