v2

latestOpenAPI 3.1.02026-07-312954143.9 KB
Query Data

Query Dataset

Query a dataset and return matching rows as JSON or CSV.

Pass the X-Stream: true request header to stream JSON rows directly from a Postgres server-side cursor instead of buffering the entire result set in memory first (JSON only; ignored for CSV and external datasets). In streaming mode the result-dependent X-Has-Next-Page and X-rows-in-response headers are omitted -- read pagination from the JSON meta.hasNextPage and meta.cursor fields, which are populated identically on both paths.

get/datasets/{dataset_id}/query

Path parameters

dataset_idstring required

ID of the dataset to query

ID of the dataset to query

Query parameters

api_keystring nullable

API key for authentication (query)

API key for authentication (query)

order'asc' | 'desc'

The order to order results by

filter_columnstring nullable

The column to filter results by

The column to filter results by

integer
OR
number
OR
string

The value to filter results by

filter_operator'=' | '!=' | '>' | '>=' | '<' | '<=' | 'in'
limitinteger nullable

The maximum number of rows to return across all pages

The maximum number of rows to return across all pages

pageinteger

The page number of results to return

The page number of results to return

page_sizeinteger nullable

The maximum number of rows to return in a single page

The maximum number of rows to return in a single page

string[]
OR
string

Comma separated list of columns to return. Defaults to all columns.

cursorstring nullable
timezonestring nullable

The timezone to use when interpreting timezone naive timestamps, resampling to frequencies one day or more, and returning results. A value of marketcan be provided to return results in the timezone of the source ISO for the dataset. If market is specified and the dataset does not have a source ISO, the timezone will default to UTC for the query. When provided, columns in the timezone will be suffixed with _local.

The timezone to use when interpreting timezone naive timestamps, resampling to frequencies one day or more, and returning results. A value of marketcan be provided to return results in the timezone of the source ISO for the dataset. If market is specified and the dataset does not have a source ISO, the timezone will default to UTC for the query. When provided, columns in the timezone will be suffixed with _local.

string
OR
string date-time

The time to filter results. Cannot be used with start_time or end_time.

Possible values:

  • 'latest': Fetches the most recently reported data point.

  • A specific timestamp string (ISO 8601 format): Returns records that were published at the provided timestamp.

time_comparison'=' | '>' | '>=' | '<' | '<=' nullable

The comparison operator to use when filtering by time.

Possible values:

  • '=': Fetches the data at the exact time.

  • '>': Fetches the earliest data after the provided time.

  • '>=': Fetches the earliest data on or after the provided time.

  • '<': Fetches the latest data before the provided time.

  • '<=': Fetches the latest data on or before the provided time.

The comparison operator to use when filtering by time.

Possible values:

  • '=': Fetches the data at the exact time.

  • '>': Fetches the earliest data after the provided time.

  • '>=': Fetches the earliest data on or after the provided time.

  • '<': Fetches the latest data before the provided time.

  • '<=': Fetches the latest data on or before the provided time.

string
OR
string date-time

The start time to filter results using the dataset's time_index_column. Data on or after this time will be returned. Only applies to datasets with a time_index_column

string
OR
string date-time

The end time to filter results using the dataset's time_index_column. Data before this time will be returned. Only applies to datasets with a time_index_column

string
OR
string date-time

Controls the filtering based on the dataset's publish time.

Cannot be combined with publish_time_start or publish_time_end.Note: a dataset must have a time index column to use 'latest' or 'latest_before:' options.

