Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MithileshPawar/Lotlinx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Starter

Build and Run Project

interview-tech-challenge> mvn clean package

interview-tech-challenge-main> sh ./localBuildAndRun.sh

...
[main] INFO org.lotlinx.interview.MainServerVerticle - MainVerticle started
[vert.x-eventloop-thread-0] INFO org.lotlinx.interview.MainServerVerticle - HTTP server started on port 8080

API Endpoints

GET/getCurrentAirPollution?latitude={lat}&longitude={lon}
Description

Gets current air pollution details for given latitude and longitude

Parameters
name type data type description
latitude required int Latitude
longitude required int Longitude
Responses
http code content-type
200 application/json
Sample Response
{
    "coord": {
        "lon": -79.6483,
        "lat": 43.5882
    },
    "list": [{
        "main": {
            "aqi": 2
        },
        "components": {
            "co": 207.04,
            "no": 2.4,
            "no2": 11.71,
            "o3": 52.68,
            "so2": 3.34,
            "pm2_5": 15.93,
            "pm10": 18.17,
            "nh3": 0.99
        },
        "dt": 1760450622
    }]
}
Example cURL
 curl http://localhost:8080/getCurrentAirPollution?latitude=43.588216&longitude=-79.648311
GET /weather/cities?names={name1,name2}
Description

Gets current weather for a given list of comma seperated values

Parameters
name type data type description
names required string, (comma seperated) Url encoded CSV values for names.
e.g names=london,new%20york
Responses
http code content-type
200 application/json
Sample Response
[
    {
        "cityName": "New York",
        "countryCode": "US",
        "latitude": 40.7127,
        "longitude": -74.006,
        "weather_condition": "Drizzle",
        "weather_description": "light intensity drizzle",
        "temp_unit": "Celsius",
        "temp": 13.1,
        "feels_like": 12.74,
        "temp_min": 12.19,
        "temp_max": 14.01,
        "wind_speed": 7.2,
        "sunrise": "2025-10-14 07:06:08",
        "sunset": "2025-10-14 18:17:28",
        "timezone": "UTC-04:00"
    },
    {
        "cityName": "Mississauga",
        "countryCode": "CA",
        "latitude": 43.5896,
        "longitude": -79.6444,
        "weather_condition": "Clouds",
        "weather_description": "few clouds",
        "temp_unit": "Celsius",
        "temp": 13.34,
        "feels_like": 12.95,
        "temp_min": 12.12,
        "temp_max": 15.79,
        "wind_speed": 0.45,
        "sunrise": "2025-10-14 07:31:34",
        "sunset": "2025-10-14 18:37:07",
        "timezone": "UTC-04:00"
    }
]
Example cURL
 curl http://localhost:8080/weather/cities?names=new%20york,mississauga
GET /weather/details?latitude={lat}&longitude={lon}
Description

Gets detailed weather info for given latitude and longitude

Parameters
name type data type description
latitude required int Latitude
longitude required int Longitude
Responses
http code content-type
200 application/json
Sample Response
{
    "coord": {
        "lon": -79.6483,
        "lat": 43.5882
    },
    "weather": [
        {
            "id": 801,
            "main": "Clouds",
            "description": "few clouds",
            "icon": "02d"
        }
    ],
    "base": "stations",
    "main": {
        "temp": 13.32,
        "feels_like": 12.93,
        "temp_min": 12.1,
        "temp_max": 15.78,
        "pressure": 1024,
        "humidity": 85,
        "sea_level": 1024,
        "grnd_level": 1006
    },
    "visibility": 10000,
    "wind": {
        "speed": 0.45,
        "deg": 272,
        "gust": 1.34
    },
    "clouds": {
        "all": 20
    },
    "dt": 1760450631,
    "sys": {
        "type": 2,
        "id": 2020569,
        "country": "CA",
        "sunrise": 1760441495,
        "sunset": 1760481429
    },
    "timezone": -14400,
    "id": 6075357,
    "name": "Mississauga",
    "cod": 200
}
Example cURL
 curl http://localhost:8080/weather/details?latitude=43.588216&longitude=-79.648311
GET/geocode/coordinates?name={locationName}
Description

Gets the latitude & longitude for a given location

Parameters
name type data type description
name required string Name of the location or city.
Responses
http code content-type
200 application/json
Sample Response
[
    {
        "name": "Mississauga",
        "local_names": {
            "it": "Mississauga",
            "ru": "Миссиссога",
            "de": "Mississauga",
            "en": "Mississauga",
            "es": "Mississauga",
            "fr": "Mississauga"
        },
        "lat": 43.5896231,
        "lon": -79.6443879,
        "country": "CA",
        "state": "Ontario"
    }
]
Example cURL
 curl http://localhost:8080/geocode/coordinates?name=mississauga

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published