A FastAPI application for electricity pricing in the Netherlands, fetching data from EnergyZero API.
- View electricity prices for 24 hours
- Statistics showing lowest, average, and highest prices
- Visual chart showing price distribution
- Buy/Sell recommendations based on 6 cheapest and 6 most expensive hours
- Both HTML and JSON API endpoints
/- Home page with all available endpoints/prices- View all electricity prices (HTML)/gemiddeld- View price statistics with chart (HTML)/kopen- Check if current hour is good for buying (HTML)/verkopen- Check if current hour is good for selling (HTML)/api/prices- Get prices as JSON/api/kopen- Get buying status as JSON/api/verkopen- Get selling status as JSON/health- Health check endpoint/docs- Interactive API documentation (Swagger UI)
docker build -t stroomprijs-api .
docker run -d -p 8000:8000 --name stroomprijs stroomprijs-apidocker-compose up -ddocker-compose downdocker-compose logs -fpython3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtuvicorn main:app --reloadOpen your browser and go to:
- http://localhost:8000 - Home page
- http://localhost:8000/docs - API documentation
docker build -t stroomprijs-api .docker run -d -p 8000:8000 --name stroomprijs stroomprijs-apidocker stop stroomprijsdocker start stroomprijsdocker rm stroomprijsdocker logs stroomprijs
docker logs -f stroomprijs # Follow logsdocker exec -it stroomprijs /bin/bashThe application uses the Amsterdam timezone (Europe/Amsterdam) for all time-based calculations.
{
"status": "OK",
"action": "kopen",
"message": "Huidige uur is in de 6 goedkoopste uren - kopen aanbevolen",
"current_hour": 3,
"current_time": "2026-01-08 03:45:12"
}{
"status": "neutraal",
"action": "verkopen",
"message": "Neutraal - niks doen",
"current_hour": 12,
"current_time": "2026-01-08 12:30:45"
}- FastAPI - Modern web framework
- Uvicorn - ASGI server
- Chart.js - Data visualization
- EnergyZero API - Price data source
- Python 3.11
- Docker & Docker Compose