[Integrations](https://spiral.ai/integrations) › [Grok Build](https://spiral.ai/integrations/grok-build) › [EIA dataset filter codes](https://spiral.ai/integrations/grok-build/eia-dataset-filter-codes)

# How to Use EIA dataset filter codes in Grok Build

Fetch the codes, names, and aliases available for a dataset filter, such as an electricity customer sector. Use it to select the right category before requesting observations.

|  |  |
| --- | --- |
| Model | EIA dataset filter codes |
| Available through | Alexandria |
| Category | Finance |
| Price | $0.00873 per call. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with EIA dataset filter codes in Grok Build

- Use EIA dataset filter codes to retrieve the customer-sector codes for electricity retail sales. Add the returned labels to this project's sector selector.
- Use EIA dataset filter codes to look this up and give me the result as a table. Save the result in ./assets.
- Pull the latest numbers from EIA dataset filter codes and tell me what changed since last week.
- Check EIA dataset filter codes and summarize what you find in three bullet points.
- Pull the newest data from EIA dataset filter codes and give me the result as a table.

## How to set up EIA dataset filter codes in Grok Build

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the server**: Add `--scope project` to add Spiral to the current repository only. No header and no client ID or secret: Grok registers itself with Spiral.

```bash
grok mcp add --transport http spiral https://api.spiral.ai/mcp
```

2. **Sign in**: Start `grok` and run `/mcps`. Select Spiral and press `i`. Your browser opens: sign in to Spiral, pick the organization and click Authorize. No API key.

3. **Check it**

```bash
grok mcp doctor spiral
```

### Use the Spiral skill

1. **Send Grok Build this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run EIA dataset filter codes**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "alexandria",
    "model": "eia-gov/energy-data/facet_values",
    "input": {
      "route": "<route>",
      "facet_id": "<facet_id>"
    }
  }'
