Six Years of Hourly Grid Data in One Database

Jul 30, 2026

What's it all about?

EPİAŞ, Türkiye's electricity market operator, publishes a genuinely good dataset on its Şeffaflık (Transparency) Platform.

Every hour, for every licensed power plant in the country, you can see how much electricity it generated and from which fuel. Next to it sits the hourly day-ahead price (PTF), the balancing market price (SMF), and intraday weighted averages. Roughly 1,800 facilities. Public, free, and granular enough to answer real questions about how a national grid actually behaves.

I have not met many people who use it.

Not because they do not want to. Because between the data existing and the data being usable, there is a gap that quietly costs weeks.

Access shaped for today, not for history

The data is served through an API, and that API is built for a specific job: telling you what happened recently. Access is metered. Query windows are capped at a few months. Results come back per plant, per window, and there are a lot of plants.

None of that is unreasonable for its intended purpose. It is simply the wrong shape for the questions people actually have, which are almost always historical and almost always comparative:

  • How has the generation mix shifted across seasons, and how has that shape changed year over year?
  • Which technologies are actually running when prices spike?
  • What did a given plant, or a portfolio of them, earn against the day-ahead reference?
  • How does utilisation differ by fuel type, and where is it trending?

Every one of those spans years, not weeks. So every one of them starts with a collection project.

There is a second trap underneath. Published figures get revised. Yesterday's numbers are provisional and get corrected over the following days; settlement-basis figures land weeks later. Which means a naive collector does not just take a long time — it produces numbers that are subtly, permanently wrong, in a way you will not notice until someone questions a total and you have no way to explain it.

The tax nobody puts in the proposal

I have watched this pattern from a distance enough times to recognise it.

An analyst, a research team, or a consultancy needs six years of grid history for a piece of work. Somebody writes a collection script. It runs for days, breaks halfway, gets restarted. The data lands in a pile of CSVs on somebody's laptop. The analysis gets done. It is good work.

Then, six months later, a follow-up question arrives. The script has rotted, the person who wrote it has moved on, the CSVs are on a laptop that got reimaged, and the figures cannot be reproduced from scratch anyway. So somebody writes a collection script.

The analysis was never the expensive part.

Building it once

So I built the version where that step does not exist: a warehouse holding six years of hourly, plant-level generation joined to hourly prices, that refreshes itself daily and can be rebuilt from an empty database.

Collection is a Python service. The warehouse is PostgreSQL. Superset sits on top for the views I look at repeatedly.

The interesting engineering is not in that list, and it is not in this post. It is in the details of surviving a long collection run against a metered API, and in the query design that makes fifty-five million rows behave like something you can filter interactively. Those were the parts worth getting right, and they took considerably longer than the parts that are easy to describe.

Three properties mattered more than any of the individual techniques:

Revisions land on their own. The daily job re-reads a trailing window rather than just yesterday, and reloading the same period never changes a total. Corrections arrive without anybody remembering to go and fetch them.

It rebuilds from empty. Schema, views, and dashboards all live in version control. A fresh clone reconstructs the entire stack. Analysis you cannot reconstruct is analysis you cannot defend.

Every number is traceable. Chart to view, view to table, table to the raw payload it came from. When a figure looks wrong, that chain is the difference between an afternoon and a shrug.

From a report to an instrument

The first version of the per-plant revenue report took about fifty seconds to answer.

That is not an unreasonable amount of time to join fifty-five million hourly rows against hourly prices. But fifty seconds is not a dashboard. Fifty seconds is a report you request, walk away from, and come back to — and that changes how you use it. You stop exploring. You stop asking the follow-up question, because the follow-up costs another fifty seconds and you have already got what you came for.

It now answers in roughly a tenth of a second.

Same data, same question, and a completely different relationship with it. Below about a second, you stop planning queries and start following hunches. Somebody sitting next to you can say "what about winter 2022?" and you just look. That threshold is the entire difference between a dataset you report from and a dataset you think with.

Dashboard showing daily total electricity generation for Türkiye broken down by source: imported coal, dammed hydro, wind, natural gas, lignite, river, geothermal, biomass, solar and others

Dashboards cover the questions I ask on repeat. But underneath is standard PostgreSQL, so anything I have not anticipated is a query away — from a notebook, a BI client, or a terminal. I did not want a tool. I wanted a substrate.

What travels

Very little of this is specific to Türkiye, or to EPİAŞ.

A metered public API, capped query windows, retroactively revised figures, tens of millions of hourly rows, and a price join nobody wants to wait on — that is the shape of essentially every liberalised electricity market that publishes settlement data. ENTSO-E's Transparency Platform has the same character across some thirty-five European countries: the data is there, the access is built for recent lookups, and anyone asking a multi-year question is on their own. The endpoints change. The fuel taxonomy changes. The problem does not, and neither does the solution.

Which is the part I keep coming back to. The hard problem in public market data is almost never access. It is that access is shaped for machines checking today's number, while everyone who wants to reason about history quietly rebuilds the same warehouse from scratch, privately, over and over, and throws it away when the project ends.

It only has to be built once.


The platform runs against the full six-year dataset today. If you work with this data and want to see it, I am happy to give a walkthrough — and it can be run as a managed instance or deployed on-premise, extended with additional datasets or market coverage. Reach me at [email protected].