Query 136 million observations directly with SQL over Arrow Flight SQL — from Python (ADBC), Excel Power Query, Tableau, or Power BI (ODBC). DuckDB dialect, Arrow-speed columnar results.
Looking for the native clients instead? Python: pip install energyscope-client
(import energyscope as es; es.Client("YOUR_API_KEY")) ·
Excel: download the add-in and =ES.Key("YOUR_API_KEY").
This page covers the SQL routes.
| Route | URI | Python native / pyarrow | ADBC / ODBC |
|---|---|---|---|
| Internet (TLS) | grpc+tls://data.energyscope.io:443 |
works | not yet* |
| Private (VPN / on-prem) | grpc://<your-server>:8815 |
works | works |
Use your API key as the username — the password is ignored (empty or anything).
Don't have a key? Request one here; the demo key works for
a quick evaluation.
| Table | Rows | Key columns |
|---|---|---|
series_data | 136,052,261 | series_id (text), period (text, YYYYMMDD), value (double) |
series_meta | 5,663,860 | series_id + name, units, frequency, dataset… |
series_id (and ideally period) — a filtered
single-series pull returns in ~200 ms; loading the whole 136M-row table into a BI tool will not.
# pip install adbc-driver-flightsql adbc-driver-manager
import adbc_driver_flightsql.dbapi as flightsql
conn = flightsql.connect(
"grpc://<your-server>:8815",
db_kwargs={"username": "YOUR_API_KEY", # the API key IS the username
"password": ""}, # ignored — required by Basic auth only
)
cur = conn.cursor()
cur.execute("""
SELECT period, value
FROM series_data
WHERE series_id = 'FRED.DFF'
ORDER BY period
""")
df = cur.fetch_df() # pandas DataFrame
# tbl = cur.fetch_arrow_table() # or zero-copy Arrow
-- discover series
SELECT * FROM series_meta WHERE series_id ILIKE '%RCLC1%' LIMIT 20;
-- date-typed periods (DuckDB dialect)
SELECT CAST(strptime(period, '%Y%m%d') AS DATE) AS d, value
FROM series_data WHERE series_id = 'PET.RCLC1.D' ORDER BY d;
-- coverage check
SELECT series_id, COUNT(*) AS n, MIN(period) AS first, MAX(period) AS last
FROM series_data
WHERE series_id IN ('FRED.DFF', 'PET.RCLC1.D')
GROUP BY series_id;
8815,
username = your API key, password = anything, encryption off for private routes.Connection string form:
Driver={Arrow Flight SQL ODBC Driver};HOST=<your-server>;PORT=8815;UID=YOUR_API_KEY;PWD=x;useEncryption=false
Data → Get Data → From Other Sources → From ODBC → pick the DSN → expand Advanced options and paste a SQL statement:
SELECT CAST(strptime(period, '%Y%m%d') AS DATE) AS date, value
FROM series_data WHERE series_id = 'FRED.DFF' ORDER BY date
Connect → To a Server → Other Databases (ODBC) → pick the DSN → use Custom SQL.
Get Data → ODBC → DSN → SQL statement under Advanced options.
| Operation | Time |
|---|---|
| Connect + authenticate (ADBC) | 83 ms |
COUNT(*) over 136M rows | 177 ms |
| Full history, one series (13,331 rows) | 202 ms |
GROUP BY series_id over all 136M rows | ~9.6 s |
Measured 2026-07-09 on a private route. SQL runs in an embedded DuckDB engine reading year-partitioned Parquet directly; results stream back as Arrow record batches — zero-copy columnar data end to end.