Skip to content

sahilm8/weather_proxy_svc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Proxy API

Java Spring

Maintenance

License: MIT

A proxy API returning weather data from Open-Meteo.

Stack

  • Java 21
  • Maven
  • Spring Boot
  • Spring Web
  • Spring Webflux
  • Reactor Core
  • Spring Validation
  • Jakarta Validation
  • Spring Dotenv
  • Lombok
  • Spring Test
  • MacOS DNS Resolver

Setup

  • Install dependencies:
./mvnw clean install
  • Start the application:
./mvnw spring-boot:run

Endpoint

Request can be made to perform the following action:

  • Get Details (latitude: required, longitude: required, relativeHumidity: optional, percipitation: optional, windSpeed: optional, feelsLike: optional, isDay: optional, rain: optional, showers: optional, snow: optional, weatherCode: optional, cloudCover: optional, pressure: optional, surfacePressure: optional, windDirection: optional, windGusts: optional)

Get Details

Request

curl --location --request GET 'localhost:8080/api/v2/weather-proxy/get-details' \
--header 'Content-Type: application/json' \
--data '{
    "latitude": "37.7749",
    "longitude": "-122.4194",
    "relativeHumidity": true,
    "precipitation": true,
    "windSpeed": true,
    "feelsLike": true,
    "isDay": true,
    "rain": true,
    "showers": true,
    "snow": true,
    "weatherCode": true,
    "cloudCover": true,
    "pressure": true,
    "surfacePressure": true,
    "windDirection": true,
    "windGusts": true
}'

Response

{
    "time": "2025-01-20 13:30:00",
    "temperature": 7.2,
    "relativeHumidity": 94,
    "precipitation": 0.0,
    "windSpeed": 2.3,
    "feelsLike": 5.9,
    "rain": 0.0,
    "showers": 0.0,
    "snow": 0.0,
    "weatherCode": 45,
    "cloudCover": 100,
    "pressure": 1022.8,
    "surfacePressure": 1020.6,
    "windDirection": 252,
    "windGusts": 6.1
}