Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Weather-forecast-API

Single-Parameter Weather Forecast API

Overview

This API provides a simple way to obtain weather forecast data for a specific city. Built with Python and Flask, it fetches accurate weather information from OpenWeatherMap.

Features

  • City-based Forecast: Retrieve weather forecasts by providing the name of the city.
  • Simplicity: Easy to use with a single query parameter.
  • Error Handling: Gracefully handles errors for a smooth user experience.

Getting Started

Prerequisites

  • Python 3.x installed on your system.
  • An API key from OpenWeatherMap. Obtain one here.

Installation

  1. Install dependencies:

    pip install Flask requests
  2. Replace API_KEY placeholder:

    • Open app.py in a text editor.
    • Replace 'YOUR_API_KEY' with your actual OpenWeatherMap API key.

Usage

  1. Start the API:

    python app.py

    This will start the Flask development server.

  2. Make a GET request:

    Use your preferred tool (e.g., Postman, cURL) to make a GET request to:

    GET /weather?city=CityName

    Replace CityName with the desired city parameter.

  3. Receive weather forecast data in the response.

API Endpoint

  • GET /weather

    Parameters:

    • city: City name (required)

    Example:

    GET /weather?city=London

SCREENSHOTS:

Screenshot (42)

Screenshot (45)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages