🚀 Jumpstart 2027: Custom, Secure AI Workflows to Adopt Now. Reserve your spot →

Chris Parmer

Chris Parmer

November 30, 2026

California real-time power price app with every 5-minute price since 2023

A data app example built with Dash and an AI coding agent in 45 minutes

TL;DR

  • Building data apps with AI coding agents in Python and managing them on Dash Enterprise or Plotly Cloud is the modern alternative to BI. At Plotly, many of our customers are migrating away from point-and-click tools like Spotfire, Tableau, and Power BI toward code-backed tools powered by AI. This example showcases the types of apps that you can create.
  • This app holds every real-time 5-minute locational marginal price (LMP) the California Independent System Operator (CAISO) published for its three trading hubs and four utility load areas from September 2023 to November 2026, 2,391,060 prices in all, analyzed with Polars. A coding agent built it from one prompt in about 45 minutes.
  • Every hub, load area, and day has its own page with its own link, so you can send a colleague the evening the price spiked.
  • You can read a year of prices as daily candles, see every price spike on a calendar, and sort millions of 5-minute prices into duration curves that show how often power was expensive and how often the price went below zero.
  • The full prompt is below, so you can build the same kind of app on your own data and run it on Dash Enterprise behind your firewall or have it hosted for you on Plotly Cloud.

Walkthrough

Power traders, analysts at utilities, and battery and solar developers look at real-time prices every day, and the questions are about extremes: when did the price spike, how often did it go negative, and which part of the grid was congested. The app starts from the market as a whole and lets you go down to one hub, one load area, or one day of 5-minute prices.

Read a year of prices as daily candles

The overview page of the CAISO power price app: KPI cards for SP15 and NP15 prices with small trend bars, a candlestick chart of a year of daily SP15 prices with node, period, and fit toggles, and the top of a calendar heatmap of price spikes

Each day becomes one candle: the first 5-minute price of the day, the highest, the lowest, and the last, with the day's average drawn through them. It's the candlestick chart traders already read for stocks, applied to a market that sets a new price every 5 minutes.

Switch between hubs and load areas, three months or the whole history, and between fitting the candles or fitting every spike. Clicking a candle opens that day.

See every price spike on a calendar

The price spikes page: a calendar heatmap with one row of weeks per year from 2023 to 2026, each day colored by how many 5-minute intervals at SP15 priced above $250 per megawatt-hour

The calendar heatmap colors each day by how many 5-minute intervals priced above $250 per megawatt-hour, the level CAISO's own market reports use for a spike. Clusters of spike days stand out at a glance, and quiet weeks stay gray.

The table below it ranks the days with the most spikes, with the peak price and the time it hit. Each row opens the day.

Sort millions of prices into duration curves

The duration curves page in its top-5% view: the highest 5-minute prices at all seven hubs and load areas against the share of intervals at or above each price on a log scale, with curves by year for SP15 and NP15 below

A price duration curve sorts every 5-minute price from highest to lowest, so you can read off how often the price was above any level. The steep left end is the few intervals when the price spiked, and the tail below zero is the intervals when generators were paying to keep running, mostly sunny middays, as the hour-by-month heatmap on each node page shows.

A log-scale view zooms into the top 5% of intervals, where the price spikes sit. Curves by year show how the market has shifted.

Open any hub or load area on its own page

The SP15 trading hub page: KPI cards for the last 30 days, the whole period, spikes, negative prices, and the highest interval, a year of daily candles, and the top of the hub's spike calendar

Each of the seven pricing nodes has a page at a link like /node/SP15. It brings together the candles, the spike calendar, a heatmap of the average price by hour and month that shows the midday solar dip and the evening ramp, and the monthly price split into energy, congestion, losses, and greenhouse gas.

That split is what explains why two nodes a few hundred miles apart price differently on the same day.

Open any day in 5-minute detail

A day page for 26 August 2026: every 5-minute price at the three trading hubs and four load areas through the day, with the southern nodes spiking above $1,000 in the evening while the northern ones stay low, a $250 line, and KPI cards for the day's average and peak

Every day has a page at a link like /day/2026-08-26 with every 5-minute interval at all seven nodes, previous and next buttons, and a date picker. Clicking a candle, a calendar day, or a table row anywhere in the app lands here.

On 26 August 2026, the day in the screenshot, SP15 reached $1,187 per megawatt-hour at 22:15 while NP15 averaged $53.01, and the congestion bars below the chart show why the two parted ways. This is the view people usually rebuild by hand in a spreadsheet after a price event, and here it's one click away.

Ask the app from an AI agent

