sells market data, from exchanges like CME, through an API and client libraries. Its Python client turns a request into a pandas DataFrame in a few lines, so a small slip in those lines can look like missing or wrong data.
I opened an account and ran six questions a support engineer would get, with part of the free data credit new accounts receive. One full run of every case costs about US$0.06. Here's the checker first, then what each run settled and the reply I'd send.
Where preflight fits
Start with preflight
preflight takes the customer's request exactly as they wrote it, plus their time zone, and answers the first questions before anything is downloaded. It makes only metadata and symbology calls:
$ python preflight.py --dataset GLBX.MDP3 --schema ohlcv-1h --symbols ESZ6 \
--start 2026-11-23 --end 2026-11-24 --tz Asia/Kuala_Lumpur
[OK] API key accepted
[OK] Dataset GLBX.MDP3 exists
[OK] Schema ohlcv-1h is available for GLBX.MDP3
[WARN] "2026-11-23" has no time zone, so Databento reads it as Mon 2026-11-23 00:00 UTC.
That's Mon 2026-11-23 08:00 in Asia/Kuala_Lumpur. If you meant Asia/Kuala_Lumpur
time, send "2026-11-23T00:00:00+08:00" instead. ...
[INFO] The end is exclusive: the last record returned is just before Tue 2026-11-24 00:00
UTC.
[OK] The whole window is inside the available range
[OK] Every day in the window is marked available (1 day)
[OK] ESZ6 resolves to instrument_id 10252
[INFO] Estimated cost US$0.000228 for 23 records (1,288 billable bytes).
The window in three time zones (start inclusive, end exclusive):
UTC (as Databento reads it) Mon 2026-11-23 00:00 to Tue 2026-11-24 00:00
Asia/Kuala_Lumpur (customer) Mon 2026-11-23 08:00 to Tue 2026-11-24 08:00
America/Chicago (exchange) Sun 2026-11-22 18:00 to Mon 2026-11-23 18:00It checks that the key works, without ever printing it, and what's wrong with its shape if it doesn't. It flags any day marked degraded, pending or missing, resolves every symbol, prices the request, and shows the window in UTC, the customer's time zone and exchange time. The output is plain text, so it can go straight into a reply.
The warning that matters most in Asia is the one about plain dates. It builds the exact string to send instead:
if window.reads_differently:
pieces = []
if window.start_as_sent != window.start_as_meant:
pieces.append(
f'"{window.start_text}" has no time zone, so Databento reads it as '
f"{local(window.start_as_sent, UTC)} UTC. That's {local(window.start_as_sent, tz)} "
f"in {tz}. If you meant {tz} time, send "
f'"{iso_with_offset(window.start_as_meant, tz)}" instead.'
)
if window.end_as_sent != window.end_as_meant:
where = "the end Databento fills in" if window.end_was_filled else f'"{window.end_text}"'
pieces.append(
f"Likewise {where} is {local(window.end_as_sent, UTC)} UTC, which is "
f"{local(window.end_as_sent, tz)} in {tz}. For {tz} time, use "
f'"{iso_with_offset(window.end_as_meant, tz)}".'
)
out.append(("WARN", " ".join(pieces)))1. Monday data that starts at 8am
The question: a customer in Penang asks for start="2026-11-23", end="2026-11-24" to get Monday's hourly ES bars. The first bar is at 8am, and Tuesday morning's bars come too.
What the run showed: Databento reads dates as UTC unless told otherwise, and midnight UTC is 8am in Penang:
| Monday, 23 November | As written | With +08:00 |
|---|---|---|
| Bars | 23 | 17 |
| First bar, Penang time | Mon 08:00 | Mon 07:00 |
| Last bar, Penang time | Tue 07:00 | Mon 23:00 |
As written, the window misses Monday's 07:00 bar, the weekly open, and picks up seven Tuesday-morning bars. The API accepts an offset such as +08:00, although the docs' examples only show UTC.
The reply, in short: add the UTC offset, and have to_df show Penang time. The end is exclusive, so this stops just before midnight:
df = client.timeseries.get_range(
dataset="GLBX.MDP3", schema="ohlcv-1h", symbols=["ESZ6"],
start="2026-11-23T00:00+08:00", end="2026-11-24T00:00+08:00",
).to_df(tz="Asia/Kuala_Lumpur")2. Daily bars that don't match the broker's chart
The question: ohlcv-1d bars for ESZ6 don't match a broker's daily chart. Every close is different, and there's a tiny Sunday bar.
What the run showed: Databento's daily bars are UTC days, 8am to 8am in Penang, while futures charts usually show CME sessions, 17:00 to 16:00 in Chicago. Hourly bars grouped by UTC day reproduce ohlcv-1d exactly, and the same week gives three different sets of closes:
| ESZ6 close | UTC day | CME session | Penang day |
|---|---|---|---|
| Mon 16 Nov | 7445.00 | 7438.50 | 7507.75 |
| Tue 17 Nov | 7412.50 | 7366.50 | 7352.50 |
| Wed 18 Nov | 7372.25 | 7340.25 | 7344.00 |
| Thu 19 Nov | 7190.25 | 7182.50 | 7327.75 |
| Fri 20 Nov | 6966.75 | 6966.75 | 7110.25 |
The Sunday bar holds 18,573 contracts: the first hour of Monday's session, which opens at 23:00 UTC on Sunday. A customer in Penang would even see a "Saturday" with 1,756,933 contracts, because Friday's US session ends at 6am on Saturday in Penang.
The reply, in short: the data's fine, but it's cut into days differently. For session bars, request hourly bars and group them by trading date. These are last-trade closes, not CME's official settlement prices, so a chart built on settlements will still differ a little.
3. ES that returns nothing
The question: get_range on GLBX.MDP3 with symbols="ES" returns an empty DataFrame, with no error.
What the run showed: at CME, ES is the product, not a symbol you can request on its own. get_range returned 0 rows with only two warnings, while get_cost for the same request raised a 422. Here are the four ways to ask, each priced for one day of trades:
| symbols | stype_in | Instruments | One day of trades |
|---|---|---|---|
| ES | raw_symbol | 0 | error 422 |
| ESZ6 | raw_symbol | 1 | US$1.243950 |
| ES.c.0 | continuous | 1 | US$1.243950 |
| ES.FUT | parent | 41 | US$1.254976 |
The quieter version is worse. With symbols=["ES", "ESZ6"], the customer gets 23 rows, all ESZ6, and one warning: data, just not all of it.
The reply, in short: name one contract, the continuous front month or the parent, and check how a symbol resolves first with the free symbology call. The note for the team: name the likely fix in the warning, or raise the same 422 that get_cost does when nothing at all resolves.
4. A bill higher than expected
The question: one day of ES order-book data was expected to cost a few cents and came to a few dollars, and the estimate was higher than what was downloaded.
What the run showed: the schema drives the cost. These are free estimates from metadata.get_cost, for one day of the front month:
| Schema | Records | Estimate |
|---|---|---|
| ohlcv-1h | 23 | US$0.000228 |
| ohlcv-1m | 1,380 | US$0.005038 |
| trades | 993,810 | US$1.243950 |
| mbp-1 | 20,634,389 | US$2.767287 |
| mbo | 31,247,145 | US$2.933398 |
| mbp-10 | 26,109,638 | US$4.474235 |
Parent symbols matter more for some products than others. Asking for every contract and spread, not just the front month, added 1% to a day of ES trades, but made a day of CL's full order book 6.6 times as expensive. And estimates round up to 10-minute boundaries: a 14:00 to 14:15 slice was estimated at 52,161 records, and 43,714 came back, so the estimate was 19% too high, as the docs warn.
The reply, in short: price any request first with get_cost, which is free, set a monthly limit in the portal's billing settings, and use a batch job for data you'll fetch more than once.
5. An authentication error that repeats the key
The question: the key works in a notebook, but a script fails with BentoClientError 400 auth_invalid_username_in_basic_auth.
What the run showed, with made-up keys only:
| The customer's mistake | What they see |
|---|---|
| No key at all | ValueError: invalid API key, was None |
| A well-formed key that isn't valid | 401 auth_authentication_failed |
| A line break after the key | The 400 above, with the key in the message |
| The key pasted with its quotes | The same 400, with the quoted key |
Saved as DATABENTO_KEY | ValueError: invalid API key, was None |
That 400 message includes the key the customer sent, and customers paste errors into Slack and GitHub. So the reply shows how to strip the key, and asks them to rotate it if the error went anywhere public. preflight's key check catches four of the five before any request is sent. Only Databento can tell whether a well-formed key is valid.
The note for the team: don't echo the username in that error, or show only its last four characters.
6. NaN symbols that come and go
The question: requesting ES.c.0 and ES.v.0 together, some rows come back with symbol as NaN. Re-running the cell sometimes fixes it.
What the run showed: it's a known bug in the Python client, open as , and the runs found why it comes and goes. One download, converted with to_df() ten times, lost symbols on 5 of the 10 calls. The symbol mappings came back in a different order between reads of the same file, ES.v.0 first 21 times out of 40. to_df() adds those mappings to the client's symbol map on every call, and the lookup bug only bites in one of the orders.
The reply, in short: it's the client, not the data. Until there's a fix, request each symbol separately and combine the results:
frames = [
client.timeseries.get_range(
dataset="GLBX.MDP3", schema="ohlcv-1d", stype_in="continuous",
symbols=[symbol], start="2026-09-14", end="2026-09-24",
).to_df()
for symbol in ["ES.c.0", "ES.v.0"]
]
df = pd.concat(frames).sort_index()Two more things the runs turned up
- Every Sunday in November 2026 is flagged degraded on GLBX.MDP3, and no other day since August. Nothing on the status page explains it.
- With pandas 3.1,
to_df()prints a deprecation warning on every call, because the client usesinplace=True.
Support from UTC+8
The kit includes a one-page for running support from Penang. Its first table is the one I'd keep on the wall. These are November times, when the US is on standard time:
| Penang (UTC+8) | UTC | Chicago | What's happening |
|---|---|---|---|
| 06:00 | 22:00 | 16:00 | CME Globex closes for its daily break |
| 07:00 | 23:00 | 17:00 | CME Globex reopens. On Monday, this is the weekly open |
| 08:00 | 00:00 | 18:00 | A new UTC day: daily bars and plain dates roll over |
| 17:00 | 09:00 | 03:00 | London's working day starts |
| 22:30 | 14:30 | 08:30 | The US stock market opens |
So a "today" in Penang is mostly "yesterday" in Chicago, and anything a customer calls today's data before 08:00 is still yesterday in UTC. The house rule follows from that: every reply states the time window in UTC and in the customer's time zone.
How I used AI
I used Claude Code to read the client's source, write preflight and the cases, and draft the replies. Every claim on this page comes from a live run, and the runs corrected three first guesses. I expected get_range to raise an error for "ES"; it warns and returns nothing. I guessed a parent symbol always multiplies the cost; for ES, it barely changes it. And the first explanation of #147 blamed the order the server sends symbols in, until reading the same file 40 times showed the order changes between reads.
The key never appears. It's read from .env, and every report and transcript is scrubbed of it, including the base64 form HTTP Basic auth uses.
The sample
Everything above comes from : preflight, the six cases with their replies and transcripts, 41 offline tests that use a fake client, and the playbook. Every download is priced first, and a case stops if one would cost more than US$0.50.
frontline/timewin.py (293 lines)
"""
Time windows, seen three ways: as Databento reads them, as the customer meant
them, and in the exchange's own time.
The rules, from Databento's "Standards and conventions" docs:
- every timestamp parameter is UTC unless it carries an offset
- start is inclusive and end is exclusive
- a missing end is "forward filled": "2026-11-23" alone means that whole UTC day
Customers in Asia usually mean their own local day, and futures traders
usually mean the exchange's trading session. Most "missing data" tickets from
APAC hours come from that gap, so this module puts the three side by side.
"""
from __future__ import annotations
import re
from dataclasses import dataclass
from datetime import timedelta
import pandas as pd
# Exchange time zones, by the venue code before the dot in a dataset name.
EXCHANGE_TZ = {
"GLBX": "America/Chicago", # CME Globex
"XNAS": "America/New_York", # Nasdaq
"XNYS": "America/New_York", # NYSE
"OPRA": "America/New_York", # US equity options
"EQUS": "America/New_York", # Databento US equities
"DBEQ": "America/New_York",
"IFUS": "America/New_York", # ICE Futures US
"IFEU": "Europe/London", # ICE Futures Europe
"NDEX": "Europe/Amsterdam", # ICE Endex
"XEUR": "Europe/Berlin", # Eurex
}
UTC = "UTC"
# How precise a timestamp string is decides how Databento fills in a missing end.
_PRECISION = [
(re.compile(r"^\d{4}$"), "year"),
(re.compile(r"^\d{4}-\d{2}$"), "month"),
(re.compile(r"^\d{4}-\d{2}-\d{2}$"), "day"),
(re.compile(r"^\d{4}-\d{2}-\d{2}[T ]\d{2}$"), "hour"),
(re.compile(r"^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}$"), "minute"),
]
_OFFSET = re.compile(r"(Z|[+-]\d{2}:?\d{2})$", re.IGNORECASE)
def exchange_tz(dataset: str) -> str | None:
"""The exchange's time zone for a dataset like "GLBX.MDP3", if known."""
return EXCHANGE_TZ.get(dataset.split(".")[0].upper())
def _is_nanoseconds(text: str) -> bool:
"""A long run of digits is nanoseconds since 1970. Four digits on their own are a year."""
return text.isdigit() and len(text) > 4
def has_offset(text: str) -> bool:
"""True if the timestamp says which time zone it's in (Z, +08:00 and so on)."""
text = text.strip()
if text.isdigit() or not _OFFSET.search(text):
return False
try:
return pd.Timestamp(text).tzinfo is not None
except ValueError:
return False
def _parse_naive(text: str) -> pd.Timestamp:
"""Parse a timestamp with no zone, including short forms like "2026", "2026-11" or "2026-11-23T08"."""
text = text.strip()
if re.fullmatch(r"\d{4}", text):
text += "-01-01"
elif re.fullmatch(r"\d{4}-\d{2}", text):
text += "-01"
elif re.fullmatch(r"\d{4}-\d{2}-\d{2}[T ]\d{2}", text):
text += ":00"
return pd.Timestamp(text)
def forward_fill(text: str, tz: str) -> pd.Timestamp:
"""The end Databento fills in when only a start is given: the start rounded up.
Only timestamps given to the minute or coarser are filled in, as the docs say.
"""
start = _parse_naive(text).tz_localize(tz)
for pattern, unit in _PRECISION:
if pattern.match(text.strip()):
step = {
"year": pd.DateOffset(years=1),
"month": pd.DateOffset(months=1),
"day": pd.DateOffset(days=1),
"hour": pd.DateOffset(hours=1),
"minute": pd.DateOffset(minutes=1),
}[unit]
return start + step
raise ValueError(
f'No end was given, and "{text}" is more precise than a minute, so Databento '
"won't fill one in. Give an end as well."
)
def _interpret(text: str, tz: str) -> tuple[pd.Timestamp, pd.Timestamp]:
"""Return (as Databento reads it, as the customer probably meant it), both in UTC."""
text = text.strip()
if _is_nanoseconds(text): # nanoseconds since 1970, always UTC
ts = pd.Timestamp(int(text), unit="ns", tz=UTC)
return ts, ts
if has_offset(text):
ts = pd.Timestamp(text).tz_convert(UTC)
return ts, ts
naive = _parse_naive(text)
return naive.tz_localize(UTC), naive.tz_localize(tz).tz_convert(UTC)
@dataclass
class Window:
"""A request's time window, both as sent and as meant."""
start_text: str
end_text: str | None
customer_tz: str
start_as_sent: pd.Timestamp
end_as_sent: pd.Timestamp
start_as_meant: pd.Timestamp
end_as_meant: pd.Timestamp
@property
def end_was_filled(self) -> bool:
return self.end_text is None
@property
def reads_differently(self) -> bool:
"""True when Databento will read the window differently from what the customer meant."""
return (self.start_as_sent, self.end_as_sent) != (self.start_as_meant, self.end_as_meant)
def interpret_window(start: str, end: str | None, customer_tz: str = UTC) -> Window:
start_sent, start_meant = _interpret(start, customer_tz)
if end is None:
if has_offset(start) or _is_nanoseconds(start.strip()):
raise ValueError("Give an end as well: Databento only fills in an end for plain dates and times.")
end_sent = forward_fill(start, UTC)
end_meant = forward_fill(start, customer_tz).tz_convert(UTC)
else:
end_sent, end_meant = _interpret(end, customer_tz)
return Window(start, end, customer_tz, start_sent, end_sent, start_meant, end_meant)
def local(ts: pd.Timestamp, tz: str) -> str:
"""A timestamp in a given zone, with the weekday, e.g. "Mon 2026-11-23 08:00"."""
t = ts.tz_convert(tz)
seconds = ":%S" if t.second or t.microsecond or t.nanosecond else ""
return t.strftime(f"%a %Y-%m-%d %H:%M{seconds}")
def iso_with_offset(ts: pd.Timestamp, tz: str) -> str:
"""The timestamp written in the customer's zone, ready to paste into a request."""
return ts.tz_convert(tz).isoformat()
def on_ten_minute_boundary(ts: pd.Timestamp) -> bool:
return ts.minute % 10 == 0 and ts.second == 0 and ts.microsecond == 0 and ts.nanosecond == 0
def cme_weekend_close(start: pd.Timestamp, end: pd.Timestamp) -> bool:
"""True if the whole window falls in CME Globex's weekend close.
Most CME Globex products stop on Friday at 16:00 Chicago time and reopen
on Sunday at 17:00. Some products (grains, for example) keep shorter
hours, and holidays aren't covered here.
"""
chicago = "America/Chicago"
s = start.tz_convert(chicago)
days_since_friday = (s.weekday() - 4) % 7
friday = (s - pd.Timedelta(days=days_since_friday)).date()
close_starts = pd.Timestamp(f"{friday} 16:00").tz_localize(chicago)
reopens = pd.Timestamp(f"{friday + timedelta(days=2)} 17:00").tz_localize(chicago)
return close_starts <= start and end <= reopens
def weekend_in(start: pd.Timestamp, end: pd.Timestamp, tz: str) -> bool:
"""True if the whole window falls on a Saturday or Sunday in the given zone."""
s, e = start.tz_convert(tz), (end - pd.Timedelta(1, "ns")).tz_convert(tz)
whole_days = pd.date_range(s.normalize(), e.normalize(), freq="D")
return all(day.weekday() >= 5 for day in whole_days)
def cme_trading_date(ts: pd.Timestamp) -> pd.Timestamp:
"""The CME trading date a timestamp belongs to.
For products that open at 17:00 Chicago time, the session that opens on
Sunday evening is Monday's trading date. Adding 7 hours to Chicago time
moves 17:00 to midnight, so the date then reads correctly.
"""
return (ts.tz_convert("America/Chicago") + pd.Timedelta(hours=7)).normalize().tz_localize(None)
def notes(window: Window, dataset: str, schema: str) -> list[tuple[str, str]]:
"""Plain-English notes about the window, as (level, message) pairs."""
out: list[tuple[str, str]] = []
tz = window.customer_tz
if window.end_as_sent <= window.start_as_sent:
out.append(("FAIL", "The end isn't after the start, so the request can't return anything."))
return out
if window.start_as_sent > pd.Timestamp.now(tz=UTC):
out.append(("FAIL", "The window starts in the future."))
if window.reads_differently:
pieces = []
if window.start_as_sent != window.start_as_meant:
pieces.append(
f'"{window.start_text}" has no time zone, so Databento reads it as '
f"{local(window.start_as_sent, UTC)} UTC. That's {local(window.start_as_sent, tz)} "
f"in {tz}. If you meant {tz} time, send "
f'"{iso_with_offset(window.start_as_meant, tz)}" instead.'
)
if window.end_as_sent != window.end_as_meant:
where = "the end Databento fills in" if window.end_was_filled else f'"{window.end_text}"'
pieces.append(
f"Likewise {where} is {local(window.end_as_sent, UTC)} UTC, which is "
f"{local(window.end_as_sent, tz)} in {tz}. For {tz} time, use "
f'"{iso_with_offset(window.end_as_meant, tz)}".'
)
out.append(("WARN", " ".join(pieces)))
if window.end_was_filled:
out.append(
(
"INFO",
f"No end was given, so Databento fills it in by rounding the start up: "
f"{local(window.end_as_sent, UTC)} UTC.",
)
)
out.append(
(
"INFO",
f"The end is exclusive: the last record returned is just before {local(window.end_as_sent, UTC)} UTC.",
)
)
if schema == "ohlcv-1d":
out.append(
(
"INFO",
"ohlcv-1d bars are UTC days (00:00 to 24:00 UTC), not exchange sessions and "
"not your local days, so they won't match a broker's daily chart. To get "
"session bars, request ohlcv-1h and group the hours yourself.",
)
)
venue = dataset.split(".")[0].upper()
if venue == "GLBX" and cme_weekend_close(window.start_as_sent, window.end_as_sent):
out.append(
(
"WARN",
"The whole window falls in CME Globex's weekend close (Friday 16:00 to Sunday "
"17:00 Chicago time for most products), so expect no trades.",
)
)
elif venue != "GLBX" and exchange_tz(dataset) and weekend_in(
window.start_as_sent, window.end_as_sent, exchange_tz(dataset)
):
out.append(("WARN", "The whole window falls on a weekend in exchange time, so expect no data."))
if not (on_ten_minute_boundary(window.start_as_sent) and on_ten_minute_boundary(window.end_as_sent)):
out.append(
(
"INFO",
"The start or end isn't on a 10-minute boundary. Databento's docs say size "
"estimates may then be overstated (12:10 is fine, 12:15 isn't).",
)
)
return out
def table(window: Window, dataset: str) -> list[tuple[str, str]]:
"""Rows of (label, window) for the report: UTC, the customer's zone, and the exchange's."""
out = [("UTC (as Databento reads it)", f"{local(window.start_as_sent, UTC)} to {local(window.end_as_sent, UTC)}")]
zones = []
if window.customer_tz != UTC:
zones.append((f"{window.customer_tz} (customer)", window.customer_tz))
ex = exchange_tz(dataset)
if ex:
zones.append((f"{ex} (exchange)", ex))
for label, tz in zones:
out.append((label, f"{local(window.start_as_sent, tz)} to {local(window.end_as_sent, tz)}"))
return outTo run it, you need Python 3.11 or later. The tests need no key and no network. The live parts need a Databento account, and new accounts get US$125 of free credit.