```

Then paste one of the prompts above: Grok Build finds EIA dataset filter codes on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/grok-build

## EIA dataset filter codes tools and prices

- [US Energy Information Administration · Facet values](https://spiral.ai/tools/alexandria/eia-gov/energy-data/facet_values) (Alexandria): $0.00873 per call.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| api_key |  | — | Registered EIA API key. Omitted, the public data-browser key is discovered live (see `routes`). Pattern: ^[A-Za-z0-9_]+$. |

## What can you do with EIA dataset filter codes in Grok Build?

Build a state electricity comparison or grid-demand report using EIA measurements. Let the agent inspect dataset metadata and category labels before adding calculations and charts to your project.

### Compare state electricity consumption

Find the retail sales dataset, resolve state and customer-sector codes, and compare monthly residential electricity sales in California, Texas, and Florida over the same period.

### Compare commercial and industrial demand for electricity

Identify the retail sales measurements and sector labels, then compare commercial and industrial electricity sales in Ohio. Calculate each sector's year-over-year change.

### Measure changes in a state's generation mix

Locate monthly generation by state and fuel, resolve the fuel categories, and calculate how Texas generation shares changed between 2023 and 2024.

### Review power plant operating history

Find the plant generation dataset and the code for Palo Verde, then compare monthly generation across 2023 and 2024 to identify seasonal changes.

### Check grid demand forecasts against reported demand

Locate hourly balancing-authority measurements and resolve PJM's reporting code. Compare reported demand with demand forecasts for a completed week and calculate the largest hourly differences.

### Compare seasonal natural gas storage

Find weekly underground storage data and its regional categories, then compare working gas levels for the same weeks in successive years.

## Overview

- [Alexandria](https://spiral.ai/providers/alexandria)
- [All Grok Build guides](https://spiral.ai/integrations/grok-build)

## EIA dataset filter codes in other agents

- [Amp](https://spiral.ai/integrations/amp/eia-dataset-filter-codes)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/eia-dataset-filter-codes)
- [Claude](https://spiral.ai/integrations/claude-desktop/eia-dataset-filter-codes)
- [Claude Code](https://spiral.ai/integrations/claude-code/eia-dataset-filter-codes)
- [Cline](https://spiral.ai/integrations/cline/eia-dataset-filter-codes)
- [Codex](https://spiral.ai/integrations/codex/eia-dataset-filter-codes)
- [Cursor](https://spiral.ai/integrations/cursor/eia-dataset-filter-codes)
- [Devin](https://spiral.ai/integrations/devin/eia-dataset-filter-codes)
- [dots](https://spiral.ai/integrations/dots/eia-dataset-filter-codes)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/eia-dataset-filter-codes)
- [Gemini](https://spiral.ai/integrations/gemini/eia-dataset-filter-codes)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/eia-dataset-filter-codes)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/eia-dataset-filter-codes)
- [goose](https://spiral.ai/integrations/goose/eia-dataset-filter-codes)
- [Grok](https://spiral.ai/integrations/grok/eia-dataset-filter-codes)
- [Hermes](https://spiral.ai/integrations/hermes/eia-dataset-filter-codes)
- [Instinct](https://spiral.ai/integrations/instinct/eia-dataset-filter-codes)
- [Manus](https://spiral.ai/integrations/manus/eia-dataset-filter-codes)
- [Muse](https://spiral.ai/integrations/muse/eia-dataset-filter-codes)
- [Muse Code](https://spiral.ai/integrations/muse-code/eia-dataset-filter-codes)
- [n8n](https://spiral.ai/integrations/n8n/eia-dataset-filter-codes)
- [Notion](https://spiral.ai/integrations/notion/eia-dataset-filter-codes)
- [OpenClaw](https://spiral.ai/integrations/openclaw/eia-dataset-filter-codes)
- [opencode](https://spiral.ai/integrations/opencode/eia-dataset-filter-codes)
- [Perplexity](https://spiral.ai/integrations/perplexity/eia-dataset-filter-codes)
- [Raycast](https://spiral.ai/integrations/raycast/eia-dataset-filter-codes)
- [VS Code](https://spiral.ai/integrations/vscode/eia-dataset-filter-codes)
- [Windsurf](https://spiral.ai/integrations/windsurf/eia-dataset-filter-codes)
- [Zapier](https://spiral.ai/integrations/zapier/eia-dataset-filter-codes)

## More Grok Build guides

- [EIA dataset directory](https://spiral.ai/integrations/grok-build/eia-dataset-directory)
- [EIA energy observations](https://spiral.ai/integrations/grok-build/eia-energy-observations)
- [ECB exchange rates](https://spiral.ai/integrations/grok-build/ecb-exchange-rates)
- [EODHD IPO calendar](https://spiral.ai/integrations/grok-build/eodhd-ipo-calendar)
- [ECB economic time series](https://spiral.ai/integrations/grok-build/ecb-economic-time-series)
- [EODHD company fundamentals](https://spiral.ai/integrations/grok-build/eodhd-company-fundamentals)

## Questions about EIA dataset filter codes in Grok Build

**Can Grok Build use EIA dataset filter codes?**

Yes. Add Spiral to Grok Build as an MCP server, and Grok Build can find and run EIA dataset filter codes like any built-in tool.

**How much does EIA dataset filter codes cost in Grok Build?**

$0.00873 per call. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Grok Build plan is separate.

**Do I need an Alexandria account to use EIA dataset filter codes in Grok Build?**

No. Spiral runs EIA dataset filter codes on its own Alexandria account. You sign in to Spiral once and never paste a key.

**How long does it take to set up EIA dataset filter codes in Grok Build?**

About two minutes: add the server, then sign in, then check it.

**Does Grok Build wait while EIA dataset filter codes runs?**

EIA dataset filter codes runs in the background. Grok Build starts the run, checks on it and gives you the json when it's ready.

**What detail does EIA provide for electricity customers?**

EIA's retail sales dataset includes monthly customer counts, electricity sales, revenue, and average prices by state and customer sector.

**Does EIA update every dataset on the same schedule?**

No. EIA says its API accesses public-facing databases directly and updates constantly rather than at regular intervals.

**Can one response contain every matching observation?**

EIA caps observation responses at 5,000 rows. The total count can exceed the returned count, so larger requests need pagination or narrower filters.

**How far back does the hourly grid API go?**

EIA says historical EIA-930 submissions through the API begin January 1, 2019. This collection covers grid operations reported by balancing authorities in the Lower 48 states.

**Does hourly generation include rooftop solar?**

Hourly generation captures generators managed by, or visible to, balancing authorities. Those authorities typically do not meter distribution-system generators, so rooftop solar is often excluded.

