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

# API keys

> Read your own Hoard listings, orders and pricing rules in a Google Sheet, a script or your own app.

An API key lets a spreadsheet, script or app read your store's data from Hoard. Keys are read-only. They cannot change prices or listings.

## When you need a key

If you use Claude, ChatGPT or Codex, you do not need a key. Connect your assistant in Settings > Connected apps > **Connect your assistant**. See [Connect to Claude](https://docs.tryhoard.com/connect-to-claude.md), [Connect to ChatGPT](https://docs.tryhoard.com/connect-to-chatgpt.md) or [Connect to Codex](https://docs.tryhoard.com/connect-to-codex.md).

Make a key when you want your data somewhere else, like a Google Sheet that holds your inventory, or a script you run yourself.

The key on Settings > Account is a different thing. That one belongs to the Hoard Desktop agent. It does not work for store data.

## Create a key

**1. Open the API keys card**

Go to [Settings > Connected apps](https://www.tryhoard.com/settings/connected-apps#api-keys) and find **API keys**. Only the store owner can create keys.

**2. Name it**

Type a name you will recognize, like "Inventory sheet". Click **Create key**.

![The API keys card in Settings, Connected apps, with a Key name field, a Create key button and one key named Inventory sheet showing 214 requests this month, with Rotate and Revoke](https://mintcdn.com/hoard/9uJbekcl3NI9fzMU/images/feat-api-keys-card.png?fit=max\&auto=format\&n=9uJbekcl3NI9fzMU\&q=85\&s=573341a1140121e0839b1be6e49c5a6c)

## Use your new key

After you create a key, Hoard shows three steps.

![The three steps after creating a key: copy the key, Test key showing Works. First listing: Sol Ring., and 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)

**1. Copy the key**

The key starts with `hdk_`. Hoard shows it once. Save it in a password manager before you leave the page. If you lose it, rotate the key to get a new one.

**2. Test key**

Click **Test key**. Hoard reads one listing and tells you the result.

| You see | What it means |
| - | - |
| Works. First listing: ... | The key is good. |
| Works. No listings yet. | The key is good, and the store has no live listings. |
| That key doesn't work | The key was revoked, rotated or mistyped. |
| Too many requests | Wait a minute and try again. |

**3. Use it**

Pick the Google Sheets path or the curl path below.

## Google Sheets

You do not write any code. An assistant writes it for you.

1. In step 3, click **Copy for ChatGPT**, or **Open Claude**. The prompt asks for a Google Apps Script that pulls your inventory into the sheet.
2. Paste the prompt into the assistant. The assistant writes the script and walks you through it.
3. In Google Sheets, open Extensions > Apps Script and paste the script.
4. In Project Settings > Script Properties, add a property named `HOARD_API_KEY`. Paste your key as the value.
5. Run the script and approve the permissions Google asks for.

Put the key in Script Properties only. Do not paste it into the chat or into the script.

For a step-by-step walkthrough, see [Pull your inventory into Google Sheets](https://docs.tryhoard.com/tutorials/pull-your-inventory-into-google-sheets.md).

## curl

Step 3 also shows a ready curl command with your key filled in. It looks like this:

```bash theme={null}
curl -H "Authorization: Bearer hdk_YOUR_KEY" \
  "https://www.tryhoard.com/api/v1/store/inventory?limit=100"
```

## What each endpoint returns

All endpoints use `GET`. Send your key as `Authorization: Bearer hdk_...`. The base address is `https://www.tryhoard.com`.

### Inventory

`/api/v1/store/inventory` returns your live listings. Listings with a quantity of zero and Quick Add placeholders are left out.

| Field | What it is |
| - | - |
| `product_name`, `set_name`, `card_number`, `product_line` | The card |
| `condition`, `printing`, `language` | The version. Language is English when unknown. |
| `quantity` | How many you have listed |
| `listed_price` | Your current TCGplayer price |
| `target_price` | The price your pricing rules want |
| `price_locked` | Whether the price is locked |
| `sku_id`, `product_id`, `custom_listing_id` | IDs. `sku_id` is empty for custom listings. |
| `updated_at` | When the listing last changed |

### Orders

`/api/v1/store/orders` returns your TCGplayer orders, newest first. Add `placed_since` with an ISO date and time to get only recent orders.

| Field | What it is |
| - | - |
| `order_number`, `status`, `ordered_at` | The order |
| `shipping_method`, `marked_shipped_at` | Shipping |
| `item_count`, `items` | The cards in the order, with quantity, unit price and refunded amount |
| `product_amount`, `shipping_amount`, `fee_amount`, `net_amount`, `total_amount` | The money |
| `refund_amount`, `refund_type`, `refund_reason` | Refunds |

Orders can change after they are placed. Refunds and late line items show up on later reads. Re-read the last few weeks each time you sync, and replace the orders you already have.

Orders do not include buyer names, addresses, feedback or tracking numbers.

### Pricing rules

`/api/v1/store/pricing_rules` returns your rules in priority order. Each rule has a label, a query, a status (active, disabled or expired), a price source, a multiplier, and its floor and velocity settings. It does not include sample cards or prices.

### Sync status

`/api/v1/sync/status` returns the state of your sync.

## Paging

Add `limit` to set the page size, from 1 to 500. The default is 100. Each response includes `next_cursor`. Send it back as `cursor` to get the next page. Stop when `next_cursor` is null.

A cursor only works for the store and endpoint that made it. Anything else returns `400 invalid_cursor`.

## Rotate or revoke a key

* **Rotate** gives you a new key. The old one stops working right away.
* **Revoke** turns the key off for good.

Hoard asks you to confirm both. Each key row also shows the last four characters, requests this month and when it was last used.

You can have up to 10 active keys. Make one per sheet or script, so you can revoke one without breaking the others.

## Limits

Each key has a per-minute limit based on your plan. If you go over, Hoard returns `429 rate_limited` with a `Retry-After` header that says how many seconds to wait.

## What is not included

* Market, low or comp prices
* Other sellers' data
* Buyer details
* Mana Pool data. These endpoints cover your TCGplayer store.
* Changing prices or listings

## Errors

| Code | What to do |
| - | - |
| `401` | The key is wrong, revoked or expired. Check it, or make a new one. |
| `403 developer_route_not_allowed` | That endpoint is not open to API keys. |
| `403 legacy_key_not_allowed` | You used the desktop agent key. Use an API key. |
| `429 rate_limited` | Wait for the `Retry-After` seconds. |

## Full reference

See [Store data](https://docs.tryhoard.com/api-reference/store.md) for every field and [Authentication](https://docs.tryhoard.com/api-reference/authentication.md) for how keys work.


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