The AI tools page, listing the app's seven MCP tools with their type signatures and descriptions: price summary, daily candles, spike days, duration points, day prices, node spread, and query data

The app is also a Model Context Protocol (MCP) server. Seven of its Python functions are marked with @mcp_enabled, so any AI tool like Claude, ChatGPT, Copilot, or Plotly Studio Embedded can ask how often SP15 spiked last summer, what the price was at 7 p.m. on a given day, or how far NP15 priced over SP15, and get the same numbers the pages show.

Each tool's type hints become its schema, and its docstring becomes the instructions the agent reads:

from dash.mcp import mcp_enabled
@mcp_enabled(expose_docstring=True)
def spike_days(node: Node = "SP15", threshold: float = 250.0, top: int = 20) -> list[dict]:
"""The days with the most 5-minute intervals priced above a threshold ($/MWh, default 250), with each day's
peak price, the time of the peak (Pacific) and the day's average."""
return _records(prices.spike_days(node, threshold, max(1, min(top, 200))))

Ask it inside the app with Plotly Studio Embedded

Plotly Studio Embedded open beside the app's overview page, with a bar chart of SP15 5-minute intervals above $250/MWh for each day from June 1 to September 30, summer 2024 in red and summer 2025 in blue, and an answer saying summer 2024 had 33 such intervals on six days, 29 of them on July 23 and 24, while summer 2025 had 11 on three days but the higher peak

On Plotly Cloud you can switch on Plotly Studio Embedded, a chat panel that sits on top of the app and calls the same tools. We asked it how many 5-minute intervals at SP15 went above $250 in summer 2024 (June to September) compared with summer 2025, and which days were worst, then asked for a day-by-day chart of both summers. It ran the app's price_summary, daily_candles, and spike_days tools and built the chart from what they returned.

Summer 2024 had 33 intervals above $250 on six days, and 29 of them fell on July 23 and 24. Summer 2025 had 11 on three days, but it had the higher peak, $1,061.20 per megawatt-hour on August 6, against $962.08 in 2024.

Studio Embedded is available on Plotly Cloud now and comes to Dash Enterprise in Q4 2026. Every answer has a Methodology link that shows the tool calls and code behind it.

See how every number is defined

The How we calculate page: eight metric definitions, each with the question it answers, a plain-words definition, the formula, the current value, and the Python function that computes it, covering the 5-minute price, the daily candle, a price spike, the duration curve, the average price, the negative-price share, the north-south spread, and the LMP components

The How we calculate page writes down the app's data definitions and methodology: what counts as a spike, which interval opens and closes a daily candle, and why the app's averages count every interval equally while CAISO's market monitor weights by load. Each card gives the definition in plain words, the formula, the current value, and the Polars function that computes it.

Data is often messy and ambiguous, and writing things down is a way for your app's viewers to know how you came to certain numbers.

Those functions are the app's semantic layer. The charts, the tables, and the AI tools all call the same ones, so a number means the same thing wherever it shows up.

What else could you add?

The prompt is a starting point. These are the kinds of things teams usually ask for next, and each one is a sentence or two more in the prompt:

  • More nodes, such as every price node in CAISO or the Western Energy Imbalance Market, or other markets like ERCOT and PJM
  • Day-ahead and 15-minute prices next to real time, with the spread between them
  • Your own positions or battery schedules, valued against the prices interval by interval
  • A scheduled refresh each morning that adds the previous day, with checks before it's written
  • Alerts when a node prices above a threshold or the north-south spread widens past a set level

How is this different from Spotfire and other BI tools?

If you're comparing Spotfire alternatives or other BI tools, the main differences come down to five things:

  1. With AI, apps like this can be built quickly and cheaply by anyone, including the power traders and market analysts who know the data best.
  2. The apps are backed by code, which you can version control, manage, and update more easily than a fleet of point-and-click dashboards, especially when AI is making the changes.
  3. The apps can go much further than a traditional BI tool, with multiple pages, write-back to databases, custom simulations, AI chart building inside the app, MCP endpoints, and more.
  4. You have full control over the app: the look and feel, the controls, filters, and buttons, and every computation. You aren't fighting a tool to get what you want.
  5. The apps can connect to several data sources at once, and to the other systems your team already uses.

How long did it take to build?

About 45 minutes of agent time. Claude Code (with Claude Opus 5.5) downloaded the public data, checked it, built the app, ran it, took screenshots, fixed what looked wrong in them, and deployed it, all from one prompt. Most of that time went on the downloads, because OASIS returns one month of prices per request and asks clients to space their requests.

Before building the charts, it compared its monthly average prices at the PG&E and SCE load points with the ones CAISO's Department of Market Monitoring publishes in its 2025 annual report. All 24 months of 2025 matched to within $0.51 per megawatt-hour, and the published figures are rounded to whole dollars.

