Skip to content

The Weather App is a lightweight, responsive application built with Vanilla JavaScript that allows users to check the current weather of any city using the OpenWeather API. It is designed to teach clean JS architecture, including: Clear DOM selection and structure Proper use of async/await.

Notifications You must be signed in to change notification settings

WebSync360/API-weatherApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Weather App - Vanilla JS

A simple, responsive Weather App built with Vanilla JavaScript and the OpenWeather API.
Get real-time weather data for any city and learn how to interact with APIs in a clean, structured way.


Features

  • Search for any city to get current weather
  • Displays temperature, weather description, humidity, and wind speed
  • Dynamic UI updates based on API response
  • Handles errors and invalid input gracefully
  • Built with clean Vanilla JS structure:
  • DOM selection at the top
  • Functions in the middle
  • Event listeners at the bottom
  • Learn the right way to handle API keys

Demo

Open index.html in your browser and start searching for your favorite cities!


Getting Started

Clone the repository

git clone https://github.com/stackquantum1-max/API-weatherApp.git
cd weather-app

Get your own OpenWeather API Key

Go to OpenWeatherMap Sign up for a free account Go to API Keys and copy your key


Add your API Key

Open script.js Replace the placeholder with your own key: const API_KEY = "YOUR_API_KEY_HERE";

⚠️ Do not push your API key to public repos.


Open the app

Open index.html in your browser Enter a city name and see the weather update dynamically


What You’ll Learn

Querying the DOM and structuring JS cleanly Using fetch() and async/await to get API data Updating the UI dynamically based on API response Handling errors and edge cases properly Best practices for API key security


Technologies Used

HTML5 CSS3 Vanilla JavaScript (ES6+) OpenWeather API


Tips

Always hide private API keys before sharing your project Keep functions focused: one job per function Use proper error handling to avoid breaking the app

About

The Weather App is a lightweight, responsive application built with Vanilla JavaScript that allows users to check the current weather of any city using the OpenWeather API. It is designed to teach clean JS architecture, including: Clear DOM selection and structure Proper use of async/await.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published