Displays current weather information (temperature, humidity, wind speed, weather condition) and local time of the selected city using OpenWeather API and GeoDB Cities API. When searching for city names, it automatically completes and generates suggestions.
Built with vanilla JavaScript.
โจ Demo
yarn
yarn run dev
โช You need to get an API for current weather data. Free plan is just fine for this project.
โช I've implemented autocomplete feature for city names provided by GeoDB. You don't need to pay for this, neither.
Name | Change This | To This |
---|---|---|
cityApiOptions.headers[X-RapidAPI-Key] |
import.meta.env.VITE_CITY_API_KEY |
Your GeoDB Cities API (Required) |
weatherApiKey |
import.meta.env.VITE_WEATHER_API_KEY |
Your OpenWeather API (Required) |
Set VITE_CITY_API_KEY and VITE_WEATHER_API_KEY in your environmental variables to the keys you get.
๐ค Ali Zahid Pak
- Github: @alizahidpak