Possible values:

  • 'latest_report': Returns records only from the most recently published report.

  • 'latest': For any given timestamp, fetches the most recently reported data point associated with it.

  • A specific timestamp string (ISO 8601 format): Returns records that were published at the provided timestamp.

  • 'latest_before:<offset>': Return the most recent forecast for each operating time where publish_time <= operating_time + offset (e.g., 'latest_before:-6 hours').

  • 'latest_before': shorthand for 'latest_before:-0 hours'. Used to get the most recent forecast prior to each operating time. This is useful because some forecasts are published after the operating time they are forecasting for.

  • 'latest_before:<offset>@HH:MM:SS': Return the latest forecast published before the specified time on the offset day (e.g., 'latest_before:-1 day@10:00:00').

  • 'window':<offset>: Returns all forecasts for each operating time published between the specified offset from the operating time and the operating time. In other words, where operating_time + offset <= publish_time <= operating_time. (e.g., 'window:-6 hours').

  • 'window:<offset>@HH:MM:SS': Returns all forecasts for each operating time published between the specified time on the offset day from the operating time and the operating time (e.g., 'window:-1 day@10:00:00').

  • None: No filtering based on publish time.

string
OR
string date-time

The start time to filter results using the dataset's publish_time_column. Data on or after this time will be returned up to the publish_time_end if provided. Only applies to datasets with a publish_time_column. Cannot be used with publish_time.

string
OR
string date-time

The end time to filter results using the dataset's publish_index_column. Data before this time will be returned down the publish_time_start if provided. Only applies to datasets with a publish_time_column. Cannot be used with publish_time.

resample_frequencystring nullable

The frequency to resample the data to. Must be one of:

  • "1 minute"
  • "5 minutes"
  • "10 minutes"
  • "15 minutes"
  • "1 hour"
  • "1 day"
  • "1 week"
  • "1 month"
  • "1 year"

When resampling_frequency is specified, start_time and end_time values must also be provided. The only exception to this is when querying datasets that have a publish time and the publish time is specified as a specific timestamp or 'latest_report'.

Additionally, the number of days of data that can be queried is limited based on the resample frequency. The maximum number of days of data that can be queried for each resample frequency is listed below. There is no limit on days for resample frequencies not listed below.

  • 1 minute: 31 days
  • 5 minutes: 100 days
  • 10 minutes: 120 days
  • 15 minutes: 180 days
  • 1 hour: 365 days
  • 1 day: 1825 days

The frequency to resample the data to. Must be one of:

  • "1 minute"
  • "5 minutes"
  • "10 minutes"
  • "15 minutes"
  • "1 hour"
  • "1 day"
  • "1 week"
  • "1 month"
  • "1 year"

When resampling_frequency is specified, start_time and end_time values must also be provided. The only exception to this is when querying datasets that have a publish time and the publish time is specified as a specific timestamp or 'latest_report'.

Additionally, the number of days of data that can be queried is limited based on the resample frequency. The maximum number of days of data that can be queried for each resample frequency is listed below. There is no limit on days for resample frequencies not listed below.

  • 1 minute: 31 days
  • 5 minutes: 100 days
  • 10 minutes: 120 days
  • 15 minutes: 180 days
  • 1 hour: 365 days
  • 1 day: 1825 days
string[]
OR
string

A comma separated list of columns to group by before resampling.

  • When resampling, the data is always grouped by the time index column of the dataset.

  • If a value is provided for resample_by, the data will be grouped by the provided columns in addition to the time index column.

  • If the dataset has a subseries index and no value is provided for resample_by, the data will also be grouped by the subseries index column.

  • If the dataset has a publish time column and the publish_time parameter is not 'latest', the data will also be grouped by the publish time column.

resample_function'mean' | 'sum' | 'min' | 'max' | 'count' | 'stddev' | 'variance'

The function to use when resampling. Defaults to "mean". Possible values are "mean", "sum", "min", "max", "count", "stddev", "variance". If resample is None, this is ignored.

return_format'json' | 'csv'

The return format of the response

downloadboolean

Whether to download the file or not

Whether to download the file or not

json_schema'array-of-objects' | 'array-of-arrays'

The json schema of the response

Headers

x-api-keystring nullable

API key for authentication (header)

API key for authentication (header)

Response

Successful response

OR