Weather Info Web App using PHP & OpenWeatherMap API
The Weather Info Web Application at developersappindia is a real-time weather information system developed using PHP and styled with HTML5 & CSS3. It allows users to input a city name and receive up-to-date weather information by fetching data from the OpenWeatherMap API.
The app, developed by App Developers India, is designed to be lightweight, user-friendly, and visually modern. It enables users to easily check real-time conditions like temperature, humidity, wind speed, and weather descriptions for any global city. Using cURL in PHP, the app makes API requests and dynamically updates content based on user input.
To build a real-time web application that allows users to:
Enter a city name
Fetch and display current weather details
Provide a simple, beautiful, and responsive interface
Learn and demonstrate API integration using PHP
Note: This is a single-file project that contains everything in
index.php
.
Layer | Technology Used |
---|---|
Frontend | HTML5, CSS3 (Flexbox, Gradient, Shadows) |
Backend | PHP (Form handling, API call with cURL) |
API Service | OpenWeatherMap API (https://openweathermap.org/) |
HTTP Client | cURL (built-in PHP extension) |
Response Format | JSON |
Before running the app, ensure the following:
PHP (v7.0 or higher) is installed
Local server (XAMPP, WAMP, or similar) is running
Internet access is available
A valid OpenWeatherMap API key
Download or Clone the index.php
file.
Place it inside your web server's root directory (e.g., htdocs
for XAMPP).
Open the file in any text editor and replace the API key with your own:
Start Apache via your XAMPP/WAMP server.
Open your browser and visit:
Clean and colorful gradient background
Rounded form elements
Weather icon and details are displayed inside a card
Input city name to fetch weather data
Real-time integration with OpenWeatherMap
Displays:
City and country
Temperature (°C)
Feels-like temperature
Humidity (%)
Weather condition and description
Wind speed (m/s)
Weather icon (from OpenWeatherMap)
Displays a message if the city is not found or input is invalid
API Endpoint:
Sample Request:
Sample JSON Response: