Skip to content

[BACKEND] Get the weather forecast and energy production for the next 7 days using an OpenMeteo API

License

Notifications You must be signed in to change notification settings

kamiderka/weather-forecast-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather (and Energy) Forecast API

DescriptionRunEndpoints

Description

An application to display the weather forecast for the next 7 days using an external API. Additionally, the application estimates the forecasted energy production from a photovoltaic installation.

Run

From repository

git clone https://github.com/kamiderka/weather-forecast-api.git
cd weather-forecast-api
pip install -r requirements.txt
fastapi run src/main.py

From Dockerfile

git clone https://github.com/kamiderka/weather-forecast-api.git
cd weather-forecast-api
docker build -t toringen/weather-forecast-api:latest .
docker run -p 8080:8080  toringen/weather-forecast-api:latest

Pull image from DockerHub

docker pull toringen/weather-forecast-api:latest
docker run -p 8080:8080  toringen/weather-forecast-api:latest

or... you can contact me to get URL to my Azure deployment

Endpoints

Unfortunately there is only one (but still amazing) endpoint:

GET /forecast

Get the weather forecast and estimate energy production from a photovoltaic installation for the next 7 days based on specified latitude and longitude coordinates.

Query Parameters

Name Required Type Description
latitude required float Supported values: <-90.0;90.0>
longitude required float Supported values: <-180.0;180.0>

Response

[
    {
        "date": "2024-05-15T00:00:00+00:00",
        "weatherCode": 80,
        "temperatureMax": 28,
        "temperatureMin": 27,
        "energy": 5.24
    },
    
]

or

{
    "detail": "Latitude should be in range <-90°:90°>. Given: 1223.0"
}

About

[BACKEND] Get the weather forecast and energy production for the next 7 days using an OpenMeteo API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published