indicators subcommand provides operations for listing, searching, and fetching indicator data.
Commands
list
List all available ESIOS indicators.--token, -t TEXT— ESIOS API key (overrides config/env)--format, -f TEXT— Output format:table,csv,json(default:table)
search
Search indicators by name (substring match).QUERY— Search query (name substring)
--token, -t TEXT— ESIOS API key--format, -f TEXT— Output format:table,csv,json(default:table)
meta
Show detailed metadata for an indicator including unit, granularity, geographies, and last update time.INDICATOR_ID— Indicator ID (required)
--token, -t TEXT— ESIOS API key--format, -f TEXT— Output format:table,json(default:table)
history
Get historical data for an indicator over a date range.INDICATOR_ID— Indicator ID (required)
--start, -s TEXT— Start date inYYYY-MM-DDformat (required)--end, -e TEXT— End date inYYYY-MM-DDformat (required)--geo, -g TEXT— Filter by geo ID or name (can be repeated for multiple geos)--token, -t TEXT— ESIOS API key--format, -f TEXT— Output format:table,csv,json,parquet(default:table)--output, -o TEXT— Output file path (required for parquet format)
exec
Fetch indicator data and evaluate a Python expression on it. This command provides powerful data analysis capabilities directly from the command line.INDICATOR_IDS— One or more indicator IDs (space-separated)
--start, -s TEXT— Start date inYYYY-MM-DDformat (required)--end, -e TEXT— End date inYYYY-MM-DDformat (required)--expr, -x TEXT— Python expression to evaluate (default:"df")--geo, -g TEXT— Filter by geo ID or name (can be repeated)--token, -t TEXT— ESIOS API key--format, -f TEXT— Output format:table,csv,json(default:table)--output, -o TEXT— Output file path
df— pandas DataFrame with the fetched datapd— pandas modulenp— numpy module
Common Patterns
Date Range Best Practices
Indicators have different granularities (hourly, daily, monthly). Always check metadata first:Geography Handling
Indicators may have one or multiple geographies:Performance Tips
- Use caching — Repeated queries are served from cache automatically
- Limit date ranges — Fetch only the data you need
- Use parquet for large exports — More efficient than CSV for large datasets
