Get Price History
opa_get_historyRetrieve historical price data for any commodity over day, week, month, or year periods. Includes high, low, average, change, and data point count, plus point-in-time views for backtesting.
Instructions
Get historical price data for a commodity over a time period. Use when the user asks about price trends, historical prices, or how a commodity has performed over time. Returns high, low, average, change, and data point count. Periods: day (24h), week (7d), month (30d), year (365d). Supports point-in-time (vintage) queries via as_of: the series as it was knowable at that instant — later-collected rows absent, later revisions rolled back (no lookahead bias; built for backtests). Requires a paid plan (Developer, $19/mo, and up) — the free tier serves latest prices only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as_of | No | Optional ISO8601 date/datetime for a point-in-time (vintage) view, e.g. '2026-06-02'. Returns the series as it was knowable then: rows collected later are absent and values revised later are rolled back. Must not be in the future. Revision-correction coverage since 2026-07-28. | |
| period | No | Time period: day, week, month, or year (default: month) | month |
| commodity | Yes | Commodity name or code (e.g., 'brent', 'WTI_USD') |