The prompt

Paste this into Claude Code, Codex, Copilot, Cursor, or another coding agent, in an empty folder. Swap in your own data source and the features you need.

Build a Dash app for analyzing California real-time power prices, with every 5-minute locational marginal price CAISO publishes for its three trading hubs and four default load aggregation points, using Polars for every query.

Data

  • Download PRC_INTVL_LMP for market RTM from CAISO OASIS, one request per month for all seven nodes, as far back as OASIS keeps it. Request from Pacific midnight to Pacific midnight, space the requests a few seconds apart, and split a month in two if it's refused.
  • Read the files with Polars, drop duplicates, and check that each price equals its energy, congestion, loss, and greenhouse gas parts.
  • Before you build anything, compare the monthly average at the PG&E and SCE load points with the table in CAISO's 2025 market monitoring annual report, and tell me how close they are. Credit the California ISO on every page.

Pages (each with its own URL, and the back button must work)

  • Overview: KPI cards with sparklines. A candlestick of daily prices with a node picker and period toggles. A calendar heatmap of 5-minute intervals above $250 per day. A table of the seven nodes. Price duration curves. The NP15 minus SP15 spread.
  • /spikes: the calendar for any node and the days with the most spikes.
  • /duration: duration curves for every node, a top-5% view on a log scale, curves by year, and a table of points on each curve.
  • /node/<code> and /day/<YYYY-MM-DD> pages. A day page shows every 5-minute price at all seven nodes. Clicking a candle, a calendar day, or a table row opens that day.
  • A How we calculate page with every metric's definition, formula, current value, and the function that computes it.
  • An AI tools page listing the metric functions exposed with `@mcp_enabled`.

Design

  • A gray page with an inset sidebar. Each card is a light surface with its title above a white inset panel for the chart or table. Inter everywhere. No chart toolbars.

Run it, screenshot every page at 1600x1000, and fix anything that overflows, looks empty, or doesn't match the numbers before you stop.

How do I run it on Dash Enterprise or Plotly Cloud?

Dash Enterprise runs Dash apps inside your own infrastructure, behind your firewall and even air-gapped, with single sign-on and access control for each app.

This app needs nothing special. It's a Dash app with a requirements.txt, and your coding agent can deploy it through the Dash Enterprise or Plotly Cloud command line.

The app doesn't ship its data. On first start it downloads every month from CAISO OASIS in the background and prepares it with Polars, so point it at a persistent filesystem with an environment variable such as DATA_DIR=/data and the download only happens once.

If you'd rather not run any infrastructure, Plotly Cloud hosts the same app for you. We tested this one there.

Tips and tricks

These are things we like doing when we build apps like this one.

  • Ask for a page per thing. A page for each hub, load area, and day, with its own URL, makes the app feel like a website rather than a report, and lets people share exactly what they're looking at.
  • Make the agent check the data against the source's own numbers. CAISO's market monitor publishes monthly averages, so the agent compared its own with them before building any charts.
  • Keep the 5-minute data wide. One row per interval and one column per node keeps millions of prices small enough to hold in memory, and Polars turns them into candles with group_by_dynamic and into duration curves with a sort.
  • Read the API's limits before you loop over it. OASIS caps each request at 31 operating days and asks clients to space their requests, so the agent asked for whole Pacific days and split months it refused.
  • Let plain Python functions be your semantic layer. The candles, the spike counts, the duration curves, and the spread are short Polars functions in one module, and you can read them, test them, and change them, and so can the agent. Plain Python functions like these can become your semantic layer, one definition that every page, test, and agent uses.
  • Wrap your Python functions in @mcp_enabled. Turn on enable_mcp=True in the Dash(...) call and mark the functions with @mcp_enabled, and chat agents like Claude, ChatGPT, or Copilot can call them over MCP and get the same numbers the app's pages show.
  • Switch on Plotly Studio Embedded. The same tools power Plotly Studio Embedded, an AI chat inside the app that answers questions with charts and tables built from your functions. It's available now on Plotly Cloud (in beta) and is planned for Dash Enterprise in Q4 2026.

FAQ

See what Dash Enterprise and Plotly Cloud can do for your team

Our customers in energy, pharma, finance, and manufacturing are building apps like this one with coding agents and running them on Dash Enterprise behind their firewall or on Plotly Cloud. Request a demo and we'll show you how it works for your team.

bluesly
x
instagram
youtube
medium
fcaebook

Product

© 2026
Plotly. All rights reserved.
Cookie Preferences
aicpa/soc2