Query EIA dataset data
eia_get_dataFilter and page through EIA dataset rows by specifying route, data columns, facets, and date range, with sorting options.
Instructions
Query rows from an EIA dataset with filtering, sorting, and paging.
Returns a structured payload: { "route", "frequency", "description", "total": , "offset", "length", "returned": , "has_more": , "next_offset": <int | None>, "data": [ {row}, ... ], "warnings": [ ... ] # present only when relevant }
Workflow: use eia_browse_routes to find the route, its valid
data_columns, frequencies, and facet ids; use eia_get_facet_options
for valid facet values; then call this tool. If data columns are wrong
the API may return empty rows, so verify columns against the metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Inclusive end period, same format as `start`. | |
| data | Yes | Data columns to return, e.g. ['revenue', 'sales', 'price']. Valid columns are listed in the dataset metadata from eia_browse_routes (the 'data_columns' field). At least one column is usually required for the API to return values. | |
| sort | No | Sort spec, e.g. [{'column': 'period', 'direction': 'desc'}]. 'direction' is 'asc' or 'desc'. | |
| route | Yes | Leaf dataset route to query, e.g. 'electricity/retail-sales'. Discover with eia_browse_routes. | |
| start | No | Inclusive start period. Format must match the dataset frequency, e.g. '2020' (annual), '2020-01' (monthly), '2020-01-01' (daily), '2020-01-01T00' (hourly). | |
| facets | No | Facet filters as {facet_id: [values]}, e.g. {'stateid': ['CA'], 'sectorid': ['RES']}. Discover facet ids with eia_list_facets and valid values with eia_get_facet_options. | |
| length | No | Max rows to return (page size). 1..5000. Keep small for exploration; increase to page through data. | |
| offset | No | Row offset for pagination. Use `next_offset` from a prior call. | |
| frequency | No | Data frequency id, e.g. 'monthly', 'annual', 'hourly'. Valid values are in the dataset 'frequencies' metadata. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||