Connect with SQL

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.

Endpoints

RouteURIPython native / pyarrowADBC / ODBC
Internet (TLS) grpc+tls://data.energyscope.io:443 works not yet*
Private (VPN / on-prem) grpc://<your-server>:8815 works works
* Known limitation: the public TLS endpoint currently rejects the Go-based Flight SQL drivers (ADBC, ODBC, Tableau, Power BI) at the prepared-statement step — a proxy-layer issue, not an authentication problem. These clients work fully on private routes (VPN tunnel or on-premise deployments). A direct TLS gRPC endpoint for BI tools is planned. The Excel add-in and Python clients are unaffected everywhere.

Authentication

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.

Tables

TableRowsKey columns
series_data136,052,261 series_id (text), period (text, YYYYMMDD), value (double)
series_meta5,663,860 series_id + name, units, frequency, dataset…
Always filter on 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.

Python — ADBC

# 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

Useful queries

-- 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;

Excel / Tableau / Power BI — Flight SQL ODBC

  1. Install the free Arrow Flight SQL ODBC driver from dremio.com/drivers (64-bit Windows MSI).
  2. Open ODBC Data Sources (64-bit) → System DSN → Add → Arrow Flight SQL ODBC Driver.
  3. Configure: Host = your server address, Port = 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

Excel

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

Tableau

Connect → To a Server → Other Databases (ODBC) → pick the DSN → use Custom SQL.

Power BI

Get Data → ODBC → DSN → SQL statement under Advanced options.

Measured performance

OperationTime
Connect + authenticate (ADBC)83 ms
COUNT(*) over 136M rows177 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.

Get an API key →