The WeatherByIp API is a RESTful web service that provides weather information based on the IP address of the request originator. It utilizes non-commercial, third-party services to perform geolocation and retrieve current weather conditions using the coordinates of the IP. Functionality
WeatherIp development mode
Deployed example
/weather
- Send a GET request to retrieve the current weather data based on the IP address of the request originator. The API performs a geolocation search using a third-party IP-to-location provider and retrieves the weather information using the coordinates of the IP. If successful, it returns the weather data in the response.
/weatherIp/{ipAddress}
- Send a GET request to check the current weather for a specific IP address. The API validates the provided IP address, performs a geolocation search using a third-party IP-to-location provider, and retrieves the weather information using the coordinates of the IP. If successful, it returns the weather data in the response.
/clearDb
- Send a DELETE request to clear the database. This endpoint deletes all location and weather data stored in the database.
API is deployed at http://edbe.somee.com
Prerequisites:
Clone the repository or download the source code from the provided Git repository link.
Build the application using the appropriate build command for your environment.
Run the application using the appropriate command for your environment. This will start the API and make it available for requests.
Try out /weatherIp
and /clearDb
:
If you want to use the /weather
endpoint, you will need to deploy your application to a server. Deploying the application will make the /weather
endpoint accessible to other users.
The WeatherByIp API implements a local SQLite database system to store data from the third-party providers.
This API utilises https://ipinfo.io IP-to-location services and implements its response data in its functionality.
This API utilises https://api.open-meteo.com location-to-weather services and implements its response data in its functionality.
Feel free to reach out if you have any further questions or need additional assistance.