API Documentation
Comprehensive guide to using the Energy Simulations API
Overview
The Energy Simulations API provides RESTful endpoints for energy price prediction, solar production estimation, and battery storage optimization. All endpoints accept and return JSON data.
Interactive Documentation
For interactive API testing, visit the Swagger UI which allows you to try endpoints directly in your browser.
Base URL
All API endpoints are relative to this base URL. In production, replace with your deployment URL.
Authentication
Currently, the API does not require authentication for public datasets and models. Private resources require session-based authentication via the web interface.
/health
Check if the API is running and get system status information.
200 Success
/api/datasets
Retrieve a list of all available datasets (public and private).
Parameters
| Name | Type | Description |
|---|---|---|
| include_publicoptional | boolean | Include public datasets in the response. Default: true |
200 Success
/api/upload-dataset
Upload a new dataset to the platform. Accepts CSV files up to 50MB.
Request Body (multipart/form-data)
| Field | Type | Description |
|---|---|---|
| filerequired | file | CSV file to upload |
| is_publicoptional | boolean | Make dataset publicly accessible. Default: false |
/train/{model_type}
Train a machine learning model on a dataset. Supported types: price, production.
Path Parameters
| Name | Type | Description |
|---|---|---|
| model_typerequired | string | Type of model: "price" or "production" |
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
| dataset_pathrequired | string | Path to the dataset file |
| target_columnrequired | string | Column name to predict |
| model_nameoptional | string | Custom name for the saved model |
| algorithmoptional | string | "random_forest" or "neural_network". Default: random_forest |
200 Success
/predict/{model_type}
Make predictions using a trained model. Supports both single and batch predictions.
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
| model_pathrequired | string | Path to the trained model file |
| featuresrequired | object | array | Feature values for prediction (single object or array for batch) |
/simulate
Run a battery storage simulation with specified parameters.
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
| dataset_pathrequired | string | Path to price dataset |
| battery_capacityrequired | number | Battery capacity in kWh |
| charge_rateoptional | number | Charging rate in kW. Default: capacity / 4 |
| efficiencyoptional | number | Round-trip efficiency (0-1). Default: 0.9 |
/api/solar/potential
Get solar production potential for a specific location.
Query Parameters
| Name | Type | Description |
|---|---|---|
| latrequired | number | Latitude (-90 to 90) |
| lonrequired | number | Longitude (-180 to 180) |
| capacity_kwpoptional | number | System capacity in kWp. Default: 1.0 |