Skip to content

Web API

PVGIS provides a FastAPI-based web service for programmatic access to solar calculations and photovoltaic performance analysis. If you wish to run and test the Web API server, you can follow the following instructions

Quick Start

pip install .[web]
uvicorn pvgisprototype.webapi:app --reload

Visit http://127.0.0.1:8000 for the interactive API documentation.

What You Can Do

The Web API exposes almost the same calculations available through the CLI and the core Python API:

  • Performance Analysis - System efficiency and energy yield
  • PV Power - Photovoltaic system output calculations
  • Optimal Solar Surface Positioning - Sun angles at any location and time

Architecture

HTTP Request → FastAPI Endpoints → Core API → Algorithms → JSON Response

The Web API is a thin REST layer over PVGIS' core calculation engine, ensuring consistency across all interfaces.

Documentation Sections

  • Install - Set up FastAPI and uvicorn
  • Run - Launch and configure the server
  • Examples - Sample requests and responses

Interactive Documentation

When running, FastAPI automatically generates interactive docs:

These interfaces let you test endpoints directly in your browser.

For Developers

See Web API Source Code for implementation details.